Regular Expression Denial of Service (ReDoS) Vulnerability in MooTools Package

mootools Updated 02 Oct 2025

Summary

03/01/2023
N/A
No i
High
7.5

CVE-2021-32821: MooTools is a collection of JavaScript utilities for JavaScript developers. Affects mootools versions < 4501a2979f49156e2375808e1b3cbdb6ecaed849. No fix is published. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

MooTools is a robust collection of JavaScript utilities designed for developers, enabling them to create dynamic web applications with ease. It provides a range of features, including DOM manipulation, event handling, and AJAX capabilities. However, all known versions of MooTools contain a CSS selector parser that is susceptible to a Regular Expression Denial of Service (ReDoS) attack, which can severely impact application performance and availability.

Vulnerability Detail

The vulnerability arises from the CSS selector parser within MooTools, which allows an attacker to inject a malicious string into a CSS selector at runtime. This is particularly concerning as such injections are common in scenarios involving jQuery CSS selectors. The ReDoS attack exploits the way regular expressions are processed, potentially leading to significant delays and resource exhaustion. As a result, applications utilizing MooTools may become unresponsive, affecting user experience and system stability.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can implement input validation to restrict the types of strings that can be injected into CSS selectors. This can be done by using a whitelist approach to allow only safe and expected values. For example, you can create a function to validate the input as follows:

function validateCSSSelector(selector) {
    const regex = /^[a-zA-Z0-9-_.#]+$/; // Adjust regex as needed
    return regex.test(selector);
}

// Usage
if (validateCSSSelector(userInput)) {
    // Safe to use the selector
} else {
    // Handle invalid input
}

Conclusion

The CVE-2021-32821 vulnerability in MooTools poses a significant risk due to its susceptibility to ReDoS attacks. While there are currently no patches available, developers should take proactive measures to validate input and consider alternative libraries. Utilizing tools like Vulert can help monitor for vulnerabilities in real-time.

See every vulnerability recorded for mootools →

Share this vulnerability

FAQ

ReDoS is a type of attack that exploits the way regular expressions are processed, causing a system to become unresponsive due to excessive resource consumption.

All known versions of MooTools are affected by this vulnerability.

No, there are currently no patches available to fix this vulnerability in MooTools.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected.

If upgrading is not an option, implement input validation to sanitize CSS selectors and restrict the types of strings that can be injected.

Related vulnerabilities

Recent vulnerabilities recorded for mootools.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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