SSRF and Credential Leakage Vulnerability in axios Package

axios Updated 14 Dec 2025

Summary

07/03/2025
Yes i
High
7.7

CVE-2025-27152: axios Requests Vulnerable To Possible SSRF and Credential Leakage via Absolute URL. Affects axios across 2 version ranges.

< 0.30.0 >= 1.0.0, < 1.8.2

Fixed in 0.30.0 or 1.8.2, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2025-27152 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

axios is a popular JavaScript library used for making HTTP requests from both the browser and Node.js environments. It provides a simple API for handling requests and responses, supporting features like interceptors, automatic JSON data transformation, and request cancellation. However, a vulnerability has been identified that allows for Server-Side Request Forgery (SSRF) and potential credential leakage when absolute URLs are passed to axios requests, even when a base URL is set.

Vulnerability Detail

The vulnerability arises from the way axios handles absolute URLs. When an absolute URL is provided to an axios request, it bypasses the configured base URL and sends the request directly to the specified URL. This behavior can lead to SSRF attacks, where an attacker can make requests to internal services, and it can also result in credential leakage, as sensitive headers (like API keys) may be sent to unintended third-party hosts. The issue affects both server-side and client-side usage of axios, making it critical for developers to be aware of this risk.

How To Fix

Latest published version: 1.20.0 as of 22 Oct 2026

npm install axios@1.20.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 0.30.0 0.30.0
    npm install axios@0.30.0
  • >= 1.0.0, < 1.8.2 1.8.2
    npm install axios@1.8.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, avoid passing absolute URLs to axios requests. Instead, ensure that all requests use relative paths or validate user input to prevent absolute URLs from being used. For example, modify your code as follows:

const userId = '123'; // Use a relative path instead of an absolute URL
await internalAPIClient.get(userId);

Conclusion

The axios package has a vulnerability that allows for SSRF and credential leakage when absolute URLs are used in requests. It is crucial for developers to update to version 1.8.2 or later to mitigate this risk. Additionally, implementing input validation can help prevent exploitation of this vulnerability until an update is applied.

See every vulnerability recorded for axios →

Share this vulnerability

FAQ

Server-Side Request Forgery (SSRF) is a vulnerability that allows an attacker to send crafted requests from a vulnerable server to internal or external resources, potentially exposing sensitive data or services.

You can use Vulert, which monitors open-source vulnerabilities in your software by analyzing the package-lock.json file. Visit Vulert Scanner to check if your application is affected without needing to sign up.

The impacts include unauthorized access to internal services via SSRF and the risk of exposing sensitive credentials, such as API keys, to malicious third parties.

Yes, you can implement input validation to ensure that only relative URLs are passed to axios requests, effectively mitigating the risk until an update can be applied.

If an immediate update is not possible, ensure that your application does not accept user input that can lead to absolute URLs being passed to axios, and consider implementing additional security measures to protect sensitive data.

Related vulnerabilities

Recent vulnerabilities recorded for axios.

How To Fix

Latest published version: 1.20.0 as of 22 Oct 2026

npm install axios@1.20.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 0.30.0 0.30.0
    npm install axios@0.30.0
  • >= 1.0.0, < 1.8.2 1.8.2
    npm install axios@1.8.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback