/

CVE-2026-59702

Severity:

CRITICAL RISK

(9.3)

SSRF (CWE-918) in repomix /api/pack URL handling

CVE-2026-59702

Deferred

Vulnerability type

Category:

Server-Side Request Forgery (SSRF)

CWE:

CWE-918

Impact:

Arbitrary outbound network access and internal data exposure

Severity:

CRITICAL RISK

(9.3)

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

The repomix /api/pack endpoint contains a server-side request forgery (SSRF) flaw that lets unauthenticated users cause the server to send arbitrary outbound requests via git clone.

Because URLs like http://, https://, and file:// are not properly validated or restricted, this becomes risky whenever the service can reach internal networks, cloud metadata endpoints, or sensitive local filesystem paths.

Affected context

This vulnerability appears in deployments of repomix where the POST /api/pack endpoint is exposed and accepts user-supplied repository URLs.

It is most impactful when the repomix server:

  • Runs inside a network with access to internal services or management planes
  • Has connectivity to cloud provider metadata endpoints (e.g., GCP metadata service)
  • Has local filesystem paths that can be referenced via supported URL schemes (e.g., file://)

The issue manifests when user-controlled URLs are passed directly into git clone without strict validation or allow-listing.

Exploit preconditions

  • Attack surface: Publicly exposed POST /api/pack HTTP endpoint
  • Required access: No authentication; attacker only needs network reachability to the repomix service
  • Trigger point: Submission of a crafted URL parameter (http://, https://, or file://) that is forwarded to git clone
  • Why exploitation is possible: The endpoint trusts user-provided URLs and does not enforce scheme restrictions, host allow-lists, or path validation, allowing interaction with internal resources and local paths through server-side execution of git clone.

Why this happens

The underlying bug class is server-side request forgery as described by CWE-918, where a server-side component performs outbound requests based on untrusted user input.

In this case, the application passes user-specified URLs directly to git clone, effectively turning the server into a proxy to reach arbitrary network locations and local resources.

The lack of strict URL validation, scheme filtering, and network egress controls causes the server to honor attacker-supplied addresses, violating trust boundaries between public inputs and internal infrastructure.

Potential impact

  • May allow access to internal HTTP services that are not publicly exposed
  • Could enable retrieval of cloud provider metadata, including credentials or configuration
  • Can expose sensitive local filesystem content reachable via supported URL schemes
  • May assist in network reconnaissance and enumeration of internal services
  • Could provide a foothold for further lateral movement or privilege escalation within the environment

General mitigation guidance

Effective mitigation focuses on treating user-supplied URLs as untrusted and tightly constraining what the server is allowed to reach.

Common patterns include:

  • Enforcing strict allow-lists for repository hosts and schemes (e.g., only https:// to known domains)
  • Rejecting or sanitizing file:// and other non-HTTP(S) schemes
  • Applying network egress policies to prevent access to internal ranges and metadata services
  • Separating components that perform outbound network calls into hardened, least-privilege environments
  • Logging and rate-limiting outbound requests triggered by user input to reduce abuse potential

How teams detect issues like this

Detection typically involves reviewing both code and runtime behavior for SSRF patterns.

Helpful approaches include:

  • Static analysis and manual review for locations where user-controlled URLs are passed to HTTP clients, git, or other network-aware tools
  • Security checks in CI that flag use of generic URL handling without host allow-lists or scheme filters
  • Monitoring outbound traffic from the application for unusual destinations, such as cloud metadata IPs or internal management ports
  • Policy enforcement at the network layer (e.g., firewall rules) to block access to sensitive internal addresses, combined with alerts when violations are attempted

Sources

SourceLink
github.comgithub.com/CrazyForks/repomix/commit/c748b524f41225e7fc6f89ad0084520901a453cf
github.comgithub.com/yamadashy/repomix
github.comgithub.com/yamadashy/repomix/issues/1703
vulncheck.comvulncheck.com/advisories/repomix-server-side-request-forgery-via-unvalidated-repository-urls-in-post-api-pack

Frequently asked

questions

Yes. As described, unauthenticated remote users can exploit the exposed POST /api/pack endpoint as long as they have network access to the repomix service.

The attacker only needs the ability to send HTTP requests to the vulnerable endpoint; no valid account or prior access to internal systems is required.

Restrict the URLs that the server will process by using strict allow-lists, validating schemes and hosts, and preventing access to file:// and internal address ranges, while also enforcing network egress controls for the component that runs git clone.

Adopt a design pattern where server-side network calls are never made directly from user-supplied URLs, enforce robust validation and allow-lists at input boundaries, and backstop these controls with network-layer restrictions and security-focused code review.

Find out what's already
exploitable in your codebase.