Skip to content

Don't disclose emails of all users when sending out emails #4664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions models/issue_mail.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright 2016 The Gogs Authors. All rights reserved.
// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -87,7 +88,9 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content
names = append(names, participants[i].Name)
}

SendIssueCommentMail(issue, doer, content, comment, tos)
for _, to := range tos {
SendIssueCommentMail(issue, doer, content, comment, []string{to})
Copy link
Member

@jonasfranz jonasfranz Aug 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emails should be send to all users which have there email adresse disclosed at once, shouldn't them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that is possible, however I wanted to resolve the security issue before adding any enhancements.

}

// Mail mentioned people and exclude watchers.
names = append(names, doer.Name)
Expand All @@ -99,7 +102,12 @@ func mailIssueCommentToParticipants(e Engine, issue *Issue, doer *User, content

tos = append(tos, mentions[i])
}
SendIssueMentionMail(issue, doer, content, comment, getUserEmailsByNames(e, tos))

emails := getUserEmailsByNames(e, tos)

for _, to := range emails {
SendIssueMentionMail(issue, doer, content, comment, []string{to})
}

return nil
}
Expand Down