Url-Js · Url-Js · CVE-2022-25839
**Name of the Vulnerable Software and Affected Versions**
url-js versions prior to 2.1.0
**Description**
The issue arises from improper input validation due to incorrect parsing. This allows the hostname to be spoofed, as seen in the comparison between http://localhost and http://localhost, which are considered the same URL. However, the hostname is not parsed correctly as localhost, and the backslash is reflected as is.
**Recommendations**
For versions prior to 2.1.0, update to version 2.1.0 or later to resolve the issue. As a temporary workaround, consider validating URLs manually to prevent hostname spoofing. Restrict the use of backslashes in URLs to minimize the risk of exploitation.