Unauthenticated reflected XSS in preview_as_user function
The cID parameter in the preview_as_user function is reflected without sanitisation into an iframe src attribute, allowing an attacker to inject script. An attacker could steal cookies or perform actions on behalf of other users.
- Triaged in 2 days
- Fixed in 2 days
- Disclosed after 5 months
Summary by the researcher
Manual code audit and a lot of grepping through source code. Discovered by restricting the scope to features available to an unauthenticated user.
Tools: vim, ripgrep
The report
An unauthenticated, reflected cross-site-scripting attack is possible due to the unsanitised cID parameter in the preview_as_user functionality.
Example URL: https://LOCAL-CONCRETE-INSTALL/ccm/system/panels/page/preview_as_user/preview?cID=%22%3E%3C/iframe%3E%3Cscript%3Ealert(1)%3C/script%3E%3C!--
The error is in the concrete/views/panels/page/preview_as/frame.php file, line 4:
[..]
src="<?= URL::to('/ccm/system/panels/page/preview_as_user/render') . '?&cID=' . Request::request('cID') ?>
[..]
Solutions would be to either cast this value to an int with intval(), or pass the value through htmlentities() before rendering it. Or both!
Impact
An attacker could steal cookies or perform actions on other users behalf.
Attachments

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The cID parameter is concatenated into an HTML attribute without encoding or type casting.
Impact
An attacker could steal cookies or perform actions on other users behalf.
What the attacker needed
Victim clicks a crafted link; no authentication needed
The fix
The value should be cast to an integer with intval() or passed through htmlentities() before rendering, or both.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Cross-site scripting (XSS) is when a website puts user input into a page without cleaning it, so an attacker can make the page run their own JavaScript. Here, a value from the URL is placed directly into a web page, so a crafted link can run code in the victim's browser. That code could read cookies or act as the logged-in user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.