chore(deps): update dependency axios to v0.31.0 [security]#643
Open
renovate[bot] wants to merge 1 commit intodevelopfrom
Open
chore(deps): update dependency axios to v0.31.0 [security]#643renovate[bot] wants to merge 1 commit intodevelopfrom
renovate[bot] wants to merge 1 commit intodevelopfrom
Conversation
681c0fa to
b2664a8
Compare
b2664a8 to
8bdb2c4
Compare
8bdb2c4 to
cbcfdb3
Compare
cbcfdb3 to
6a12626
Compare
6a12626 to
401cbc2
Compare
401cbc2 to
6f8a772
Compare
86ea162 to
aea3ff7
Compare
aea3ff7 to
eb4c6c0
Compare
eb4c6c0 to
ef296a1
Compare
ef296a1 to
4d7b224
Compare
4d7b224 to
6ffcbad
Compare
6ffcbad to
2a4c180
Compare
2a4c180 to
ee555b0
Compare
ee555b0 to
0c407d8
Compare
0c407d8 to
02093cb
Compare
02093cb to
9c4cad9
Compare
9c4cad9 to
f7ba99f
Compare
f7ba99f to
62a5c8e
Compare
62a5c8e to
99bb87d
Compare
99bb87d to
e43166c
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:
0.21.1→0.31.0GitHub Vulnerability Alerts
CVE-2021-3749
axios before v0.21.2 is vulnerable to Inefficient Regular Expression Complexity.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HCVE-2023-45857
An issue discovered in Axios 0.8.1 through 1.5.1 inadvertently reveals the confidential XSRF-TOKEN stored in cookies by including it in the HTTP header X-XSRF-TOKEN for every request made to any host allowing attackers to view sensitive information.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:NCVE-2026-25639
Denial of Service via proto Key in mergeConfig
Summary
The
mergeConfigfunction in axios crashes with a TypeError when processing configuration objects containing__proto__as an own property. An attacker can trigger this by providing a malicious configuration object created viaJSON.parse(), causing complete denial of service.Details
The vulnerability exists in
lib/core/mergeConfig.jsat lines 98-101:When
propis'__proto__':JSON.parse('{"__proto__": {...}}')creates an object with__proto__as an own enumerable propertyObject.keys()includes'__proto__'in the iterationmergeMap['__proto__']performs prototype chain lookup, returningObject.prototype(truthy object)mergeMap[prop] || mergeDeepPropertiesevaluates toObject.prototypeObject.prototype(...)throwsTypeError: merge is not a functionThe
mergeConfigfunction is called by:Axios._request()atlib/core/Axios.js:75Axios.getUri()atlib/core/Axios.js:201get,post, etc.) atlib/core/Axios.js:211,224PoC
Reproduction steps:
npm install axiospoc.mjswith the code abovenode poc.mjsVerified output (axios 1.13.4):
Control tests performed:
{"timeout": 5000}JSON.parse('{"__proto__": {"x": 1}}'){"headers": {"X-Test": "value"}}Attack scenario:
An application that accepts user input, parses it with
JSON.parse(), and passes it to axios configuration will crash when receiving the payload{"__proto__": {"x": 1}}.Impact
Denial of Service - Any application using axios that processes user-controlled JSON and passes it to axios configuration methods is vulnerable. The application will crash when processing the malicious payload.
Affected environments:
This is NOT prototype pollution - the application crashes before any assignment occurs.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HCVE-2026-40175
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:L/PR:N/UI:N/S:C/C:H/I:H/A:HRelease Notes
axios/axios (axios)
v0.31.0Compare Source
This release backports security fixes from v1.x, hardens the CI/CD supply chain with OIDC publishing and
zizmorscanning, resolves TypeScript typing issues inAxiosInstance, and fixes a performance regression inisEmptyObject().🔒 Security Fixes
Header Injection & Proxy Bypass: Backports v1 security hardening — sanitizes outgoing header values to strip invalid bytes, CRLF sequences, and boundary whitespace (including array values); adds proper
NO_PROXY/no_proxyenforcement covering wildcards, explicit ports, loopback aliases (localhost,127.0.0.1,::1), bracketed IPv6, and trailing-dot hostnames. Proxy bypass is now checked before the proxy URL is parsed, andparsed.hostis used for correct port and IPv6 handling. (#10688)CI Security: SHA-pins all actions and disables credential persistence in v0.x CI, introduces
zizmorsecurity scanning with SARIF upload to code scanning, adds an OIDC Trusted Publishing workflow with npm provenance attestations, and gates all publishes behind a requirednpm-publishGitHub Environment with configurable reviewer protections. (#10638, #10639, #10667)🐛 Bug Fixes
TypeScript —
AxiosInstanceReturn Types: Fixes return types inAxiosInstancemethods to correctly resolve toPromise<R>(matchingAxiosPromise<T>semantics), and corrects the generic call signature so TypeScript properly enforces the response data type. TypeScript-only changes; no runtime impact. (#6253, #7328)Performance: Fixes a performance regression in
isEmptyObject()that caused excessive computation when the argument was a large string. (#6484)🔧 Maintenance & Chores
🌟 New Contributors
We are thrilled to welcome our new contributors. Thank you for helping improve axios:
Full Changelog
v0.30.3: Release notes - v0.30.3Compare Source
This is a critical security maintenance release for the v0.x branch. It addresses a high-priority vulnerability involving prototype pollution that could lead to a Denial of Service (DoS).
Recommendation: All users currently on the 0.x release line should upgrade to this version immediately to ensure environment stability.
🛡️ Security Fixes
⚙️ Maintenance & CI
Configuration Merging Behavior:
As part of the security fix, Axios now restricts the merging of the proto key within configuration objects. If your codebase relies on unconventional deep-merging patterns that target the object prototype via Axios config, those operations will now be blocked. This is a necessary change to prevent prototype pollution.
Full Changelog: v0.30.2...v0.30.3
v0.30.2Compare Source
What's Changed
maxContentLengthvulnerability fix to v0.x by @FeBe95 in #7034New Contributors
Full Changelog: axios/axios@v0.30.1...v0.30.2
v0.30.1Compare Source
Release notes:
Bug Fixes
Contributors to this release
Full Changelog: axios/axios@v0.30.0...v0.30.1
v0.30.0Compare Source
Release notes:
Bug Fixes
Contributors to this release
Full Changelog: axios/axios@v0.29.0...v0.30.0
v0.29.0Compare Source
Release notes:
Bug Fixes
Contributors to this release
v0.28.1Compare Source
Release notes:
Release notes:
Bug Fixes
reqis not defined (#6307)v0.28.0Compare Source
Release notes:
Bug Fixes
withXSRFTokenoption to v0.x (#6091)Backports from v1.x:
axios.formToJSONmethod (#4735)url-encoded-formserializer to respect theformSerializerconfig (#4721)string[]toAxiosRequestHeaderstype (#4322)AxiosErrorstack capturing; (#4718)AxiosErrorstatus code type; (#4717)blobto the list of protocols supported by the browser (#4678)v0.27.2Compare Source
Fixes and Functionality:
v0.27.1Compare Source
Fixes and Functionality:
v0.27.0Compare Source
Breaking changes:
Content-Typerequest header when passing FormData (#3785)transformRequestandtoFormData(#4470)QOL and DevX improvements:
Fixes and Functionality:
Internal and Tests:
Documentation:
Notes:
v0.26.1Compare Source
Fixes and Functionality:
v0.26.0Compare Source
Fixes and Functionality:
v0.25.0Compare Source
Breaking changes:
Fixes and Functionality:
booleanandnumbertypes (#4144)undefined(#3153)Internal and Tests:
Documentation:
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
v0.24.0Compare Source
Breaking changes:
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
v0.23.0Compare Source
Breaking changes:
Fixes and Functionality:
Internal and Tests:
Documentation:
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
v0.22.0Compare Source
Fixes and Functionality:
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
v0.21.4Compare Source
Fixes and Functionality:
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
v0.21.3Compare Source
Fixes and Functionality:
Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
v0.21.2Compare Source
Fixes and Functionality:
Internal and Tests:
Documentation:
AUTH_TOKENwith multiple domain endpoints (#3539)Huge thanks to everyone who contributed to this release via code (authors listed below) or via reviews and triaging on GitHub:
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ 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.