PatchClock

PHP security digest · 9 Oct 2026

Contao: Cross-site scripting in the comments bundle

Critical CVE-2026-107845

Package
contao/comments-bundle
Fixed in
5.3.50, 5.7.12
Published
Fri 9 Oct 2026, 21:53 LisbonUpdated Sun 25 Oct 2026, 22:25 Lisbon
Installs on Packagist
1M

In plain words

An unauthenticated front end visitor can post a comment containing a script that runs as whichever back end user opens the Comments module, without further interaction. It can act with that user's access, including reading accessible modules, creating an administrator or editing a template, which can lead to code execution. Comment moderation does not prevent this: unpublished comments are stored, and opening the list to moderate them triggers exposure.

Affected versions

PackageAffectedFixed in
contao/comments-bundle>= 4.0.0, < 5.3.505.3.50
contao/comments-bundle>= 5.4.0-RC1, < 5.7.125.7.12

Am I affected?

Check composer.lock for contao/comments-bundle. Affected versions are >= 4.0.0, < 5.3.50 and >= 5.4.0-RC1, < 5.7.12; the fixes are 5.3.50 and 5.7.12. Check whether front end visitors can submit comments and back end users open the Comments module. Moderation does not protect those users, and the advisory states that the Contao back end sends no Content-Security-Policy header.

What to do

Check which version you have, then update to a fixed release for your branch (5.3.50, 5.7.12):

composer show contao/comments-bundle | grep versions
composer update contao/comments-bundle

If your version constraint in composer.json keeps you below a fixed release, raise it first. Whether your configuration is affected, and the exact version ranges, are in the advisory itself.

The advisory's 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.

Weakness: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'); CWE-116 Improper Encoding or Escaping of Output. Reported by HDWSec.

The advisory

From OSV.dev, which gathers the GitHub Advisory Database, FriendsOfPHP and Drupal security advisories; the summary is theirs. The description, affected versions, weakness and credits are from the GitHub Advisory Database (CC BY 4.0). "In plain words", "Am I affected?" and "If you cannot update yet" are based on that advisory, and checked to name no version it does not.