CVE-2022-3224: Parse url Parse-url Parses Http URLs Incorrectly, Vulnerability

MODERATE
Advisory Identifier: GHSA-pqw5-jmp5-px4v
CVSS 6.1
CWE-115
Published
Advisory Summary

CVE-2022-3224 is a MODERATE (CVSS 6.1) parse-url parses http urls incorrectly, vulnerability (CWE-115: Misinterpretation of Input) affecting Parse url libraries in the npm ecosystem. The issue involves parse-url parses http urls incorrectly, making it vulnerable to host name spoofing. Remediation is available by upgrading affected packages to version 8.1.0.

CVE-2022-3224 at a Glance

CVE Identifier CVE-2022-3224
GHSA Identifier GHSA-pqw5-jmp5-px4v
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-115: Misinterpretation of Input
Affected Product Parse url
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-3224

To remediate this vulnerability, upgrade all affected Parse url dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

parse-url fixed: 8.1.0
npm install parse-url@8.1.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls parse-url

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2022-3224, inspect your project dependencies using npm:

npm ls parse-url

Analyze the terminal output to locate any version of Parse url in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.1.0), your application is affected.

Note: The npm ls parse-url command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-115: Misinterpretation of Input, where the product misinterprets an input, whether from an attacker or another product, in a security-relevant fashion. In Parse url, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

parse-url prior to 8.1.0 is vulnerable to Misinterpretation of Input. parse-url parses certain http or https URLs incorrectly, identifying the URL's protocol as ssh. It may also parse the host name incorrectly.

CVE-2022-3224 Affected Parse url Versions

1 component(s)
Fixed Versions:
8.1.0
Product / Package Ecosystem Affected Versions Fixed Version
parse-url
npm
< 8.1.0
8.1.0

References

Frequently Asked Questions

What is CVE-2022-3224?
CVE-2022-3224 is a security vulnerability in Parse url involving parse-url parses http URLs incorrectly, making it vulnerable to host name spoofing under CWE-115: Misinterpretation of Input.
Which Parse url versions are affected?
Affected versions include releases prior to 8.1.0 across affected packages: parse-url.
What version fixes CVE-2022-3224?
Upgrading to 8.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is parse-url affected?
Yes, parse-url is affected in releases prior to 8.1.0. Upgrade your dependency to 8.1.0 or later.
What is the CVSS score of CVE-2022-3224?
CVE-2022-3224 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2022-3224?
CVE-2022-3224 is classified under CWE-115: Misinterpretation of Input (The product misinterprets an input, whether from an attacker or another product, in a security-relevant fashion.).
How can I check npm dependencies for CVE-2022-3224?
Run the dependency tree command: 'npm ls parse-url'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-pqw5-jmp5-px4v",
  "modified" : "2022-09-19T20:25:17Z",
  "published" : "2022-09-16T00:00:39Z",
  "aliases" : [ "CVE-2022-3224" ],
  "summary" : "parse-url parses http URLs incorrectly, making it vulnerable to host name spoofing",
  "details" : "parse-url prior to 8.1.0 is vulnerable to Misinterpretation of Input. parse-url parses certain http or https URLs incorrectly, identifying the URL's protocol as ssh. It may also parse the host name incorrectly.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "parse-url"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-3224"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ionicabizau/parse-url/commit/9cacf38de02db0fb1358bd6ec04543e523cd6a8e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ionicabizau/parse-url"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.dev/bounties/3587a567-7fcd-4702-b7c9-d9ca565e3c62"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-115" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-16T21:21:19Z",
    "nvd_published_at" : "2022-09-15T12:15:00Z"
  }
}