Published Date: December 25, 2024
Package | Affected Versions | Patched Versions | Severity |
---|---|---|---|
📦 gogs.io/gogs (Go) | <= 0.13.0 | 0.13.1 | Critical |
Description
đź“š Vulnerability Overview
In Gogs versions 0.13.0 and earlier, an argument injection vulnerability exists in the built-in SSH server.
When the SSH server is enabled (
[server] START_SSH_SERVER = true
), any unprivileged user with an SSH key can run arbitrary commands on the Gogs server. These commands execute with the same permissions as the user specified by RUN_USER
in the configuration file.This flaw could allow attackers to:
- Access other users’ code.
- Modify repositories.
- Potentially gain control over the server.
Patches & Workarounds
🛠️ Fix
Upgrade Gogs to:
- v0.13.1 (patched version)
- v0.14.0+dev (latest development version)
The patch removes the vulnerable behavior by making the SSH
env
command a passthrough, effectively disabling the feature.đź©ą Workaround (Temporary Fix)
If upgrading isn’t possible:
- Disable the built-in SSH server on all operating systems except Windows.
To do this, set:
đź“ť Recommendation
- Update to a patched version immediately.
- If an update isn’t possible, disable the SSH server.
- Review server logs for suspicious SSH activity.