GHSA-3m6q-h5gj-7mrw — gitea
GHSA-3m6q-h5gj-7mrw is a security vulnerability in code.gitea.io/gitea. A fix is available for code.gitea.io/gitea — see the affected versions and patch details below.
Gitea has insecure default SSH settings
Real-World Exposure
code.gitea.io/giteaReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
The built-in SSH server currently advertises a number of key exchange, MAC, and host key algorithms that are considered weak or broken. The defaults should be tightened so a fresh installation passes a baseline SSH security audit out of the box.
Details
Running ssh-audit against a default deployment flags the following as fail:
- Key exchange
ecdh-sha2-nistp256ecdh-sha2-nistp384ecdh-sha2-nistp521
- MAC
hmac-sha1
- Host key
ssh-rsa
Reproduction
docker run -it --rm positronsecurity/ssh-audit -p 2222 gitea.local
Impact
Default deployments expose algorithms that are known-weak or deprecated upstream. The current workaround requires manually setting several GITEA__server__SSH_SERVER_* variables, which most users will never do.
Workaround
[server]
SSH_SERVER_KEY_EXCHANGES = curve25519-sha256, diffie-hellman-group14-sha256
SSH_SERVER_CIPHERS = [email protected], aes128-ctr, aes192-ctr, aes256-ctr, [email protected], [email protected]
SSH_SERVER_MACS = [email protected], hmac-sha2-256
There is no exposed option to restrict host key algorithms, so ssh-rsa remains advertised.
Acceptance criteria
- Default
SSH_SERVER_KEY_EXCHANGES,SSH_SERVER_CIPHERS, andSSH_SERVER_MACSupdated to the secure list above. - New
SSH_SERVER_HOST_KEY_ALGORITHMSoption added, with a default that excludesssh-rsa. - Documentation updated to reflect the new defaults.
-
ssh-auditagainst a fresh install reports no[fail]entries.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | code.gitea.io/gitea | all versions | 1.25.0go get code.gitea.io/gitea@v1.25.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.gitea.io/gitea, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update code.gitea.io/gitea to 1.25.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3m6q-h5gj-7mrw is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-3m6q-h5gj-7mrw can be triaged on real exposure rather than presence alone.
Tailored to GHSA-3m6q-h5gj-7mrw. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-3m6q-h5gj-7mrw in your dependencies?
O3 Security finds GHSA-3m6q-h5gj-7mrw across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.