Prototype Pollution Vulnerability in Axios: Inherited Properties in Nested Option Objects

axios Updated 21 Jul 2026

Summary

20/07/2026
MODERATE
Yes i
Moderate
6.3

GHSA-7q8q-rj6j-mhjq: Axios: Nested axios option objects can consume polluted prototype values. Affects axios across 2 version ranges.

>= 0.8.0, < 0.33.0 >= 1.0.0, < 1.18.0

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

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

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

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 promise-based HTTP client for JavaScript, designed to make HTTP requests easier and more intuitive. It supports features like request and response interception, automatic JSON data transformation, and the ability to cancel requests. However, a vulnerability exists in Axios that allows it to consume inherited properties from nested request option objects when the JavaScript process has a polluted Object.prototype, leading to potential security risks.

Vulnerability Detail

The vulnerability arises from Axios's handling of nested option objects, such as 'auth' and 'paramsSerializer'. When these objects are passed as placeholders (e.g., auth: {}), Axios can inadvertently read inherited properties from Object.prototype, which may have been polluted by other components in the application. This can result in silent injection of sensitive data, such as 'Authorization' headers containing attacker-controlled credentials, or tampering with query strings. The vulnerability is particularly concerning because it can lead to unauthorized access and data exfiltration without any visible errors or warnings.

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.8.0, < 0.33.0 0.33.0
    npm install axios@0.33.0
  • >= 1.0.0, < 1.18.0 1.18.0
    npm install axios@1.18.0

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

Workaround

If immediate upgrading is not feasible, avoid passing placeholder nested option objects. Specifically, remove the 'auth' property entirely when Basic auth is not intended. For 'paramsSerializer', provide explicit own 'encode' and 'serialize' properties or remove 'paramsSerializer' when custom serialization is not required. Here is an example of how to avoid passing placeholders:

const response = await axios.get('http://example.com/api', {
  paramsSerializer: {
    encode: (value) => encodeURIComponent(value),
    serialize: (params) => new URLSearchParams(params).toString(),
  },
  // Do not pass empty auth object
});

Conclusion

In summary, the prototype pollution vulnerability in Axios poses significant risks by allowing inherited properties from polluted Object.prototype to be used in HTTP requests. It is crucial to update to the latest version of Axios to mitigate these risks and ensure the security of your application.

See every vulnerability recorded for axios →

Share this vulnerability

FAQ

Prototype pollution is a security vulnerability that allows an attacker to manipulate the prototype of a base object, potentially leading to unexpected behavior in applications.

You can check if your application is affected by using Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can also use the Vulert playground to test your application without any signup.

The consequences include unauthorized access through injected credentials and potential data tampering via modified query strings, which can lead to significant security breaches.

Yes, you can mitigate the issue by avoiding the use of placeholder nested option objects and ensuring that you provide explicit properties for 'auth' and 'paramsSerializer'.

The CVSS score of this vulnerability is 6.3, indicating a moderate severity level.

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.8.0, < 0.33.0 0.33.0
    npm install axios@0.33.0
  • >= 1.0.0, < 1.18.0 1.18.0
    npm install axios@1.18.0

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