Axios: Prototype pollution auth subfields can inject Basic auth
Axios versions from 1.15.2 up to but not including 1.18.0 contain a prototype pollution read-side vulnerability in Basic auth subfield handling. If an application using axios is already vulnerable to prototype pollution and makes a request with an auth object missing username or password properties, axios may inherit these values from Object.prototype and inject attacker-controlled Basic auth credentials into outbound requests. This can lead to outbound request tampering, including injection or replacement of Authorization headers, but does not directly disclose existing credentials. The vulnerability requires a separate prototype pollution primitive in the host application and specific axios usage patterns.
AI Analysis
Technical Summary
Axios versions >=1.15.2 <1.18.0 have a vulnerability where Basic auth subfields (username and password) are read without own-property checks, allowing prototype pollution in Object.prototype.username and Object.prototype.password to influence the Authorization header in outbound requests. This occurs when axios receives an auth object lacking these own properties, causing it to read inherited polluted values. The vulnerability affects Node HTTP adapter and browser/fetch helpers. Exploitation requires a pre-existing prototype pollution vulnerability in the host environment and axios calls passing empty or partial auth objects. The fix involves adding own-property checks to these subfield reads.
Potential Impact
An attacker able to pollute Object.prototype.username or Object.prototype.password can cause axios to send attacker-chosen Basic auth credentials in outbound requests when the auth object is empty or missing these fields. This can tamper with outbound requests by injecting or replacing Authorization headers, potentially causing authorization failures or unintended access. However, this does not automatically disclose legitimate credentials from axios or the application. Credential disclosure would require additional application-specific conditions such as observable request destinations and partial real auth objects.
Mitigation Recommendations
No official patch or fix is currently confirmed. To mitigate, avoid passing empty or partial auth objects to axios requests. Only set auth when both username and password are explicitly provided as own properties. Applications merging untrusted input should filter prototype pollution vectors such as __proto__, constructor, and prototype. Use null-prototype objects or explicitly copy own properties when materializing optional auth objects. Monitor vendor advisories for official fixes and apply them when available.
Axios: Prototype pollution auth subfields can inject Basic auth
Description
Axios versions from 1.15.2 up to but not including 1.18.0 contain a prototype pollution read-side vulnerability in Basic auth subfield handling. If an application using axios is already vulnerable to prototype pollution and makes a request with an auth object missing username or password properties, axios may inherit these values from Object.prototype and inject attacker-controlled Basic auth credentials into outbound requests. This can lead to outbound request tampering, including injection or replacement of Authorization headers, but does not directly disclose existing credentials. The vulnerability requires a separate prototype pollution primitive in the host application and specific axios usage patterns.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Axios versions >=1.15.2 <1.18.0 have a vulnerability where Basic auth subfields (username and password) are read without own-property checks, allowing prototype pollution in Object.prototype.username and Object.prototype.password to influence the Authorization header in outbound requests. This occurs when axios receives an auth object lacking these own properties, causing it to read inherited polluted values. The vulnerability affects Node HTTP adapter and browser/fetch helpers. Exploitation requires a pre-existing prototype pollution vulnerability in the host environment and axios calls passing empty or partial auth objects. The fix involves adding own-property checks to these subfield reads.
Potential Impact
An attacker able to pollute Object.prototype.username or Object.prototype.password can cause axios to send attacker-chosen Basic auth credentials in outbound requests when the auth object is empty or missing these fields. This can tamper with outbound requests by injecting or replacing Authorization headers, potentially causing authorization failures or unintended access. However, this does not automatically disclose legitimate credentials from axios or the application. Credential disclosure would require additional application-specific conditions such as observable request destinations and partial real auth objects.
Mitigation Recommendations
No official patch or fix is currently confirmed. To mitigate, avoid passing empty or partial auth objects to axios requests. Only set auth when both username and password are explicitly provided as own properties. Applications merging untrusted input should filter prototype pollution vectors such as __proto__, constructor, and prototype. Use null-prototype objects or explicitly copy own properties when materializing optional auth objects. Monitor vendor advisories for official fixes and apply them when available.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-xj6q-8x83-jv6g
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a5e79ef2a4a8d59899bc253
Added to database: 07/20/2026, 19:41:35 UTC
Last enriched: 07/20/2026, 19:49:04 UTC
Last updated: 07/21/2026, 06:45:13 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.