Axios Cross-Site Scripting Vulnerability in URL Origin Handling

Vulnerability

A cross-site scripting (XSS) vulnerability has been identified in Axios versions prior to 1.7.8. The issue arises in the 'lib/helpers/isURLSameOrigin.js' file, where the library improperly uses a DOM method to determine URL origins. This flaw allows unvalidated data to be set as HTML attributes, potentially leading to XSS attacks by executing malicious scripts or code in the user's browser.

Impact

Exploitation of this vulnerability allows for cross-site scripting attacks, where an attacker can inject and execute malicious scripts in the context of the user's browser.

Reproduction

The vulnerability can be reproduced by using Axios versions prior to 1.7.8 and passing untrusted URL data that is then processed by the 'isURLSameOrigin' function. This function will incorrectly handle the URLs, creating a risk of XSS by allowing the injection of malicious content that could be executed by the browser.

Remediation

Users can upgrade to Axios version 1.7.8 or later, where this vulnerability has been addressed.

Added: Sep 1, 2025, 7:22 PM
Updated: Sep 1, 2025, 7:22 PM

Vulnerability Rating

Custom Algorithm
spread
7.8
impact
1.7
exploitability
5.8
remediation
7.7
relevance
0.0
threat
6.4
urgency
2.9
incentive
1.7

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.