Skip to main content

Over 150 LLM Providers · Over 5,300 Models The most extensible AI-powered pentesting platform. Open source. Star on GitHub

CVE-2021-21353

6.8 · MEDIUM
Published Mar 3, 2021 pugjs CWE-74 EPSS 4.30% (90th pctl)

Overview

CVE-2021-21353 is a medium-severity vulnerability affecting pugjs pug. It was published on March 3, 2021 and has a CVSS 3.1 base score of 6.8 (MEDIUM).

This vulnerability has a CVSS 3.1 base score of 6.8, rated MEDIUM. It can be exploited remotely over the network. No authentication or special privileges are required for exploitation.

Technical Description

Pug is an npm package which is a high-performance template engine. In pug before version 3.0.1, if a remote attacker was able to control the `pretty` option of the pug compiler, e.g. if you spread a user provided object such as the query parameters of a request into the pug template inputs, it was possible for them to achieve remote code execution on the node.js backend. This is fixed in version 3.0.1. This advisory applies to multiple pug packages including "pug", "pug-code-gen". pug-code-gen has a backported fix at version 2.0.3. This advisory is not exploitable if there is no way for un-trusted input to be passed to pug as the `pretty` option, e.g. if you compile templates in advance before applying user input to them, you do not need to upgrade.

Remediation

Check the references section for vendor advisories and patches from pugjs. Update pug to the latest patched version. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

Affected Products

Vendor Product Versions Status
pugjs pug >= 0, < 3.0.1 Affected
pugjs pug-code-gen >= 0, < 2.0.3 Affected

Frequently Asked Questions

What is CVE-2021-21353?

CVE-2021-21353 is a medium-severity vulnerability affecting pugjs pug. It was published on March 3, 2021 and has a CVSS 3.1 base score of 6.8 (MEDIUM).

How severe is CVE-2021-21353?

This vulnerability has a CVSS 3.1 base score of 6.8, rated MEDIUM. It can be exploited remotely over the network. No authentication or special privileges are required for exploitation.

How do I fix or remediate CVE-2021-21353?

Check the references section for vendor advisories and patches from pugjs. Update pug to the latest patched version. If immediate patching is not possible, review the CVSS vector to understand the attack surface and apply compensating controls such as network segmentation or access restrictions.

How can CyberStrike help with CVE-2021-21353?

CyberStrike's AI-powered security agents can automatically detect CVE-2021-21353 across your infrastructure using autonomous pentesting, DAST scanning, and HackBrowser. The platform continuously monitors for known vulnerabilities and provides actionable remediation guidance prioritized by real-world exploitability.