chore(deps): update dependency axios to v1.15.2 [security]#52
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore(deps): update dependency axios to v1.15.2 [security]#52renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
7752fb7 to
5333e0e
Compare
5333e0e to
c02ff0f
Compare
c02ff0f to
fdee9b1
Compare
fdee9b1 to
68e5423
Compare
68e5423 to
ed4eda4
Compare
ed4eda4 to
059f498
Compare
059f498 to
b60bb02
Compare
b60bb02 to
fe552a3
Compare
fe552a3 to
c4f2cfd
Compare
c4f2cfd to
a894c2a
Compare
a894c2a to
c090939
Compare
c090939 to
872e118
Compare
872e118 to
ca1610e
Compare
ca1610e to
2c035dd
Compare
2c035dd to
bd1b763
Compare
bd1b763 to
423e922
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.6.5→1.15.2Server-Side Request Forgery in axios
CVE-2024-39338 / GHSA-8hc4-vh64-cxmj
More information
Details
axios 1.7.2 allows SSRF via unexpected behavior where requests for path relative URLs get processed as protocol relative URLs.
Severity
High
References
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain
CVE-2026-40175 / GHSA-fvcv-3m26-pcqx
More information
Details
Vulnerability Disclosure: Unrestricted Cloud Metadata Exfiltration via Header Injection Chain
Summary
The Axios library is vulnerable to a specific "Gadget" attack chain that allows Prototype Pollution in any third-party dependency to be escalated into Remote Code Execution (RCE) or Full Cloud Compromise (via AWS IMDSv2 bypass).
While Axios patches exist for preventing check pollution, the library remains vulnerable to being used as a gadget when pollution occurs elsewhere. This is due to a lack of HTTP Header Sanitization (CWE-113) combined with default SSRF capabilities.
Severity: Critical (CVSS 9.9)
Affected Versions: All versions (v0.x - v1.x)
Vulnerable Component:
lib/adapters/http.js(Header Processing)Usage of "Helper" Vulnerabilities
This vulnerability is unique because it requires Zero Direct User Input.
If an attacker can pollute
Object.prototypevia any other library in the stack (e.g.,qs,minimist,ini,body-parser), Axios will automatically pick up the polluted properties during its config merge.Because Axios does not sanitise these merged header values for CRLF (
\r\n) characters, the polluted property becomes a Request Smuggling payload.Proof of Concept
1. The Setup (Simulated Pollution)
Imagine a scenario where a known vulnerability exists in a query parser. The attacker sends a payload that sets:
2. The Gadget Trigger (Safe Code)
The application makes a completely safe, hardcoded request:
3. The Execution
Axios merges the prototype property
x-amz-targetinto the request headers. It then writes the header value directly to the socket without validation.Resulting HTTP traffic:
4. The Impact (IMDSv2 Bypass)
The "Smuggled" second request is a valid
PUTrequest to the AWS Metadata Service. It includes the requiredX-aws-ec2-metadata-token-ttl-secondsheader (which a normal SSRF cannot send).The Metadata Service returns a session token, allowing the attacker to steal IAM credentials and compromise the cloud account.
Impact Analysis
Cookie,Authorization) to pivot into internal administrative panels.Hostheaders to poison shared caches.Recommended Fix
Validate all header values in
lib/adapters/http.jsandxhr.jsbefore passing them to the underlying request function.Patch Suggestion:
References
This report was generated as part of a security audit of the Axios library.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios has a NO_PROXY Hostname Normalization Bypass that Leads to SSRF
CVE-2025-62718 / GHSA-3p68-rc4w-qgx5
More information
Details
Axios does not correctly handle hostname normalization when checking
NO_PROXYrules.Requests to loopback addresses like
localhost.(with a trailing dot) or[::1](IPv6 literal) skipNO_PROXYmatching and go through the configured proxy.This goes against what developers expect and lets attackers force requests through a proxy, even if
NO_PROXYis set up to protect loopback or internal services.According to RFC 1034 §3.1 and RFC 3986 §3.2.2, a hostname can have a trailing dot to show it is a fully qualified domain name (FQDN). At the DNS level,
localhost.is the same aslocalhost.However, Axios does a literal string comparison instead of normalizing hostnames before checking
NO_PROXY. This causes requests likehttp://localhost.:8080/andhttp://[::1]:8080/to be incorrectly proxied.This issue leads to the possibility of proxy bypass and SSRF vulnerabilities allowing attackers to reach sensitive loopback or internal services despite the configured protections.
PoC
Expected: Requests bypass the proxy (direct to loopback).
Actual: Proxy logs requests for
localhost.and[::1].Impact
Applications that rely on
NO_PROXY=localhost,127.0.0.1,::1for protecting loopback/internal access are vulnerable.Attackers controlling request URLs can:
Affected Versions
NO_PROXYevaluation.Remediation
Axios should normalize hostnames before evaluating
NO_PROXY, including:Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:L/VA:N/SC:L/SI:L/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios: Authentication Bypass via Prototype Pollution Gadget in
validateStatusMerge StrategyCVE-2026-42041 / GHSA-w9j2-pvgh-6h63
More information
Details
Vulnerability Disclosure: Authentication Bypass via Prototype Pollution Gadget in
validateStatusMerge StrategySummary
The Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any
Object.prototypepollution to silently suppress all HTTP error responses (401, 403, 500, etc.), causing them to be treated as successful responses. This completely bypasses application-level authentication and error handling.The root cause is that
validateStatusis the only config property using themergeDirectKeysmerge strategy, which uses JavaScript'sinoperator — an operator that inherently traverses the prototype chain. WhenObject.prototype.validateStatusis polluted with() => true, all HTTP status codes are accepted as success.Severity: High (CVSS 8.2)
Affected Versions: All versions (v0.x - v1.x including v1.15.0)
Vulnerable Component:
lib/core/mergeConfig.js(mergeDirectKeysstrategy) +lib/core/settle.jsCWE
CVSS 3.1
Score: 8.2 (High)
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:NUsage of "Helper" Vulnerabilities
This vulnerability requires Zero Direct User Input.
If an attacker can pollute
Object.prototypevia any other library in the stack, Axios will automatically inherit the pollutedvalidateStatusfunction during config merge. Theinoperator inmergeDirectKeysmakes this property uniquely susceptible to prototype pollution compared to all other config properties.Why
validateStatusIs Uniquely VulnerableAll other config properties use
defaultToConfig2, which readsconfig2[prop](traverses prototype). ButvalidateStatususesmergeDirectKeys, which uses theinoperator:The
inoperator is a more aggressive prototype traversal than property access. Whileconfig2['validateStatus']also traverses the prototype, the explicitincheck makes the intent clearer and the vulnerability more direct.Proof of Concept
1. The Setup (Simulated Pollution)
2. The Gadget Trigger (Safe Code)
3. The Execution
4. The Impact
Verified PoC Output
Impact Analysis
Recommended Fix
Replace the
inoperator withhasOwnPropertyinmergeDirectKeys:Resources
inoperatorTimeline
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios has prototype pollution read-side gadgets in HTTP adapter that allow credential injection and request hijacking
CVE-2026-42264 / GHSA-q8qp-cvcw-x6jj
More information
Details
Summary
Five config properties in the HTTP adapter are read via direct property access without
hasOwnPropertyguards, making them exploitable as prototype pollution gadgets. WhenObject.prototypeis polluted by another dependency in the same process, axios silently picks up these polluted values on every outbound HTTP request.Affected Properties
config.auth(lib/adapters/http.jsline 617) Injects attacker-controlledAuthorizationheader on all requests.config.baseURL(lib/helpers/resolveConfig.jsline 18) Redirects all requests using relative URLs to an attacker-controlled server.config.socketPath(lib/adapters/http.jsline 669) Redirects requests to internal Unix sockets (e.g. Docker daemon).config.beforeRedirect(lib/adapters/http.jsline 698) Executes attacker-supplied callback during HTTP redirects.config.insecureHTTPParser(lib/adapters/http.jsline 712) Enables Node.js insecure HTTP parser on all requests.Proof of Concept
Impact
Authorizationheader, leaking request contents to any server that logs auth headers.Root Cause
mergeConfig()iteratesObject.keys({...config1, ...config2}), which only returns own properties. When neither the defaults nor the user config sets these properties, they are absent from the merged config. The HTTP adapter then reads them via direct property access (config.auth,config.socketPath, etc.), which traverses the prototype chain and picks up polluted values.The
own()helper atlib/adapters/http.jsline 336 exists and guards 8 other properties (data,lookup,family,httpVersion,http2Options,responseType,responseEncoding,transport) from this exact attack. The 5 properties listed above are not included in this protection.Suggested Fix
Apply the existing
own()helper to all affected properties:Same pattern for
socketPath,beforeRedirect,insecureHTTPParser, and ahasOwnPropertycheck forbaseURLinresolveConfig.js.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios: Invisible JSON Response Tampering via Prototype Pollution Gadget in
parseReviverCVE-2026-42044 / GHSA-3w6x-2g7m-8v23
More information
Details
Vulnerability Disclosure: Invisible JSON Response Tampering via Prototype Pollution Gadget in
parseReviverSummary
The Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any
Object.prototypepollution in the application's dependency tree to be escalated into surgical, invisible modification of all JSON API responses — including privilege escalation, balance manipulation, and authorization bypass.The default
transformResponsefunction atlib/defaults/index.js:124callsJSON.parse(data, this.parseReviver), wherethisis the merged config object. BecauseparseReviveris not present in Axios defaults, not validated byassertOptions, and not subject to any constraints, a pollutedObject.prototype.parseReviverfunction is called for every key-value pair in every JSON response, allowing the attacker to selectively modify individual values while leaving the rest of the response intact.This is strictly more powerful than the
transformResponsegadget because:Severity: Critical (CVSS 9.1)
Affected Versions: All versions (v0.x - v1.x including v1.15.0)
Vulnerable Component:
lib/defaults/index.js:124(JSON.parse with prototype-inherited reviver)CWE
CVSS 3.1
Score: 9.1 (Critical)
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:NapiKey: "sk-secret-internal-key"is capturedisAdmin: false → true,role: "viewer" → "admin",balance: 100 → 999999. The response looks completely normal except for the surgically altered valuesComparison with All Known Axios PP Gadgets
Object.prototype['header']Object.prototype.transformResponseObject.prototype.proxyObject.prototype.parseRevivertruetruetrue(obvious)this.auth+ raw responseassertOptionsvalidatesUsage of "Helper" Vulnerabilities
This vulnerability requires Zero Direct User Input.
If an attacker can pollute
Object.prototypevia any other library in the stack (e.g.,qs,minimist,lodash,body-parser), the pollutedparseReviverfunction is automatically used by every Axios request that receives a JSON response. The developer's code is completely safe — no configuration errors needed.Root Cause Analysis
The Attack Path
Why
parseReviverBypasses ALL Existing ProtectionsNot in defaults (
lib/defaults/index.js):parseReviveris not defined in the defaults object, somergeConfig'sObject.keys({...defaults, ...userConfig})iteration never encounters it. The merged config has no ownparseReviverproperty.Not in assertOptions schema (
lib/core/Axios.js:135-142): The schema only contains{baseUrl, withXsrfToken}.parseReviveris not validated.No type check: The
JSON.parseAPI accepts any function as a reviver. There is no check thatthis.parseReviveris intentionally set.Works INSIDE the default transform: Unlike
transformResponsepollution (which replaces the entire transform and is caught byassertOptions),parseReviverpollution injects into the DEFAULTtransformResponsefunction'sJSON.parsecall. The default function itself is not replaced, soassertOptionshas nothing to catch.Vulnerable Code
File:
lib/defaults/index.js, line 124Proof of Concept
Verified PoC Output
Impact Analysis
1. Authorization / Privilege Escalation
2. Financial Manipulation
3. Security Control Bypass
4. Silent Data Exfiltration
The reviver function receives the original value before modification. The attacker can silently capture all API keys, tokens, internal data, and PII from every JSON response while the application continues to function normally.
5. Universal and Invisible
Recommended Fix
Fix 1: Use
hasOwnPropertycheck before usingparseReviverFix 2: Use null-prototype config object
Fix 3: Validate
parseRevivertype and sourceRelationship to Other Reported Gadgets
This vulnerability shares the same root cause class — unsafe prototype chain traversal on the merged config object — with two other reported gadgets:
transformResponsemergeConfig.js:49(defaultToConfig2)mergeConfig.jstrueproxyhttp.js:670(direct property access)http.jsparseReviverdefaults/index.js:124(this.parseReviver)defaults/index.jsWhy These Are Distinct Vulnerabilities
Object.prototypekey.transformResponseenters viamergeConfig;proxyis read directly byhttp.js;parseReviveris read inside the defaulttransformResponsefunction'sJSON.parsecall.mergeConfig.js(axios_26) does NOT fixdefaults/index.js:124(this vulnerability). Fixinghttp.js:670(axios_30) does NOT fix this either. Each requires a separate patch.transformResponseis constrained to returntrue;proxyrequires a proxy server;parseReviverenables constraint-free selective value modification.Comprehensive Fix
While each vulnerability requires a location-specific patch, the comprehensive fix is to use null-prototype objects (
Object.create(null)) for the merged config inmergeConfig.js, which would eliminate prototype chain traversal for all config property accesses and address all three gadgets at once. The maintainer may choose to assign a single CVE covering the root cause or separate CVEs for each distinct exploitation path — we defer to the maintainer's judgment on this.Resources
Timeline
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios: Null Byte Injection via Reverse-Encoding in AxiosURLSearchParams
CVE-2026-42040 / GHSA-xhjh-pmcv-23jw
More information
Details
Vulnerability Disclosure: Null Byte Injection via Reverse-Encoding in AxiosURLSearchParams
Summary
The
encode()function inlib/helpers/AxiosURLSearchParams.jscontains a character mapping (charMap) at line 21 that reverses the safe percent-encoding of null bytes. AfterencodeURIComponent('\x00')correctly produces the safe sequence%00, the charMap entry'%00': '\x00'converts it back to a raw null byte.This is a clear encoding defect: every other charMap entry encodes in the safe direction (literal → percent-encoded), while this single entry decodes in the opposite (dangerous) direction.
Severity: Low (CVSS 3.7)
Affected Versions: All versions containing this charMap entry
Vulnerable Component:
lib/helpers/AxiosURLSearchParams.js:21CWE
CVSS 3.1
Score: 3.7 (Low)
Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:NbuildURL) uses its ownencodefunction which does NOT have this bug. Only triggered via directAxiosURLSearchParams.toString()without an encoder, or via customparamsSerializerdelegationVulnerable Code
File:
lib/helpers/AxiosURLSearchParams.js, lines 13-26Why the Standard Flow Is NOT Affected
Proof of Concept
Verified PoC Output
Impact Analysis
Primary impact is limited because the standard axios request flow is not affected. However:
AxiosURLSearchParamsdirectly for custom serialization are affectedparamsSerializer.encodethat delegates to the internal encoder triggers the bugIf null bytes reach a downstream C-based parser, impacts include URL truncation, WAF bypass, and log injection.
Recommended Fix
Remove the
%00entry from charMap and update the regex:Resources
Timeline
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Axios: XSRF Token Cross-Origin Leakage via Prototype Pollution Gadget in
withXSRFTokenBoolean CoercionCVE-2026-42042 / GHSA-xx6v-rp6x-q39c
More information
Details
Vulnerability Disclosure: XSRF Token Cross-Origin Leakage via Prototype Pollution Gadget in
withXSRFTokenBoolean CoercionSummary
The Axios library's XSRF token protection logic uses JavaScript truthy/falsy semantics instead of strict boolean comparison for the
withXSRFTokenconfig property. When this property is set to any truthy non-boolean value (via prototype pollution or misconfiguration), the same-origin check (isURLSameOrigin) is short-circuited, causing XSRF tokens to be sent to all request targets including cross-origin servers controlled by an attacker.Severity: Medium (CVSS 5.4)
Affected Versions: All versions since
withXSRFTokenwas introducedVulnerable Component:
lib/helpers/resolveConfig.js:59Environment: Browser-only (XSRF logic only runs when
hasStandardBrowserEnvis true)CWE
CVSS 3.1
Score: 5.4 (Medium)
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NUsage of "Helper" Vulnerabilities
This vulnerability requires Zero Direct User Input when triggered via prototype pollution.
If an attacker can pollute
Object.prototype.withXSRFTokenwith any truthy value (e.g.,1,"true",{}), Axios will automatically inherit this value during config merge. The truthy value short-circuits the same-origin check, causing the XSRF cookie value to be sent as a request header to every destination.Vulnerable Code
File:
lib/helpers/resolveConfig.js, lines 57-66Designed behavior:
true→ always send token (explicit cross-origin opt-in)false→ never send tokenundefined→ send only for same-origin requestsActual behavior for non-boolean truthy values (
1,"false",{},[]):Proof of Concept
Verified PoC Output
Impact Analysis
Object.prototype.withXSRFToken = 1affects every axios request in the applicationwithXSRFToken: "false"(string) instead offalse(boolean) triggers the same issue without PPLimitations:
hasStandardBrowserEnv)Recommended Fix
Use strict boolean comparison:
Resources
Timeline
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
axios/axios (axios)
v1.15.2Compare Source
This release delivers prototype-pollution hardening for the Node HTTP adapter, adds an opt-in
allowedSocketPathsallowlist to mitigate SSRF via Unix domain sockets, fixes a keep-alive socket memory leak, and ships supply-chain hardening across CI and security docs.🔒 Security Fixes
resolveConfig/mergeConfig/validator paths to read only own properties and use null-prototype config objects, preventing pollutedauth,baseURL,socketPath,beforeRedirect, andinsecureHTTPParserfrom influencing requests. (#10779)socketPath: Rejects non-stringsocketPathvalues and adds an opt-inallowedSocketPathsconfig option to restrict permitted Unix domain socket paths, returningAxiosErrorERR_BAD_OPTION_VALUEon mismatch. (#10777).npmrcwithignore-scripts=true, lockfile lint CI, non-blocking reproducible build diff, scoped CODEOWNERS, expandedSECURITY.md/THREATMODEL.mdwith provenance verification (npm audit signatures), 60-day resolution policy, and maintainer incident-response runbook. (#10776)🚀 New Features
allowedSocketPathsConfig Option: New request config option (and TypeScript types) to allowlist Unix domain socket paths used by the Node http adapter; backwards compatible when unset. (**[#10777](https:/Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.