CVE-2022-0437: Cross-site Scripting in karma

karma Updated 02 Oct 2025

Summary

06/02/2022
Yes i
Moderate
6.1

CVE-2022-0437: Cross-site Scripting in karma. Affects karma versions < 6.3.14. Fixed in 6.3.14. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Karma is an open-source testing framework for JavaScript that allows developers to run tests on real devices and browsers. It provides a seamless testing experience by capturing browsers, running tests, and reporting results. However, prior to version 6.3.14, Karma is vulnerable to a cross-site scripting (XSS) attack.

Vulnerability Detail

The XSS vulnerability in Karma allows an attacker to inject malicious scripts into web pages viewed by users. This can lead to various security risks, such as unauthorized access to sensitive information, session hijacking, or the execution of arbitrary code on the victim's browser. The vulnerability originates from improper input sanitization, which allows the attacker to bypass security measures and inject malicious code.

How To Fix

Minimum fixed version

6.3.14

This is the first release that contains the fix.

npm install karma@6.3.14

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, developers can implement a workaround by manually sanitizing user input before using it in the Karma configuration. This can be achieved by using a library like DOMPurify to sanitize the input and prevent the execution of malicious scripts. Here's an example of how to use DOMPurify with Karma:

const DOMPurify = require('dompurify');

const sanitizedInput = DOMPurify.sanitize(userInput);

// Use the sanitized input in Karma configuration
karma.config.set({
  // ...
  files: [
    sanitizedInput,
    // ...
  ],
  // ...
});

Conclusion

In conclusion, the XSS vulnerability in Karma prior to version 6.3.14 poses a moderate security risk, allowing attackers to inject and execute malicious scripts on users' browsers. To mitigate this vulnerability, it is crucial to upgrade Karma to version 6.3.14 or later. Alternatively, developers can implement a manual workaround by sanitizing user input using a library like DOMPurify. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for karma →

Share this vulnerability

FAQ

The vulnerability allows an attacker to execute arbitrary scripts on the victim's browser, potentially leading to unauthorized access, data theft, or other malicious activities.

At the time of this advisory, there are no known public exploits targeting this vulnerability. However, it is crucial to apply the recommended fixes to prevent any potential exploitation.

Yes, this vulnerability can be exploited remotely. An attacker can craft malicious web pages or URLs that, when accessed by a user running the vulnerable version of Karma, trigger the execution of the injected scripts.

No specific conditions are required for exploitation. Simply accessing a web page or URL containing the injected script is sufficient for the vulnerability to be triggered.

Yes, the vulnerability has been fixed in Karma version 6.3.14. It is highly recommended to upgrade to this version or later to ensure the security of your application.

Related vulnerabilities

Recent vulnerabilities recorded for karma.

How To Fix

Minimum fixed version

6.3.14

This is the first release that contains the fix.

npm install karma@6.3.14

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback