HTML attribute injection in Markdown mail when Markdown::withSecuredEncoding() is enabled
Summary
Summary
When Markdown::withSecuredEncoding() is enabled, values echoed with {{ }} in Markdown mail templates are not escaped for double quotes, single quotes or ampersands. A value rendered inside an HTML attribute can break out of it and inject additional attributes into the email. Applicati...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| composerlaravel/framework |
>= 13.0.0, <13.44.1→ >=13.44.1 |
>=13.44.1 |
| composerlaravel/framework |
>= 12.14.1, <12.74.0→ >=12.74.0 |
>=12.74.0 |
Original description The description as published by the source.
Summary
When Markdown::withSecuredEncoding() is enabled, values echoed with {{ }} in Markdown mail templates are not escaped for double quotes, single quotes or ampersands. A value rendered inside an HTML attribute can break out of it and inject additional attributes into the email. Applications that do not enable withSecuredEncoding() are not affected.
Impact
Applications that enable Markdown::withSecuredEncoding() and render user-controlled data inside an HTML attribute in a Markdown mail template, including via the mail::button URL, allow attribute injection into the generated email. This can alter link targets or styling for phishing, and leads to XSS where the mailable is rendered in a context that executes script.
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY laravel/framework