Vulnerabilities in pkg:npm/karma

PACKAGE
Advisory Identifier: GHSA-rc3x-jf5g-xvc5
Advisory Summary

CVE-2021-23495 is a MODERATE (CVSS 5.4) open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Karma libraries in the npm ecosystem. The issue involves open redirect in karma. Remediation is available by upgrading affected packages to version 6.3.16.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/karma

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/karma. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rc3x-jf5g-xvc5 CVE-2021-23495 MODERATE Open redirect in karma
GHSA-7x7c-qm48-pq9c CVE-2022-0437 MODERATE Cross-site Scripting in karma

CVE-2021-23495 at a Glance

CVE Identifier CVE-2021-23495
GHSA Identifier GHSA-rc3x-jf5g-xvc5
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Karma
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 5.4

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:U/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 Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2021-23495

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

karma fixed: 6.3.16
npm install karma@6.3.16
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 karma

How to Check if You Are Affected

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

npm ls karma

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

Note: The npm ls karma 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Karma, 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

Karma before 6.3.16 is vulnerable to Open Redirect due to missing validation of the return_url query parameter.

CVE-2021-23495 Affected Karma Versions

1 component(s)
Fixed Versions:
6.3.16
Product / Package Ecosystem Affected Versions Fixed Version
karma
npm
< 6.3.16
6.3.16

References

Frequently Asked Questions

What is CVE-2021-23495?
CVE-2021-23495 is a security vulnerability in Karma involving Open redirect in karma under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Karma versions are affected?
Affected versions include releases prior to 6.3.16 across affected packages: karma.
What version fixes CVE-2021-23495?
Upgrading to 6.3.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is karma affected?
Yes, karma is affected in releases prior to 6.3.16. Upgrade your dependency to 6.3.16 or later.
What is the CVSS score of CVE-2021-23495?
CVE-2021-23495 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2021-23495?
CVE-2021-23495 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for CVE-2021-23495?
Run the dependency tree command: 'npm ls karma'. 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-rc3x-jf5g-xvc5",
  "modified" : "2022-03-09T21:08:20Z",
  "published" : "2022-02-26T00:00:38Z",
  "aliases" : [ "CVE-2021-23495" ],
  "summary" : "Open redirect in karma",
  "details" : "Karma before 6.3.16 is vulnerable to Open Redirect due to missing validation of the return_url query parameter.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "karma"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.3.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23495"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/karma-runner/karma/commit/ff7edbb2ffbcdd69761bece86b7dc1ef0740508d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/karma-runner/karma"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2412347"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-KARMA-2396325"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-01T19:17:53Z",
    "nvd_published_at" : "2022-02-25T20:15:00Z"
  }
}