Fix a bug user could change another user's primary email#36586
Merged
silverwind merged 4 commits intogo-gitea:mainfrom Feb 12, 2026
Merged
Fix a bug user could change another user's primary email#36586silverwind merged 4 commits intogo-gitea:mainfrom
silverwind merged 4 commits intogo-gitea:mainfrom
Conversation
wxiaoguang
reviewed
Feb 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes an authorization bug in the user settings email flow where a user could attempt to set another user’s email record (by ID) as their primary email.
Changes:
- Add ownership/existence check before making an email primary in
EmailPost. - Add integration coverage for “email not found” and “email not owned by user” when setting primary email.
- Add a new localized error message for the above failure cases.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
routers/web/user/setting/account.go |
Validates the email ID belongs to the logged-in user before calling MakeActiveEmailPrimary. |
tests/integration/user_settings_test.go |
Adds integration tests covering invalid/unowned email IDs for the PRIMARY action. |
options/locale/locale_en-US.json |
Adds the new flash error string used by the handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
silverwind
approved these changes
Feb 12, 2026
Zettat123
approved these changes
Feb 12, 2026
Collaborator
|
I was unable to create a backport for 1.25. @lunny, please send one manually. 🍵 |
lunny
added a commit
to lunny/gitea
that referenced
this pull request
Feb 12, 2026
lafriks
pushed a commit
that referenced
this pull request
Feb 14, 2026
silverwind
added a commit
to silverwind/gitea
that referenced
this pull request
Feb 14, 2026
* origin/main: (2555 commits) automate updating nix flakes (go-gitea#35641) Update AGENTS.md instructions (go-gitea#36627) use user id in noreply emails (go-gitea#36550) feat(db): Improve BuildCaseInsensitiveLike with lowercase (go-gitea#36598) [skip ci] Updated translations via Crowdin BUG: Fix workflow run jobs API returning null steps (go-gitea#36603) Refactor highlight and diff (go-gitea#36599) Fix bug when do LFS GC (go-gitea#36500) feature to be able to filter project boards by milestones (go-gitea#36321) Update emoji data for Unicode 16 (go-gitea#36596) Adapt monaco error matching pattern to recent webpack config change (go-gitea#36533) Fix a bug user could change another user's primary email (go-gitea#36586) fix(repo-editor): disable Monaco `editContext` to avoid bugs with lost focus (go-gitea#36585) Fine tune diff highlighting (go-gitea#36592) Add code editor setting dropdowns (go-gitea#36534) Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588) Improve diff highlighting (go-gitea#36583) Fix markup code block layout (go-gitea#36578) Remove striped tables in UI (go-gitea#36509) Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570) ... # Conflicts: # custom/conf/app.example.ini # docs/content/administration/config-cheat-sheet.en-us.md # docs/content/administration/config-cheat-sheet.zh-cn.md # modules/setting/security.go # routers/common/errpage.go # services/context/api.go # services/context/context.go
Sirherobrine23
pushed a commit
to Sirherobrine23/gitea
that referenced
this pull request
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.