Commit 74b3683c authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Protect against chat message spoofing.

parent f9e05736
......@@ -1069,6 +1069,13 @@ func handleClientMessage(c *webClient, m clientMessage) error {
log.Printf("ICE: %v", err)
}
case "chat", "usermessage":
if m.Id != c.id {
return group.UserError("wrong sender id")
}
if m.Username != "" && m.Username != c.username {
return group.UserError("wrong sender username")
}
tm := group.ToJSTime(time.Now())
if m.Type == "chat" {
if m.Dest == "" {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment