
Reproduction lab and PoC for CVE-2026-129491, a stored XSS in forum-java's comment reply dialog that enables session theft via a non-HttpOnly sid cookie.
data-reply-content → jQuery.html())| CVE | CVE-2026-129491 |
| Component | Qbian61/forum-java — CommentTransfer.toComment (storage), comment-list.html (data-reply-content), posts-script.html ($('#repliedContent').html(dataset.replyContent)) |
| Affected | 20f7e68 – 63152c49 (the pinned master head; unfixed upstream) |
| Fixed in | no upstream fix at publication time; the fixed side is a hash-checked synthetic remediation (documented as such) |
| CWE | CWE-79 (Cross-site Scripting, Stored) |
| Impact | Session theft + admin takeover: the payload runs when a victim clicks Reply on the attacker's comment; the sid session cookie carries no HttpOnly flag, so document.cookie inside the onerror handler yields a working admin session |
| Vector | Network; the attacker needs only a regular account; the comment is published without review |
| Trigger | a comment whose content contains ``; the victim's click on Reply |
Comment content is stored verbatim and rendered into the reply dialog without sanitizing:
// CommentTransfer.toComment — content stored as-is
return Comment.builder().content(request.getContent()) ...
<!-- comment-list.html — Thymeleaf escapes the attribute, but the browser
decodes entities for dataset.* -->
<small th:data-reply-content="${comment.content}" class="reply-comment" ...>
// posts-script.html — the click handler
$('.reply-comment').on('click', function (e) {
$('#repliedContent').html(this.dataset.replyContent); // ← executes markup
});
This laboratory builds the real forum-java at the pinned commit
63152c49 against MySQL 8 with the upstream seed, walks the full chain,
and — since the execution requires the victim's click — additionally
proves the two halves that make the click sufficient: the exact string
jQuery.html() receives parses into an executable img onerror event,
and the sid cookie the payload would read is verifiably not
HttpOnly.
Three facts compose:
CommentTransfer.toComment saves the request
content unchanged;data-* attributes, so
dataset.replyContent holds the attacker's raw HTML;jQuery.html(), which parses and executes it.The session cookie set after login (sid) has Path=/ and no
HttpOnly, so the in-origin script reads it; the admin REST endpoints
accept the cookie directly — the advisory demonstrates the admin
backend opening with the stolen session.
| service | image | role |
|---|---|---|
forum-vuln | cve-2026-129491:vuln | forum-java @ 63152c49 (upstream Maven build) against seeded MySQL 8 |
forum-fixed | cve-2026-129491:fixed | same build + lab/patch-fixed.py (hash-checked): content HTML-escaped at storage |
forum-db-vuln / forum-db-fixed | mysql:8.0 | upstream schema.sql + data.sql (SET NAMES utf8mb4 applied); admin password set to Admin@12345 per the advisory |
poc | cve-2026-129491-poc:local | stdlib-only Python driver |
./run-lab.sh build # mvn package at the pinned commit (both trees)
./run-lab.sh up # cve129491lab network: two app+db stacks
./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
./run-lab.sh down
poc/poc.py (stdlib only; mirrors the advisory's chain):
data-reply-content → decode like the browser
→ simulate the jQuery.html() parse with html.parser and look for
executable events. Exit 1 vulnerable, 0 safe, 3 no worker,
2 unreachable..html() receives, the
simulated parse event, and the session-theft precondition (admin
login's Set-Cookie — sid present, HttpOnly: false)..text() / HttpOnly on sid).| run | forum-vuln (63152c49) | forum-fixed (synthetic) |
|---|---|---|
check | parse events: img onerror -> …document.cookie | no executable tag |
exploit sink string | `` | <img …> (inert) |
exploit precondition | sid present, HttpOnly false | (same flag; sink inert) |
probe img / svg / plain | executable / executable / inert | all inert |
Captured runs: evidence/check-*-run.txt, evidence/exploit-*-run.txt,
evidence/probe-*-run.txt, evidence/mitigation-*-run.txt,
evidence/versions.txt, evidence/0day-sweep.txt.
cve129491lab network.The payload-variant matrix is the surface sweep
(evidence/0day-sweep.txt): on the remediated build nothing executable
reaches the sink; on the shipped build both active variants parse as
events. No second delivery form was found beyond the reply dialog.
README.md this write-up
run-lab.sh environment driver (build / up / sweep / down)
Makefile convenience targets
poc/poc.py the PoC (check / exploit / probe / mitigation)
poc/Dockerfile runner image (python:3.12-alpine)
lab/lab.Dockerfile multi-stage build (forum-java @63152c49, both trees)
lab/patch-fixed.py the hash-checked synthetic remediation
lab/mysql-init/ upstream schema + data seed (gitignored)
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)