All vulnerabilities

Servers and applications

GHSA-f9vc-qvc8-p7cf

Two-factor authentication bypass in the Gogs web API through a leading-slash path mismatch

Severity
High 8.1
Published
18 Nov 2026
Last changed
18 Nov 2026
Added to UpHeron
18 Nov 2026
Weakness
Improper authentication (CWE-287)Authentication bypass by an alternate path (CWE-288)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read data · Change data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Sources
Project advisories (GitHub)

Description

An attacker who knows a user's password but not the user's second factor can send HTTP Basic credentials to a path with an extra leading slash, such as //api/web/user/settings/two-factor. The authentication check compares the raw request path against the literal prefix /api/web/, so the extra slash makes the check skip and the password is accepted. The router trims leading slashes before matching and still sends the request to the intended handler.

The attacker can then call the web API routes that change credentials and two-factor authentication. Disabling two-factor authentication with a single DELETE request is enough. After that, a normal password sign-in succeeds without any second factor. On an administrator account this gives full site administration.

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

Affected software

SoftwareAffected versions
GogsServers and applications · github:gogs/gogs
  • Version 0.15.0+dev

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