fix(deps): update dependency axios to v1.16.0 [security]#1859
Open
oep-renovate[bot] wants to merge 1 commit into
Open
fix(deps): update dependency axios to v1.16.0 [security]#1859oep-renovate[bot] wants to merge 1 commit into
oep-renovate[bot] wants to merge 1 commit into
Conversation
oep-renovate
Bot
requested review from
jcchr,
mgumowsk and
piotrgrubicki
as code owners
May 30, 2026 03:32
oep-renovate
Bot
force-pushed
the
renovate/npm-axios-vulnerability
branch
from
June 3, 2026 03:38
72cf79f to
3ead137
Compare
oep-renovate
Bot
force-pushed
the
renovate/npm-axios-vulnerability
branch
4 times, most recently
from
June 18, 2026 03:25
4b12abd to
9067c1a
Compare
Signed-off-by: oep-renovate[bot] <212772560+oep-renovate[bot]@users.noreply.github.com>
oep-renovate
Bot
force-pushed
the
renovate/npm-axios-vulnerability
branch
from
June 19, 2026 03:28
9067c1a to
b610271
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.15.2→^1.16.01.15.2→1.16.0axios Vulnerable to Full Man-in-the-Middle via Prototype Pollution Gadget in
config.proxyCVE-2026-44494 / GHSA-35jp-ww65-95wh
More information
Details
Vulnerability Disclosure: Full Man-in-the-Middle via Prototype Pollution Gadget in
config.proxySummary
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 a full Man-in-the-Middle (MITM) attack — intercepting, reading, and modifying all HTTP traffic including authentication credentials.The HTTP adapter at
lib/adapters/http.js:670readsconfig.proxyvia standard property access, which traverses the prototype chain. Becauseproxyis not present in Axios defaults, the merged config object has no ownproxyproperty, making it trivially injectable via prototype pollution. Once injected,setProxy()routes all HTTP requests through the attacker's proxy server.Unlike the
transformResponsegadget (which is constrained byassertOptionsto returntrue), the proxy gadget has zero constraints — the attacker gets a full MITM position with the ability to read all credentials and tamper with all responses.Severity: Critical (CVSS 9.4)
Affected Versions: All versions (v0.x - v1.x including v1.15.0)
Vulnerable Component:
lib/adapters/http.js(config property access on merged object)CWE
CVSS 3.1
Score: 9.4 (Critical)
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:LObject.prototype.proxy = {host:'attacker', port:8080}. Consistent with GHSA-fvcv-3m26-pcqx scoring methodologytransformResponsewhich must returntrueWhy This Bypasses mergeConfig
The critical difference from
transformResponse: theproxyproperty is not in defaults (lib/defaults/index.jsdoes not setproxy). This means:mergeConfigiteratesObject.keys({...defaults, ...userConfig})—proxyis NOT in this setdefaultToConfig2forproxyis never calledproxypropertyhttp.js:670readsconfig.proxy, JavaScript traverses the prototype chainObject.prototype.proxyis found → used bysetProxy()This is a more direct attack path than
transformResponsebecause it doesn't even go throughmergeConfig's merge logic — it completely bypasses it.Usage 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), Axios will automatically use the pollutedproxyvalue when making HTTP requests. The developer's code is completely safe — no configuration errors needed.Proof of Concept
1. The Setup (Simulated Pollution)
Imagine a scenario where a known prototype pollution 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
At
http.js:668-670:setProxy()athttp.js:191-239then:4. The Impact (Full MITM)
The attacker's proxy server receives:
The
Authorizationheader containssvc-account:prod-key-abc123!in Base64. The attacker:5. Verified PoC Code
Verified PoC Output
Impact Analysis
Authorizationheader, cookies, API keys, and request bodies are visible to the attacker's proxy in plaintext.transformResponse's "must return true".Why This Is More Severe Than transformResponse (axios_26)
this.auth+ response datatruetrue(suspicious)Recommended Fix
Fix 1: Use
hasOwnPropertywhen reading security-sensitive config propertiesFix 2: Enumerate all properties not in defaults and apply
hasOwnPropertyProperties not in defaults that are read by http.js and have security impact:
config.proxy— MITMconfig.socketPath— Unix socket SSRFconfig.transport— request hijackconfig.lookup— DNS hijackconfig.beforeRedirect— redirect manipulationconfig.httpAgent/config.httpsAgent— agent injectionAll should use
hasOwnPropertychecks.Fix 3: Use null-prototype object for merged config
Resources
Timeline
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Axios has a Patch Bypass: Proxy-Authorization Header Injection via Prototype Pollution — Incomplete Null-Prototype Fix
CVE-2026-44489 / GHSA-654m-c8p4-x5fp
More information
Details
[Patch Bypass] Proxy-Authorization Header Injection via Prototype Pollution — Incomplete Null-Prototype Fix in Axios 1.15.2
Summary
The
Object.create(null)fix introduced in Axios 1.15.2 (GHSA-q8qp-cvcw-x6jj) protects the top-level config object from prototype pollution. However, nested objects created byutils.merge()(e.g.,config.proxy) are still constructed as plain{}withObject.prototypein their chain.The
setProxy()function atlib/adapters/http.js:209-223readsproxy.username,proxy.password, andproxy.authwithouthasOwnPropertychecks. WhenObject.prototype.usernameis polluted,setProxy()constructs aProxy-Authorizationheader with attacker-controlled credentials and injects it into every proxied HTTP request.Severity: Medium (CVSS 5.4)
Affected Versions: 1.15.2 (and potentially 1.15.1)
Vulnerable Component:
lib/adapters/http.js(setProxy()) +lib/utils.js(merge())CWE
CVSS 3.1
Score: 5.6 (Medium)
Vector:
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:Lconfig.proxy. Unlike GHSA-q8qp-cvcw-x6jj which affected all requests unconditionallyconfig.baseURLhijack)Why This Is Lower Severity Than GHSA-q8qp-cvcw-x6jj (7.4 High)
config.proxysetconfig.baseURLPPconfig.authPPAuthorizationto target serverProxy-Authorizationto proxyThis Is a Patch Bypass
This vulnerability bypasses the fix introduced in Axios 1.15.2 for GHSA-q8qp-cvcw-x6jj. The fix correctly uses
Object.create(null)for the config object, blocking direct prototype pollution onconfig.proxy,config.auth, etc.However, the fix is incomplete: when a user legitimately sets
config.proxy = { host: 'proxy.corp', port: 8080 }, themergeConfig()function passes this object throughutils.merge(), which creates a new plain{}object (lib/utils.js:406: const result = {};). This new object inherits fromObject.prototype, re-opening the prototype pollution attack surface on the nested proxy object.config(top-level)Object.create(null)config.proxy(nested)utils.merge()→const result = {}setProxy()readsproxy.username,proxy.authwithouthasOwnPropertyRoot Cause Analysis
Step 1:
utils.merge()creates plain{}for nested objectsFile:
lib/utils.js, line 406When
mergeConfig()processesconfig.proxy,getMergedValue()callsutils.merge(), which creates a plain{}for the nested object. This plain object inherits fromObject.prototype.Step 2:
setProxy()reads proxy properties withouthasOwnPropertyFile:
lib/adapters/http.js, lines 209-223Complete Attack Chain
Proof of Concept
Reproduction Environment
Reproduction Steps
Verified PoC Output
Confirming the Bypass Mechanism
Fix 2: Use null-prototype objects in
utils.merge()Fix 3 (Comprehensive): Apply null-prototype to all objects created by
getMergedValue()References
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 OSV and the GitHub Advisory Database (CC-BY 4.0).
Allocation of Resources Without Limits or Throttling in Axios
CVE-2026-44488 / GHSA-777c-7fjr-54vf
More information
Details
Summary
Axios versions
1.7.0through1.15.xdid not enforce configured request and response size limits when requests were sent with thefetchadapter. Applications that selectedadapter: 'fetch', or ran in environments where axios resolved to the fetch adapter, could receive or send bodies larger thanmaxContentLengthormaxBodyLengthdespite those limits being explicitly configured.This can cause resource exhaustion in server-side usage when a malicious or compromised server returns an oversized response, when an attacker can supply a large
data:URL, or when an application forwards attacker-controlled request bodies through axios while relying onmaxBodyLengthas a boundary.Impact
The impact is availability-only. Affected applications may process, buffer, or transmit data beyond the configured limit, potentially exhausting memory, CPU, or network resources.
This does not affect axios’s default unlimited behaviour by itself:
maxContentLengthandmaxBodyLengthdefault to-1. The vulnerability exists when an application has configured finite limits and expects axios to enforce them.Server-side runtimes are the primary concern. Browser impact is generally constrained by the browser process and browser fetch behavior, and should not be described as server process exhaustion.
Affected Functionality
Affected functionality includes requests using the built-in
fetchadapter with finitemaxContentLengthormaxBodyLengthvalues.Relevant configurations include:
adapter: 'fetch'adapter: ['fetch', ...]whenfetchis selectedxhrnorhttpis available and axios falls back tofetchenv.fetchUnaffected functionality includes:
httpadapter enforcementTechnical Details
In vulnerable versions,
lib/adapters/fetch.jsdestructured request config withoutmaxContentLengthormaxBodyLength. The adapter dispatchedfetch()and then materialized the response throughtext(),arrayBuffer(),blob(), or related resolvers without checking the configured response limit.The fix in
e5540dcadded:maxContentLengthandmaxBodyLengthreads inlib/adapters/fetch.jsdata:URL decoded-size checksContent-Lengthresponse pre-checksReadableStreamtests/unit/adapters/fetch.test.jsProof of Concept of Attack
Workarounds
Use the Node.js
httpadapter for server-side requests where finite size limits are security-relevant.Validate or cap attacker-controlled request bodies before passing them to axios.
Reject or strictly allowlist attacker-controlled URL schemes, especially
data:URLs, before calling axios.Original Report
Summary
When Axios is used with adapter: 'fetch', configured body/response size limits are not enforced. This allows oversized uploads/downloads (including data: URLs) despite explicit limits, which can lead to memory/resource exhaustion in server-side usage.
Details
maxBodyLength and maxContentLength are not applied in the fetch adapter flow:
By contrast, the HTTP adapter enforces both limits.
PoC
Environment:
Steps:
Expected secure behavior: both requests rejected.
Observed:
Impact
Type: DoS / resource exhaustion due to limit bypass.
Impacted: applications using Axios fetch adapter as a server-side security control boundary for untrusted request/response sizes.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
axios has DoS & Header Injection via Prototype Pollution Read-Side Gadgets in axios merge functions
CVE-2026-44490 / GHSA-898c-q2cr-xwhg
More information
Details
Summary
axios
1.15.2exposes two read-side prototype-pollution gadgets. WhenObject.prototypeis polluted by an upstream dependency in the same process (e.g. lodash_.merge/ CVE-2018-16487), axios silently picks up the polluted values:lib/utils.jsline 406 buildsmerge()'s accumulator asresult = {}, soresult[targetKey](line 414) walksObject.prototypeand the polluted bucket's own keys are copied into the merged headers and ride out on the wire.lib/core/mergeConfig.jsline 26 builds thehasOwnPropertydescriptor as a plain-object literal.Object.definePropertyreadsdescriptor.get/descriptor.setvia the prototype chain, so a pollutedObject.prototype.getorObject.prototype.setmakes the call throwTypeErrorsynchronously on every axios request.Affected Properties
Object.prototype.commonObject.prototype.delete/.head/.post/.put/.patch/.queryObject.prototype.getTypeError: Getter must be a functionfrommergeConfig.js:26Object.prototype.setTypeError: Setter must be a functionfrommergeConfig.js:26Per-request headers (
axios.request(url, { headers: {...} })) overwrite polluted entries. PollutingObject.prototype.gettriggers the crash before any header is built.Proof of Concept
Impact
Content-Length: 99999): receiver waits for a body that never arrives. Affects requests with a body.Transfer-Encoding: chunkedrides alongside axios's autoContent-Length): receiver rejects with400 Bad Request. Affects requests with a body.If-None-Match: *): receiver returns empty304 Not Modified. Affects GET / HEAD.Object.prototype.get/.set): every axios request fails synchronously withTypeError, notAxiosError, so handlers filtering onerror.isAxiosErrormishandle the failure.Attack Flow
flowchart TD ROOT["Polluted Object.prototype<br/>via upstream gadget (e.g. lodash <= 4.17.10 _.merge / CVE-2018-16487)<br/>axios <= 1.15.2"] ROOT --> CLASS_A["A. Arbitrary HTTP Header Injection<br/>Polluted defaults.headers slot rides along on every outbound axios request"] ROOT --> CLASS_B["B. Crash DoS via Object.prototype.get / .set<br/>Polluted descriptor breaks Object.defineProperty in mergeConfig"] CLASS_A --> PRE_A["Precondition: header not set per-request by the app<br/>Injected via defaults.headers slot<br/>(common, delete, head, post, put, patch, query)"] PRE_A --> PA1["Response Suppression<br/>Trigger: common = {If-None-Match: *}<br/>Affects GET / HEAD"] PA1 --> SA1["DoS<br/>304 Not Modified empty"] PRE_A --> PA2["Server Hang<br/>Trigger: common = {Content-Length: 99999}<br/>Affects requests with body"] PA2 --> SA2["DoS<br/>connection hang"] PRE_A --> PA3["CL+TE Conflict<br/>Trigger: common = {Transfer-Encoding: chunked}<br/>Affects requests with body"] PA3 --> SA3["DoS<br/>400 Bad Request"] CLASS_B --> SB1["DoS<br/>TypeError: Getter / Setter must be a function<br/>Crashes every axios request, not only GET"] %% Styles style ROOT fill:#f87171,stroke:#​991b1b,color:#fff style CLASS_A fill:#fb923c,stroke:#​9a3412,color:#fff style CLASS_B fill:#fb923c,stroke:#​9a3412,color:#fff style PRE_A fill:#e2e8f0,stroke:#​64748b,color:#​1e293b style PA1 fill:#fbbf24,stroke:#​92400e,color:#​000 style PA2 fill:#fbbf24,stroke:#​92400e,color:#​000 style PA3 fill:#fbbf24,stroke:#​92400e,color:#​000 style SA1 fill:#ef4444,stroke:#​991b1b,color:#fff style SA2 fill:#ef4444,stroke:#​991b1b,color:#fff style SA3 fill:#ef4444,stroke:#​991b1b,color:#fff style SB1 fill:#ef4444,stroke:#​991b1b,color:#fffRoot Cause
Finding A.
lib/utils.js:404-429'smerge()createsresult = {}at line 406. The dangerous-keys filter on lines 408-411 blocks the write side, but the read at line 414 (isPlainObject(result[targetKey])) still walks the prototype chain. WhentargetKeymatches a polluted slot,result[targetKey]returns the polluted nested object, and the recursivemerge(result[targetKey], val)on line 415 iterates that object's own keys viaforEachand copies them as own properties into the new accumulator. Those keys flow throughmergeConfig.js:35→Axios.js:148(utils.merge(headers.common, headers[config.method])) →Axios.js:155(AxiosHeaders.concat(...)) → onto the wire viahttp.js:677(headers: headers.toJSON()) →http.js:767(transport.request(options, ...)).Finding B.
lib/core/mergeConfig.js:25correctly makesconfig = Object.create(null), but the descriptor passed on line 26 is a plain-object literal - itsget/setlookups walkObject.prototype. A polluted non-functionObject.prototype.getor.setmakesObject.definePropertythrowTypeError: Getter must be a function(orSetter must be a function) before the call returns. The descriptor is built unconditionally on everymergeConfiginvocation, so every axios request throws - POST, PUT, DELETE, PATCH, HEAD, QUERY, not only GET.Suggested Fix
Use null-prototype objects in place of the plain-object literals at
lib/utils.js:406andlib/core/mergeConfig.js:26-31. The same descriptor pattern recurs atlib/core/AxiosError.js:37,lib/core/AxiosHeaders.js:100,lib/utils.js:447/454/492/498, andlib/adapters/adapters.js:28/32.Resources
lodash.mergeprototype pollution inlodash <= 4.17.10Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:LReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Axios: Regular Expression Denial of Service (ReDoS) via Cookie Name Injection
CVE-2026-44496 / GHSA-hfxv-24rg-xrqf
More information
Details
Summary
Axios versions before
0.32.0on the0.xline and before1.16.0on the1.xline build a regular expression from the configured XSRF cookie name without escaping regex metacharacters. In standard browser environments, an attacker who can influence the cookie name passed to axios can cause expensive regex backtracking while axios readsdocument.cookie.The practical impact is client-side availability degradation, such as freezing the affected browser tab while axios prepares a request. The issue does not affect ordinary Node.js HTTP adapter usage, React Native, or web workers, where axios does not read
document.cookie.Impact
Applications are affected only when attacker-controlled data can reach the XSRF cookie name configuration or a direct/unsafe call to the internal cookie helper.
This does not expose credentials, modify requests, or affect response integrity. The impact is availability only.
Affected Functionality
Affected code paths:
lib/helpers/cookies.jsread(name)in standard browser environments.lib/helpers/resolveConfig.jsin1.x, when browser XHR/fetch adapters resolve XSRF config.lib/adapters/xhr.jsin0.x, when the XHR adapter reads the configured XSRF cookie.axios/unsafe/helpers/cookies.jsin1.x, if callers pass attacker-controlled names.Unaffected code paths:
xsrfCookieName: 'XSRF-TOKEN'when not attacker-controlled.xsrfCookieName: null.document.cookie.Technical Details
Affected versions interpolate the cookie name into a regex.
Because
nameis not escaped, regex metacharacters in the cookie name are interpreted as regex syntax. A payload such as(.+)+$can force catastrophic backtracking againstdocument.cookie.The fix avoids dynamic regex construction and parses
document.cookieby splitting on;, trimming leading whitespace, and comparing cookie names with exact string equality.Proof of Concept of Attack
Expected result: timings grow rapidly as the cookie string length increases.
Workarounds
Set
xsrfCookieName: nullif the application does not need axios to read an XSRF cookie.Do not derive
xsrfCookieNamefrom untrusted input. If a dynamic cookie name is unavoidable, validate it against a strict cookie-name allowlist before passing it to axios.Avoid calling
axios/unsafe/helpers/cookies.jsdirectly with untrusted namesOriginal Source
Regular Expression Denial of Service (ReDoS) via Cookie Name Injection
1. Title
ReDoS via Unsanitized Cookie Name in Dynamic Regular Expression Construction
2. Affected Software and Version
lib/helpers/cookies.js3. Vulnerability Type / CWE
4. CVSS 3.1 Score
Score: 7.5 (High)
Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H5. Description
The
cookies.read()function inlib/helpers/cookies.jsconstructs a regular expression dynamically using thenameparameter without any sanitization or escaping of special regex characters. At line 33, the code passes the rawnamevalue directly intonew RegExp():An attacker who can control or influence the cookie name parameter (e.g., via XSRF cookie name configuration, prototype pollution of
xsrfCookieName, or any code path where user input reachescookies.read()) can inject a malicious regex pattern that causes catastrophic backtracking, leading to a Denial of Service condition.With a crafted input of approximately 20-30 characters, the regex engine can be forced to consume several seconds to minutes of CPU time, effectively freezing the JavaScript event loop.
6. Root Cause Analysis
File:
lib/helpers/cookies.jsLine: 33
The vulnerability exists because:
nameparameter is concatenated directly into a regex pattern without escaping special regex metacharacters.(?:^|; )prefix combined with an injected pattern like((((.*)*)*)*)*creates nested quantifiers that cause catastrophic backtracking when the regex engine attempts to match againstdocument.cookie.The
cookies.read()function is called fromlib/helpers/resolveConfig.jsat line 61:The
xsrfCookieNamevalue comes from the Axios configuration, which can be influenced by prototype pollution or direct configuration injection.7. Proof of Concept
8. PoC Output
The exponential growth pattern is clearly visible: each additional 2 characters approximately quadruples the execution time.
9. Impact
10. Remediation / Suggested Fix
Escape all regex metacharacters in the
nameparameter before constructing the regular expression.Alternatively, avoid dynamic regex construction entirely and use string-based parsing:
11. References
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Axios: Proxy-Authorization header leaks to redirect target when proxy is re-evaluated to direct connection
CVE-2026-44486 / GHSA-j5f8-grm9-p9fc
More information
Details
Summary
Axios’ Node.js HTTP adapter can leak proxy credentials to a redirect target in affected versions. When a request is sent through an authenticated proxy, Axios may add a
Proxy-Authorizationheader. If Axios then follows a redirect and the redirected request is no longer sent through that proxy, the staleProxy-Authorizationheader can remain on the redirected request and be sent to the redirect target.This affects Node.js's use of Axios with automatic redirects enabled and an authenticated proxy configuration. Browser adapters are not affected.
Impact
An attacker who controls a server that the victim application requests can redirect the request so that the attacker-controlled redirect target receives the victim’s proxy credentials.
The most relevant case is a Node.js application using an authenticated
HTTP_PROXYfor an initialhttp://request, with redirects enabled, where the redirect target resolves to no proxy, such as anhttps://URL whenHTTPS_PROXYis unset.This does not affect browser, XHR, or fetch adapter behaviour. It also does not affect requests with
maxRedirects: 0.Affected Functionality
Affected functionality is limited to the Node.js HTTP adapter in
lib/adapters/http.js.Relevant inputs and settings include:
HTTP_PROXY,HTTPS_PROXY, andNO_PROXY.http://user:pass@proxy.example:8080.follow-redirects.setProxy().beforeRedirects.proxy.Technical Details
In affected v1 releases,
setProxy()addsProxy-Authorizationwhen a proxy with credentials is selected, but redirect handling callssetProxy()again without first clearing any existing proxy authorization header.If the redirected URL resolves to no proxy,
setProxy()does not add a new proxy configuration and also does not remove the old header. The redirected request can therefore carry the staleProxy-Authorizationheader to the final origin.The v1 fix in
afca61aadds anisRedirectpath that deletes any case variant ofProxy-Authorizationbefore proxy settings are re-applied on redirect. The v0 backport in2af6116fixed the 0.x line for0.32.0.Proof of Concept of Attack
Attacker-controlled HTTP endpoint:
Expected result on affected versions:
Expected result on fixed versions:
Workarounds
Set
maxRedirects: 0and handle redirects manually.Avoid using authenticated proxy environment variables for requests to untrusted HTTP origins unless redirect behaviour is controlled.
Ensure proxy environment variables are configured consistently across protocols so redirects do not unexpectedly change from proxied to direct connections.
Original Source
Summary
Axios' Node.js HTTP adapter can leak proxy credentials to a redirect target origin. When an initial request is sent through an authenticated HTTP proxy, Axios adds a
Proxy-Authorizationheader. On redirect, Axios re-evaluates proxy settings, but if the redirected request no longer uses a proxy, the staleProxy-Authorizationheader is not cleared. As a result, the redirect target can receive the proxy credential directly.This issue affects the Node.js HTTP adapter and can be reproduced when the initial request uses
HTTP_PROXYwith authentication, redirects are enabled, and the redirected request is resolved to no proxy, such as whenHTTPS_PROXYis unset or the redirect target is excluded byNO_PROXY.Details
In the current implementation:
setProxy()addsProxy-Authorizationwhen a proxy with credentials is in use.setProxy()for the redirected request.setProxy()does not clear the previously addedProxy-Authorizationheader.Relevant code locations:
lib/adapters/http.jssetProxy()addsProxy-AuthorizationbeforeRedirects.proxyPoC
GET http://<attacker-site>/startcorp proxy302 Location: https://<attacker-site>/finalProxy-AuthorizationheaderObserved output:
This demonstrates that the proxy credential is exposed to the redirect target origin.
Impact
Exposes authenticated proxy credentials to an attacker-controlled origin.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by OSV and the [GitHub Advisory Database](https://redirect.github.com