Vulnerability library
Security checkApril 28, 2025

Pug allows JavaScript code execution if an application accepts untrusted input

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmpug

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

Pug through 3.0.2 allows JavaScript code execution if an application accepts untrusted input for the name option of the compileClient, compileFileClient, or compileClientWithDependenciesTracked function. NOTE: these functions are for compiling Pug templates into JavaScript, and there would typically be no reason to allow untrusted callers.

Recommendation

Update the pug package to the latest compatible version. Followings are version details:

  • Affected version(s): <= 3.0.2
  • Patched version(s): 3.0.3

References

Could your website be exposed too?

SmartScanner can check your website for Pug allows JavaScript code execution if an application accepts untrusted input and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated April 28, 2025