All vulnerabilities

Servers and applications

GHSA-7cvr-7cff-2mrg

LDAP login selects the local account by email while the directory identity is searched by uid: an unrelated directory entry whose uid attribute equals a victim's Gogs email authenticates as that account - including site admins

Severity
Medium
Published
18 Nov 2026
Last changed
18 Nov 2026
Added to UpHeron
18 Nov 2026
Fixed in
0.15.0
Sources
Project advisories (GitHub)

Description

Two different string matchers decide one LDAP login in Gogs 0.14.4, and they do not have to agree on the same person. Account selection happens first, in the database layer: if the submitted login string contains an @, Gogs selects the local row with WHERE email = ?; otherwise it matches lower_name. Authentication happens second, in the LDAP layer: the provider searches the directory with the configured filter (uid=%s) for exactly one entry and binds with that entry's DN plus the submitted password. If the bind succeeds, Gogs returns the row it picked in step one. The directory entry that got authenticated and the local row that gets returned are never compared - there is no external id, and no check that they describe the same person. The consequence: any directory entry whose uid attribute contains another user's Gogs email (uid attributes in email or UPN form are a common enterprise convention) authenticates into that user's account.

From gogs/gogs's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
GogsServers and applications · github:gogs/gogs
  • Every version before 0.15.0

About Gogs

free forge based on Git written in Go

From Wikidata, CC0 1.0.
Docker Hub pulls
94,040,857Docker Hub, 15 Nov 2026
GitHub stars
47,939GitHub, 15 Nov 2026
Forks
5,082GitHub, 15 Nov 2026
Latest release
v0.14.4GitHub, 15 Nov 2026
Released
12 Nov 2026GitHub
Developer
FLOSS contributorWikidata
License
Expat licenseWikidata
Written in
Go, Cascading Style Sheets, JavaScriptWikidata
First released
11 Feb 2014Wikidata
First published on GitHub
12 Feb 2014GitHub

References