# templ: javascript: URLs not sanitised in other URL attributes and mixed-case attribute names

> templ sanitised string URLs only in a few attributes (a/link href, form action, object data) and only when the attribute name was lowercase. String values in other URL-bearing attributes, or in uppercase or mixed-case attribute names, were written without URL sanitisation, so javascript: URLs could pass through and run script. Fixed in v0.3.1100.

- Project: [a-h/templ](https://github.com/a-h/templ)
- Ecosystem: Go
- Category: Security
- Type: XSS
- Severity: Medium
- Status: Published
- Affected versions: `github.com/a-h/templ <= 0.3.1070`
- Disclosed via: Private vulnerability report
- GitHub advisory: [GHSA-94c2-xg24-pwhv](https://github.com/advisories/GHSA-94c2-xg24-pwhv)
- Disclosure: <https://github.com/a-h/templ/security/advisories/GHSA-94c2-xg24-pwhv>
- 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-url-attribute-sanitization-gap.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-url-attribute-sanitization-gap/>

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