CVE-2020-7702: Prototype Pollution in templ8

templ8 Updated 02 Oct 2025

Summary

06/05/2021
No i
Critical
9.8

CVE-2020-7702: Prototype Pollution in templ8. Affects templ8 versions < 0.0.44. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The templ8 package is an npm package used for templating in JavaScript applications. It provides a parse function that is vulnerable to Prototype Pollution. Prototype Pollution is a vulnerability that allows an attacker to modify the prototype of an object, leading to unexpected behavior and potential security issues. In the case of templ8, the parse function is susceptible to this vulnerability.

Vulnerability Detail

The vulnerability in templ8 arises from improper handling of user-supplied input during the parsing process. An attacker can craft malicious input that manipulates the prototype of objects, potentially leading to arbitrary code execution, information disclosure, or denial of service. This vulnerability affects all versions of templ8 up to and including 0.0.44.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, developers can avoid using the parse function of templ8 or implement additional input validation and sanitization measures before passing user-supplied input to the parse function. Here is an example of how to sanitize input using the 'xss' package:

const xss = require('xss');

const sanitizedInput = xss(input);

// Pass sanitizedInput to the parse function

Conclusion

The templ8 package is vulnerable to Prototype Pollution, which can lead to various security issues. It is crucial to update to a version beyond 0.0.44 and implement proper input validation and sanitization to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for templ8 →

Share this vulnerability

FAQ

Prototype Pollution is a vulnerability that allows an attacker to modify the prototype of an object, leading to unexpected behavior and potential security issues. It can be exploited to execute arbitrary code, disclose sensitive information, or cause denial of service.

The vulnerability in templ8 arises from improper handling of user-supplied input during the parsing process. This allows an attacker to manipulate the prototype of objects and potentially execute arbitrary code or cause other security issues.

The impact of this vulnerability depends on how the templ8 package is used in an application. It could lead to arbitrary code execution, information disclosure, or denial of service if an attacker is able to exploit the Prototype Pollution vulnerability.

Yes, all versions of templ8 up to and including 0.0.44 are vulnerable to Prototype Pollution. It is recommended to update to a version beyond 0.0.44 to mitigate the vulnerability.

To fix this vulnerability, update the templ8 package to a version beyond 0.0.44. Additionally, ensure that user-supplied input is properly validated and sanitized before passing it to the parse function.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback