Gogs allows argument injection during the previewing of changes

Description

Impact

Unprivileged user accounts can write to arbitrary files on the filesystem. We could demonstrate its exploitation to force a re-installation of the instance, granting administrator rights. It allows accessing and altering any user's code hosted on the same instance.

Patches

Unintended Git options has been ignored for diff preview (https://github.com/gogs/gogs/pull/7871). Users should upgrade to 0.13.1 or the latest 0.14.0+dev.

Workarounds

No viable workaround available, please only grant access to trusted users to your Gogs instance on affected versions.

References

https://www.cve.org/CVERecord?id=CVE-2024-39932

Basic information

Type
reviewed
Severity
critical
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2024-12-23 20:38:27 UTC
Updated
2024-12-23 20:38:28 UTC
GitHub reviewed
2024-12-23 20:38:27 UTC

EPSS Score

Score Percentile
2.82% 85.65%

CVSS Scores

Base score Version Severity Vector
10.0 3.1
CVSS:3.1/AC:L/AV:N/A:H/C:H/I:H/PR:L/S:C/UI:N Click to expand
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Privileges required (PR:L)
A normal user session is enough; they don’t have to be admin.
Scope (S:C)
Breaking this can reach past the original component and bite other resources—bigger blast radius.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.

Identifiers

CWEs

CWE id Name
CWE-94 Improper Control of Generation of Code ('Code Injection')

Credits

  • swapgs (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
go gogs.io/gogs <= 0.13.0 0.13.1

References

cvelogic Threat Intelligence