Intel

AIKIDO-2026-28946

spiral/stempler is vulnerable to Cross-Site Scripting (XSS)

GHSA-wpjr-ppfr-7m6vPublished Aug 10, 2026
August 10, 2026

61

CVE Score

Medium

Cross-Site Scripting (XSS)

Are you affected? Scan for Free

TL;DR

Stempler is the framework's default template engine and applies context-aware escaping to values echoed with the auto-escaping output syntax. For JavaScript event-handler attributes such as onclick and other on* handlers, the finalizer HTML-entity-encodes the value and wraps it in quotes instead of encoding it as a JavaScript literal. Because the browser HTML-decodes an event-handler attribute before the JavaScript engine parses it, user-supplied quotes are decoded back and can break out of the JavaScript string, yielding reflected or stored cross-site scripting through the supported safe syntax. The fix serializes the value with json_encode using the JSON_HEX_* flags and HTML-encodes the resulting literal so it survives both HTML and JavaScript decoding.

How do I fix this?

Upgrade the spiral/stempler and/or the spiral/framework library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your templates render user-controlled data into an on* event-handler attribute using the auto-escaping output syntax.

Versions

2.7.0 - 3.17.1

Fixed in 3.17.2

Background info

spiral/stempler is vulnerable to Cross-Site Scripting (XSS) in versions 2.7.0 - 3.17.1.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea