Regular Expression Denial of Service Vulnerability in Node-PostCSS Package
Summary
UBUNTU-CVE-2021-23368: The package postcss from 7.0.0 and before 8.2.10 are vulnerable to Regular Expression Denial of Service (ReDoS) during source map parsing. Affects node-postcss versions 8.2.1+~cs5.3.23-8 – 8.4.6+~cs7.3.21-1. No fix is published. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
Node-PostCSS is a popular tool used in web development for transforming CSS with JavaScript plugins. It allows developers to write CSS in a more modular and maintainable way. However, certain versions of this package are vulnerable to a Regular Expression Denial of Service (ReDoS) attack, which can lead to performance degradation and service unavailability.
Vulnerability Detail
The vulnerability arises from the postcss package, which is utilized by Node-PostCSS. Versions from 7.0.0 up to, but not including, 8.2.10 are susceptible to ReDoS during source map parsing. This can allow an attacker to exploit the regular expressions used in the parsing process, causing the application to hang or crash due to excessive resource consumption. The potential ramifications include denial of service, where legitimate users are unable to access the service, leading to a poor user experience and potential financial losses.
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
If an immediate update is not feasible, consider implementing input validation to limit the complexity of the CSS being processed, thereby reducing the risk of exploitation. Additionally, monitor your application for unusual behavior that may indicate an attack.
Conclusion
The Regular Expression Denial of Service vulnerability in the Node-PostCSS package poses a significant risk to applications relying on this tool. It is crucial for developers to update to the latest patched version to mitigate the risk and ensure the stability of their applications.
See every vulnerability recorded for node-postcss →
FAQ
ReDoS is a type of denial-of-service attack that exploits the way regular expressions are processed, causing the application to consume excessive CPU resources and potentially crash.
Node-PostCSS versions from 7.0.0 to 8.2.10 are vulnerable to this issue.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Failure to address this vulnerability may lead to service disruptions, affecting user access and potentially resulting in financial losses.
The CVSS score for this vulnerability is 5.3, indicating a medium severity level.
Related vulnerabilities
Recent vulnerabilities recorded for node-postcss.