CVE-2022-2216: parse-url Server-Side Request Forgery

CVE-2022-2216 · Severity: low · CVSS 3.1 · Published 2022-06-28

parse-url is a popular JavaScript library used to parse and normalize URLs. This vulnerability allows attackers to bypass URL validation, potentially enabling Server-Side Request Forgery (SSRF) attacks where an application using the library could be tricked into making unauthorized requests to internal systems or external targets, compromising data confidentiality and system availability.

Technologies: parse-url (npm). Vendors: npm.

Quick answers

Is CVE-2022-2216 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-2216 being exploited in the wild.
How severe is CVE-2022-2216?
Low severity, with a CVSS score of 3.1, published 28 June 2022.
Which products and versions are affected?
parse-url (npm) SEMVER:introduced=0,fixed=6.0.1.
Is there a fix for CVE-2022-2216?
Yes. parse-url (npm): upgrade to 6.0.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-2216 attacked?
It is attacked over the network.
Am I affected by CVE-2022-2216?
Check whether you run parse-url (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • parse-url (npm): upgrade to 6.0.1 or later
    npm install parse-url@6.0.1

Technical details

This is a Server-Side Request Forgery (CWE-918) vulnerability in the parse-url library prior to version 6.0.1 (fixed in 6.0.1). The root cause involves improper URL validation or parsing logic that fails to properly sanitize or restrict URL input. An attacker can craft malicious URLs that bypass the library's validation, potentially allowing server-side code to make unintended HTTP requests to internal or restricted network resources. No authentication is required; the vulnerability is triggered by providing a specially crafted URL string to the parsing function. The fix was applied in commit 21c72ab with code refactoring and dependency upgrades.

Affected products

  • <UNKNOWN> parse-url prior to 6.0.1

Identifiers

  • CVE-2022-2216
  • GHSA-7f3x-x4pr-wqhj

Timeline

  • 2022-06-28: disclosed
  • 2022-06-27: patched: Fix applied via commit 21c72ab

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.