CVE-2021-23368

Regular Expression Denial of Service in postcss

Verified by Precogs Threat Research
Last Updated: Jan 14, 2025
Base Score
9.8CRITICAL

Executive Summary

CVE-2021-23368 is a critical severity vulnerability affecting appsec. It is classified as an undisclosed flaw. Ensure your systems and dependencies are patched immediately to mitigate exposure risks.

Precogs AI Insight

"Precogs AI Analysis Engine identifies web application vulnerabilities through semantic code analysis, detecting injection flaws, broken authentication, and insecure data flows across your entire codebase."

Exploit Probability
High (84%)
Public POC
Available
Exploit Probability
High (84%)
Public POC
Available
Affected Assets
appsecNVD Database

What is this vulnerability?

CVE-2021-23368 is categorized as a critical Code Injection / RCE flaw. Based on our vulnerability intelligence, this issue occurs when the application fails to securely handle untrusted data boundaries.

The npm package postcss from 7.0.0 and before versions 7.0.36 and 8.2.10 is vulnerable to Regular Expression Denial of Service (ReDoS) during source map .

This architectural defect enables adversaries to bypass intended security controls, directly manipulating the application's execution state or data layer. Immediate strategic intervention is required.

Risk Assessment

MetricValue
CVSS Base Score9.8 (CRITICAL)
Vector StringN/A
PublishedMay 10, 2021
Last ModifiedJanuary 14, 2025
Related CWEsN/A

Impact on Systems

Remote Code Execution: Attackers achieve arbitrary command execution within the context of the application server.

Privilege Escalation: Initial code execution can be exploited to pivot and elevate privileges across the network.

Persistent Backdoors: Attackers can bind reverse shells, modify source files, or inject persistent access mechanisms.

How to fix this issue?

Implement the following strategic mitigations immediately to eliminate the attack surface.

1. Remove Dynamic Evaluation Completely eliminate the use of dynamic evaluation functions (eval(), exec(), system()) on untrusted input.

2. Sandboxing If dynamic execution is an absolute business requirement, isolate the execution environment in tightly constrained, non-networked sandboxes (e.g., restricted WebAssembly or isolated containers).

3. Network Segmentation Restrict outbound traffic from the application server (egress filtering) to prevent reverse shell connections.

Vulnerability Signature

// Vulnerable Node.js Execution
const exec = require('child_process').exec;
const user_domain = req.query.domain;
// VULNERABLE: Injecting user input directly into system shell commands
exec('ping -c 4 ' + user_domain, (error, stdout, stderr) =\> \{
    res.send(stdout);
\});

// EXPLOIT PAYLOAD: precogs.ai ; cat /etc/passwd

References and Sources