/

CVE-2026-136177

Severity:

HIGH RISK

(7.2)

Server-Side Request Forgery (CWE-918) in gitea-mirror

CVE-2026-136177

Received

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Unauthorized access to internal network services and potential disclosure of response data

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

RayLabsHQ gitea-mirror can be induced to send HTTP requests to URLs supplied to its connection-testing endpoints, without requiring authentication. An attacker may target internal services or cloud metadata endpoints, and response content could be exposed through upstream error messages.

Affected context

The issue occurs in the /api/gitea/test-connection and /api/github/test-connection endpoints when they accept a caller-supplied URL and the server makes an HTTP request to it. Risk depends on whether the service can reach sensitive internal destinations and whether responses or errors are returned to the caller.

Exploit preconditions

  • Attack surface: The Gitea and GitHub connection-testing API endpoints
  • Required access: No authentication is required, according to the vulnerability description
  • Trigger point: A request to either endpoint that supplies a URL for the server to fetch
  • Why exploitation is possible: The server makes requests to caller-controlled destinations, and upstream error messages may disclose response content

Why this happens

The application performs server-side HTTP requests using a URL supplied by the caller without sufficiently restricting the destination. This is a server-side request forgery weakness (CWE-918): untrusted input influences the server's network requests, potentially allowing access to destinations unavailable to the caller. Returning upstream error details can further expose fetched response content.

Potential impact

  • Attackers may reach internal network services from the server's network position
  • Cloud instance metadata or other sensitive endpoints could be targeted
  • Response content may be disclosed through upstream error messages
  • Internal services could receive unexpected requests

General mitigation guidance

Defensive patterns include restricting outbound requests to explicitly approved hosts and schemes, and resolving and validating destinations in a way that accounts for redirects and DNS changes. Network egress controls can limit access to internal and metadata services, while least-privilege network placement reduces the server's reach. Avoid returning raw upstream errors or response bodies to callers; provide generic errors and keep diagnostic details in appropriately protected logs. Treat caller-supplied URLs as untrusted and prefer secure-by-default configurations that deny destinations unless explicitly permitted.

How teams detect issues like this

  • Review code paths where request parameters flow into HTTP client or URL-fetching APIs.
  • Use static analysis to flag caller-controlled URLs passed to outbound request functions.
  • Review error handling for raw upstream response bodies, headers, or exception details returned to clients.
  • Enforce policies for outbound network access, approved destination allowlists, and restricted access to metadata services.
  • Monitor outbound requests from the application for unexpected destinations, redirects, or access to internal address ranges.

Sources

SourceLink
github.comgithub.com/RayLabsHQ/gitea-mirror/blob/v3.38.0/src/pages/api/gitea/test-connection.ts#L84-L105
github.comgithub.com/RayLabsHQ/gitea-mirror/commit/c6157cdaad67321625d315b0f2f836b982cfe335
github.comgithub.com/RayLabsHQ/gitea-mirror/releases/tag/v3.38.1
github.comgithub.com/RayLabsHQ/gitea-mirror/security/advisories/GHSA-9m33-xfrc-5jxw
vulncheck.comvulncheck.com/advisories/gitea-mirror-before-3.38.1-unauthenticated-ssrf-via-connection-test-endpoints

Frequently asked

questions

Yes. The described endpoints accept requests from unauthenticated attackers, who can supply a URL for the server to fetch.

No authentication is required according to the vulnerability description. The endpoints must be reachable, and the server must be able to reach the targeted destination.

Restrict outbound requests to explicitly approved destinations and avoid exposing upstream response content or detailed errors to callers.

Treat URLs from users as untrusted, apply outbound network controls, review URL-fetching code paths, and monitor for unexpected server-originated requests.

Find out what's already
exploitable in your codebase.