Junglewise Threat Intelligence

CVE-2025-27152: axios SSRF and credential leakage via absolute URL

CVE-2025-27152 · Severity: medium · CVSS 4 · Published 2025-03-07

Technologies: Axios. Vendors: Axios.

Executive brief

axios is a widely-used HTTP client library for JavaScript. When a baseURL is configured, axios should use it to construct all request URLs. However, if an attacker can control the URL parameter passed to axios methods, they can supply an absolute URL that axios will use instead of the configured baseURL. This allows attackers to redirect requests to malicious servers while including sensitive credentials (like API keys) that were configured in the original client instance.

Technical details

The vulnerability is a Server-Side Request Forgery (SSRF) and credential leakage issue in axios's URL handling. When a baseURL is set during axios client creation and an absolute URL (e.g., http://attacker.test/) is passed to request methods like get(), axios ignores the baseURL and sends the request to the attacker-controlled absolute URL. This occurs because axios does not validate that the final constructed URL still begins with the expected baseURL. An attacker who can influence the URL parameter—for example, through unsanitized user input treated as a resource identifier—can exfiltrate credentials (HTTP headers, cookies, API keys) configured in the axios instance to arbitrary external hosts. The vulnerability affects both server-side (Node.js) and client-side (browser) deployments. Patches are available in axios v1.8.2 and v0.30.0.

Affected products

  • axios axios <= 1.7.9 and <= 0.29.0

Timeline

  • 2025-03-07: disclosed: Advisory GHSA-jr5f-v2jv-69x6 published on GitHub and OSV
  • 2025-03-07: patched: Fixed in axios v1.8.2 and v0.30.0

References

Related threats