GHSA-3m6q-h5gj-7mrw: Code.gitea.io/gitea Gitea Has Insecure Default SSH Vulnerability

MODERATE
CWE-1188 CWE-327
Published
Advisory Summary

GHSA-3m6q-h5gj-7mrw is a MODERATE gitea has insecure default ssh vulnerability (CWE-1188: Initialization of a Resource with an Insecure Default) affecting Code.gitea.io/gitea libraries in the Go ecosystem. The issue involves gitea has insecure default ssh settings. Remediation is available by upgrading affected packages to version 1.25.0.

GHSA-3m6q-h5gj-7mrw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3m6q-h5gj-7mrw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-1188: Initialization of a Resource with an Insecure Default
Affected Product Code.gitea.io/gitea
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-3m6q-h5gj-7mrw

To remediate this vulnerability, upgrade all affected Code.gitea.io/gitea dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code.gitea.io/gitea fixed: 1.25.0
Upgrade code.gitea.io/gitea to 1.25.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for code.gitea.io/gitea

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3m6q-h5gj-7mrw, inspect your project dependencies for Code.gitea.io/gitea:

inspect dependencies for code.gitea.io/gitea

Analyze the terminal output to locate any version of Code.gitea.io/gitea in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.25.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1188: Initialization of a Resource with an Insecure Default, where the product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure. In Code.gitea.io/gitea, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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-nistp256` - `ecdh-sha2-nistp384` - `ecdh-sha2-nistp521` - **MAC** - `hmac-sha1` - **Host key** - `ssh-rsa` ## Reproduction ```sh 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 ```ini [server] SSH_SERVER_KEY_EXCHANGES = curve25519-sha256, diffie-hellman-group14-sha256 SSH_SERVER_CIPHERS = chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com SSH_SERVER_MACS = hmac-sha2-256-etm@openssh.com, 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`, and `SSH_SERVER_MACS` updated to the secure list above. - [ ] New `SSH_SERVER_HOST_KEY_ALGORITHMS` option added, with a default that excludes `ssh-rsa`. - [ ] Documentation updated to reflect the new defaults. - [ ] `ssh-audit` against a fresh install reports no `[fail]` entries.

GHSA-3m6q-h5gj-7mrw Affected Code.gitea.io/gitea Versions

1 component(s)
Fixed Versions:
1.25.0
Product / Package Ecosystem Affected Versions Fixed Version
code.gitea.io/gitea
Go
< 1.25.0
1.25.0

References

Frequently Asked Questions

What is GHSA-3m6q-h5gj-7mrw?
GHSA-3m6q-h5gj-7mrw is a security vulnerability in Code.gitea.io/gitea involving Gitea has insecure default SSH settings under CWE-1188: Initialization of a Resource with an Insecure Default.
Which Code.gitea.io/gitea versions are affected?
Affected versions include releases prior to 1.25.0 across affected packages: code.gitea.io/gitea.
What version fixes GHSA-3m6q-h5gj-7mrw?
Upgrading to 1.25.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.gitea.io/gitea affected?
Yes, code.gitea.io/gitea is affected in releases prior to 1.25.0. Upgrade your dependency to 1.25.0 or later.
What CWE is associated with GHSA-3m6q-h5gj-7mrw?
GHSA-3m6q-h5gj-7mrw is classified under CWE-1188: Initialization of a Resource with an Insecure Default (The product initializes or sets a resource with a default that is intended to be changed by the product's installer, administrator, or maintainer, but the default is not secure.).
How can I check Go dependencies for GHSA-3m6q-h5gj-7mrw?
Run the dependency tree command: 'inspect dependencies for code.gitea.io/gitea'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3m6q-h5gj-7mrw",
  "modified" : "2026-04-22T20:37:21Z",
  "published" : "2026-04-22T20:37:21Z",
  "aliases" : [ ],
  "summary" : "Gitea has insecure default SSH settings",
  "details" : "## Summary\n\nThe 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.\n\n## Details\n\nRunning `ssh-audit` against a default deployment flags the following as `fail`:\n\n- **Key exchange**\n  - `ecdh-sha2-nistp256`\n  - `ecdh-sha2-nistp384`\n  - `ecdh-sha2-nistp521`\n- **MAC**\n  - `hmac-sha1`\n- **Host key**\n  - `ssh-rsa`\n\n## Reproduction\n\n```sh\ndocker run -it --rm positronsecurity/ssh-audit -p 2222 gitea.local\n```\n\n## Impact\n\nDefault 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.\n\n### Workaround\n\n```ini\n[server]\nSSH_SERVER_KEY_EXCHANGES = curve25519-sha256, diffie-hellman-group14-sha256\nSSH_SERVER_CIPHERS       = chacha20-poly1305@openssh.com, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com\nSSH_SERVER_MACS          = hmac-sha2-256-etm@openssh.com, hmac-sha2-256\n```\n\nThere is no exposed option to restrict host key algorithms, so `ssh-rsa` remains advertised.\n\n## Acceptance criteria\n\n- [ ] Default `SSH_SERVER_KEY_EXCHANGES`, `SSH_SERVER_CIPHERS`, and `SSH_SERVER_MACS` updated to the secure list above.\n- [ ] New `SSH_SERVER_HOST_KEY_ALGORITHMS` option added, with a default that excludes `ssh-rsa`.\n- [ ] Documentation updated to reflect the new defaults.\n- [ ] `ssh-audit` against a fresh install reports no `[fail]` entries.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.gitea.io/gitea"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.25.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-gitea/gitea/security/advisories/GHSA-3m6q-h5gj-7mrw"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-gitea/gitea"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1188", "CWE-327" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-22T20:37:21Z",
    "nvd_published_at" : null
  }
}