Template2 HTML Plugin Single Quote Injection Vulnerability Allowing Cross-Site Scripting

Vulnerability

A vulnerability in the Template2 HTML plugin for Perl, affecting versions through 3.102, allows for Cross-Site Scripting (XSS) attacks by injecting HTML and JavaScript. The issue arises because the 'html_filter' function fails to properly escape single quotes, enabling code injection through HTML attributes. For instance, a variable containing a single quote could be injected into an attribute without proper sanitization. While the vulnerability primarily allows limited HTML and JavaScript injection, the exploitation of this flaw could be used to create more significant security issues, such as session hijacking or defacement.

Impact

Exploitation of this vulnerability creates a Cross-Site Scripting risk by allowing the injection of unescaped HTML and JavaScript into single-quoted attributes, which could be executed in the user's browser.

Reproduction

To reproduce this vulnerability, use the Template2 HTML plugin and apply the 'html_filter' function to a variable containing a single quote. The filter will not escape the single quote, allowing for the injection of HTML or JavaScript into a single-quoted attribute. This can be verified by injecting a JavaScript payload, such as an 'onclick' event, which would be executed when the attribute is triggered.

Remediation

Users can update to the latest version of Template2, where this vulnerability has been addressed. Instructions for updating can be found in the Template2 GitHub repository.

Added: May 19, 2026, 10:20 PM
Updated: May 19, 2026, 10:20 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
1.7
exploitability
7.4
remediation
0.0
relevance
8.8
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.