CVE-2021-23368
Regular Expression Denial of Service (ReDoS) vulnerability in postcss

Regular Expression Denial of Service (ReDoS) No known exploit

What is CVE-2021-23368 About?

This vulnerability affects the `postcss` npm package in versions 7.0.0 through 7.0.36 and 8.2.10, causing a Regular Expression Denial of Service (ReDoS) during source map parsing. A specially crafted input can consume excessive CPU resources, leading to a denial of service. Exploitation requires an attacker to provide malicious input that triggers the vulnerable regex.

Affected Software

  • postcss
    • >7.0.0, <7.0.36
    • >8.0.0, <8.2.10

Technical Details

The `postcss` npm package, specifically versions from 7.0.0 up to and including 7.0.36, and version 8.2.10, is susceptible to a Regular Expression Denial of Service (ReDoS) during the parsing of source maps. This occurs when the package processes input containing specific patterns that can cause its regular expressions to enter a 'catastrophic backtracking' state. In this state, the processing time for the regex grows exponentially with the length of the input, leading to a significant and prolonged consumption of CPU resources. An attacker can craft a malicious source map or input containing these patterns, and when `postcss` attempts to parse it, the application becomes unresponsive, effectively causing a denial of service.

What is the Impact of CVE-2021-23368?

Successful exploitation may allow attackers to render the affected application or service unresponsive, consume excessive system resources, and prevent legitimate users from accessing the service.

What is the Exploitability of CVE-2021-23368?

Exploitation of this ReDoS vulnerability typically requires an attacker to be able to supply untrusted input to the application that utilizes the vulnerable `postcss` package for source map parsing. The complexity is moderate, as crafting the specific input patterns that trigger catastrophic backtracking in regular expressions can require some understanding of regex engine behavior. No authentication or elevated privileges are generally required, as the vulnerability can often be triggered through commonly accessible input fields or file uploads. Remote exploitation is possible if the application processes external user-provided data that includes source maps.

What are the Known Public Exploits?

PoC Author Link Commentary
No known exploits

What are the Available Fixes for CVE-2021-23368?

Available Upgrade Options

  • postcss
    • >7.0.0, <7.0.36 → Upgrade to 7.0.36
  • postcss
    • >8.0.0, <8.2.10 → Upgrade to 8.2.10

Struggling with dependency upgrades?

See how Resolved Security's drop-in replacements make it simple.

Book a demo

Additional Resources

What are Similar Vulnerabilities to CVE-2021-23368?

Similar Vulnerabilities: CVE-2020-28168 , CVE-2019-10744 , CVE-2019-8331 , CVE-2018-16460 , CVE-2017-1000048