Skip to content

Reflected XSS in challenge page via unsanitized destination rendered with text/template

Moderate
joecorall published GHSA-ph62-4j5g-2q4r Mar 26, 2026

Package

github.com/libops/captcha-protect (traefik plugin)

Affected versions

< v1.12.2

Patched versions

v1.12.2

Description

Impact

A reflected cross-site scripting (XSS) vulnerability exists in github.com/libops/captcha-protect in versions prior to v1.12.2.

The challenge page accepted a client-supplied destination value and rendered it into HTML using Go's text/template. Because text/template does not perform contextual HTML escaping, an attacker could supply a crafted destination value that breaks out of the hidden input attribute and injects arbitrary script into the challenge page.

This issue can be triggered by causing a victim to visit a crafted challenge URL or any flow that reflects attacker-controlled destination input into the rendered challenge page. Successful exploitation would execute attacker-controlled JavaScript in the security context of the affected application origin.

Mitigation

This vulnerability is mitigated if your captcha-protect plugin is configured to perform challenges inline with the setting challengeURL: "". If your challenge URL is set to any other value than "" you are not using inline challenges and are impacted by this vulnerability

Patches

This issue is fixed in v1.12.2.

The fix:

  • switches challenge page rendering from text/template to html/template, which applies contextual escaping for HTML attributes
  • uses a typed template data structure for the challenge page
  • normalizes and restricts destination before redirect use so only safe local paths are accepted

Users should upgrade to v1.12.2 or later.

Workarounds

If you cannot upgrade immediately:

  • Use inline challenges with the conf challengeURL: ""
  • if possible, block direct access to crafted /challenge URLs from untrusted sources until the patch is deployed

These workarounds reduce risk but do not replace upgrading to a patched release.

References

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

CVE ID

CVE-2026-34206

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.