CVE-2021-21353
Pug `Remote Code Execution`
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.
INFO
Published Date :
March 3, 2021, 2:15 a.m.
Last Modified :
April 16, 2025, 11:15 p.m.
Source :
[email protected]
Remotely Exploitable :
Yes !
Impact Score :
6.0
Exploitability Score :
2.2
Public PoC/Exploit Available at Github
CVE-2021-21353 has a 1 public PoC/Exploit
available at Github.
Go to the Public Exploits
tab to see the list.
References to Advisories, Solutions, and Tools
Here, you will find a curated list of external links that provide in-depth
information, practical solutions, and valuable tools related to
CVE-2021-21353
.
We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).
None
Dockerfile JavaScript Pug
Results are limited to the first 15 repositories due to potential performance issues.
The following list is the news that have been mention
CVE-2021-21353
vulnerability anywhere in the article.
The following table lists the changes that have been made to the
CVE-2021-21353
vulnerability over time.
Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.
-
CVE Modified by [email protected]
Apr. 16, 2025
Action Type Old Value New Value Changed 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. 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. -
CVE Modified by af854a3a-2127-422b-91ae-364da2661108
Nov. 21, 2024
Action Type Old Value New Value Added Reference https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0 Added Reference https://github.com/pugjs/pug/issues/3312 Added Reference https://github.com/pugjs/pug/pull/3314 Added Reference https://github.com/pugjs/pug/releases/tag/pug%403.0.1 Added Reference https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr Added Reference https://www.npmjs.com/package/pug Added Reference https://www.npmjs.com/package/pug-code-gen -
CVE Modified by [email protected]
May. 14, 2024
Action Type Old Value New Value -
Initial Analysis by [email protected]
Mar. 09, 2021
Action Type Old Value New Value Added CVSS V2 NIST (AV:N/AC:M/Au:N/C:P/I:P/A:P) Added CVSS V3.1 NIST AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H Changed Reference Type https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0 No Types Assigned https://github.com/pugjs/pug/commit/991e78f7c4220b2f8da042877c6f0ef5a4683be0 Patch, Third Party Advisory Changed Reference Type https://github.com/pugjs/pug/issues/3312 No Types Assigned https://github.com/pugjs/pug/issues/3312 Exploit, Patch, Third Party Advisory Changed Reference Type https://github.com/pugjs/pug/pull/3314 No Types Assigned https://github.com/pugjs/pug/pull/3314 Patch, Third Party Advisory Changed Reference Type https://github.com/pugjs/pug/releases/tag/pug%403.0.1 No Types Assigned https://github.com/pugjs/pug/releases/tag/pug%403.0.1 Release Notes, Third Party Advisory Changed Reference Type https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr No Types Assigned https://github.com/pugjs/pug/security/advisories/GHSA-p493-635q-r6gr Third Party Advisory Changed Reference Type https://www.npmjs.com/package/pug No Types Assigned https://www.npmjs.com/package/pug Product, Third Party Advisory Changed Reference Type https://www.npmjs.com/package/pug-code-gen No Types Assigned https://www.npmjs.com/package/pug-code-gen Product, Third Party Advisory Added CPE Configuration OR *cpe:2.3:a:pugjs:pug:*:*:*:*:*:node.js:*:* versions up to (excluding) 3.0.1 *cpe:2.3:a:pugjs:pug-code-gen:*:*:*:*:*:node.js:*:* versions up to (excluding) 2.0.3 *cpe:2.3:a:pugjs:pug-code-gen:*:*:*:*:*:node.js:*:* versions from (including) 3.0.0 up to (excluding) 3.0.2
CWE - Common Weakness Enumeration
While CVE identifies
specific instances of vulnerabilities, CWE categorizes the common flaws or
weaknesses that can lead to vulnerabilities. CVE-2021-21353
is
associated with the following CWEs:
Common Attack Pattern Enumeration and Classification (CAPEC)
Common Attack Pattern Enumeration and Classification
(CAPEC)
stores attack patterns, which are descriptions of the common attributes and
approaches employed by adversaries to exploit the CVE-2021-21353
weaknesses.
Exploit Prediction
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.
0.93 }} -0.22%
score
0.74890
percentile