CVE-2022-25758: Regular expression denial of service in scss-tokenizer

scss-tokenizer Updated 02 Oct 2025

Summary

02/07/2022
Yes i
High
7.5

CVE-2022-25758: Regular expression denial of service in scss-tokenizer. Affects scss-tokenizer versions < 0.4.3. Fixed in 0.4.3. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The scss-tokenizer package is an npm package used for tokenizing SCSS (Sassy CSS) code. It provides functions to parse and tokenize SCSS input. The package is widely used in web development projects that involve SCSS preprocessing. However, versions prior to 0.4.3 of scss-tokenizer are vulnerable to Regular Expression Denial of Service (ReDoS) due to the usage of insecure regex in the loadAnnotation() function.

Vulnerability Detail

The vulnerability in scss-tokenizer allows an attacker to perform a Regular Expression Denial of Service (ReDoS) attack. This type of attack exploits the inefficient matching behavior of certain regular expressions, causing the application to consume excessive CPU resources and potentially leading to a denial of service. By sending specially crafted input, an attacker can cause the loadAnnotation() function to enter a state of exponential time complexity, resulting in a significant performance degradation or even a complete system freeze. This vulnerability has a CVSS score of 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

How To Fix

Minimum fixed version

0.4.3

This is the first release that contains the fix.

npm install scss-tokenizer@0.4.3

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

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed version (0.4.3) of the scss-tokenizer package to mitigate the risk.

Conclusion

The scss-tokenizer package prior to version 0.4.3 is vulnerable to Regular Expression Denial of Service (ReDoS). It is crucial to update to version 0.4.3 or later to fix this vulnerability and mitigate the risk of a denial of service attack. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for scss-tokenizer →

Share this vulnerability

FAQ

scss-tokenizer is an npm package used for tokenizing SCSS code. It provides functions to parse and tokenize SCSS input.

Regular Expression Denial of Service (ReDoS) is a type of attack that exploits the inefficient matching behavior of certain regular expressions. By sending specially crafted input, an attacker can cause the application to consume excessive CPU resources and potentially lead to a denial of service.

This vulnerability can lead to a denial of service, causing significant performance degradation or even a complete system freeze.

To fix this vulnerability, it is recommended to upgrade to version 0.4.3 or later of the scss-tokenizer package.

There is no known workaround for this vulnerability. It is essential to update to the fixed version (0.4.3) of the scss-tokenizer package to mitigate the risk.

How To Fix

Minimum fixed version

0.4.3

This is the first release that contains the fix.

npm install scss-tokenizer@0.4.3

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