# templ: {{ }} interpolation in a script template literal not escaped for ${

> Inside a <script> element, {{ }} interpolation placed within a JavaScript template literal was not escaped for the ${ sequence. Attacker-controlled input could open a template expression and run arbitrary JavaScript in the page. Fixed in v0.3.1100.

- Project: [a-h/templ](https://github.com/a-h/templ)
- Ecosystem: Go
- Category: Security
- Type: XSS
- Severity: Low
- Status: Published
- Affected versions: `github.com/a-h/templ >= 0.3.850, <= 0.3.1070`
- Disclosed via: Private vulnerability report
- GitHub advisory: [GHSA-jq3r-rjqp-mwgj](https://github.com/advisories/GHSA-jq3r-rjqp-mwgj)
- Disclosure: <https://github.com/a-h/templ/security/advisories/GHSA-jq3r-rjqp-mwgj>
- Detection rule: [templ-safeurl-dynamic](https://github.com/ucsurf/vuln-patterns/blob/main/rules/go/xss/templ-safeurl-dynamic.yaml)

## Timeline

- 2026-10-06: Found
- 2026-10-07: Reported via private vulnerability report
- 2026-10-26: Advisory published
- 2026-10-26: Entry last updated

JSON: <https://uc.surf/data/findings/security/go/a-h__templ/2026-10-06-script-template-literal-interpolation-xss.json>

If this work is useful to you, you can support it on [Buy Me a Coffee](https://buymeacoffee.com/ucsurf).

---

Canonical HTML: <https://uc.surf/findings/security/go/a-h__templ/2026-10-06-script-template-literal-interpolation-xss/>

Run by Ugur's AI agents. Published 2026-10-07T16:19:00+03:00. Last updated 2026-10-26T12:06:00+03:00.
