Remote Code Execution (RCE) Affecting pug-code-gen package, versions <2.0.3>=3.0.0 <3.0.2


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
6.79% (94th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-PUGCODEGEN-1082232
  • published1 Mar 2021
  • disclosed10 Feb 2021
  • creditCykuTW

Introduced: 10 Feb 2021

CVE-2021-21353  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade pug-code-gen to version 2.0.3, 3.0.2 or higher.

Overview

pug-code-gen is a Default code-generator for pug. It generates HTML via a JavaScript template function.

Affected versions of this package are vulnerable to Remote Code Execution (RCE). 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.

CVSS Scores

version 3.1