Contao: Cross-site scripting in the comments bundle
Impact
An unauthenticated front end visitor can post a comment containing a XSS injection. The victim is any back end user who opens the Comments module, and moderation makes exposure certain rather than preventing it. No Content-Security-Policy header is sent on the Contao back end, so nothing mitigates the inline handler.
Source excerpt · OSVAffected packages
Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.
| Affected range | Recorded fix |
|---|---|
| From 4.0.0 before 5.3.50Ecosystem versions | 5.3.50 |
| From 5.4.0-RC1 before 5.7.12Ecosystem versions | 5.7.12 |
Version evidence: OSV · GHSA-628f-v4f6-p37r
View original version evidence (462 explicit versions)
Original source description
An unauthenticated front end visitor can post a comment containing a XSS injection. The victim is any back end user who opens the Comments module, and moderation makes exposure certain rather than preventing it. No Content-Security-Policy header is sent on the Contao back end, so nothing mitigates the inline handler.
Impact
Anyone on the internet can inject script that executes in the Contao back end origin, under the session of whichever user opens the Comments module, with no click and no hover. From there the payload acts as that user through the back end: reading any module they can reach, creating a new administrator, or editing a template, which on Contao is a documented path from back end write access to code execution. Moderation does not help and in fact guarantees exposure, since unpublished comments are still inserted and a moderator has to open the list to act on them.
References
- Security advisory github.com/contao/contao/security/advisories/GHSA-628f-v4f6-p37r
- Patch github.com/contao/contao/commit/22505d5f79bc1a7f52e2cba5fddf6007e1f0408a
- Source reference github.com/contao/contao
- Release notes github.com/contao/contao/releases/tag/5.3.50
- Release notes github.com/contao/contao/releases/tag/5.7.12