Skip to content

Commit 17a2083

Browse files
committed
Security fix to correct a vulnerability with password protected channels.
1 parent 30d11fa commit 17a2083

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

server/clientChannel.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ func (c *ClientChannel) Lmotd(ctype, name, password string) string {
2828
case connTypeSlave:
2929
msg += "No one will be able to control your computer"
3030
if c.password != "" {
31-
msg += " unless they authenticate with the password " + c.password
31+
msg += " unless they authenticate"
32+
if password == c.password {
33+
msg += " with the password " + c.password
34+
} else {
35+
msg += "."
36+
}
3237
} else {
3338
msg += "."
3439
}
@@ -37,7 +42,7 @@ func (c *ClientChannel) Lmotd(ctype, name, password string) string {
3742
msg += "You won't be able to control any computers connected to this channel."
3843
}
3944
if c.password == password && c.password != "" {
40-
msg += "You are authorized to control any computer connected to this channel. Authorized with password " + password
45+
msg += "You are authorized to control any computer connected to this channel. Authorized with password " + c.password
4146
}
4247
}
4348
if !c.locked {

0 commit comments

Comments
 (0)