Repository navigation
auth: deny access for disabled accounts on all credential paths - #8439
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Disabled accounts retain private repository access through existing sessions or reverse-proxy authentication, while anonymous fallback allows star/watch requests to create user-0 relations and alter repository counters.
3 open issues
What changed in this PR
This PR extends disabled-account checks beyond web sign-in to repository credential paths, using a shared account-status predicate.
Changes:
- Adds
User.IsDisabled()for prohibited login and activation requirements. - Applies checks to HTTP Git, LFS, SSH, Basic/token authentication, and web repository context.
- Adds predicate and LFS tests, plus a security changelog entry.
| File | Description |
|---|---|
internal/route/repo/http.go |
Rejects disabled users during HTTP Git authentication. |
internal/route/lfs/route.go |
Rejects disabled users during LFS authentication. |
internal/route/lfs/route_test.go |
Tests prohibited accounts using passwords and tokens. |
internal/database/users.go |
Adds the shared disabled-account predicate. |
internal/database/users_test.go |
Tests account-status and email-confirmation combinations. |
internal/context/auth.go |
Adds Basic/token checks while retaining session identity. |
cmd/gogs/serv.go |
Checks SSH key owners on protected access paths. |
cmd/gogs/internal/web/repo_context.go |
Treats disabled repository viewers as anonymous. |
CHANGELOG.md |
Documents the disabled-account security fix. |
Review effort: Balanced
unknwon
added a commit
that referenced
this pull request
Nov 11, 2026
(cherry picked from commit 8a8ebb1)
This was referenced Nov 11, 2026
appthin
added a commit
to appthin/gogs-plus
that referenced
this pull request
Nov 12, 2026
Brings in the 0.14.4 security and bug fixes (gogs#8439, gogs#8472, gogs#8478, gogs#8480-gogs#8484, gogs#8486, gogs#8488), the Highlights-based diff highlighter for the web UI (gogs#8492, gogs#8434, gogs#8435), absolute entrypoint paths for the SPA shell (gogs#8447), Docker workflow updates (gogs#8463, gogs#8475), and housekeeping. Fork-specific code is preserved: CodeQL workflow, login bans, sign-in protection, the -plus release pipeline, and the rewritten README.
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.


Describe the pull request
Accounts that an admin has prohibited from logging in, or that are not activated while email confirmation is required, are now denied on every credential path, not only on web sign-in.
Link to the issue: GHSA-f9cv-gfvg-3464
Checklist
Test plan
moon run gogs:testandmoon run gogs:lintpass.REQUIRE_EMAIL_CONFIRMATION = true). Access through every transport works while the account is enabled and is rejected once it is disabled.