Stored Cross-Site Scripting (XSS) in Reservation Management — S
Reservation fields such as Fullname and Remarks are stored without sanitisation and rendered into administrative pages without output encoding, so injected script runs in the browser of anyone viewing the reservation list. An authenticated user could therefore run arbitrary JavaScript in another user's session, including an administrator's.
Published on medium.com
During further security testing of the SourceCodester Resort Reservation System (PHP + SQLite), an additional stored cross-site scripting (XSS) vulnerability was identified within the Reservation Management module.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application stores user input as-is and echoes it into HTML templates without contextual output encoding such as htmlspecialchars().
Impact
The script persists and runs for any user who views the affected records, which could allow administrative session hijacking, privilege escalation, data exfiltration and account takeover; the text notes the risk grows if lower-privileged users can submit data that administrators later review.
What the attacker needed
An authenticated account; ability to add or edit reservations; victim views the reservation list
The fix
User-controlled values should be output-encoded with htmlspecialchars() using ENT_QUOTES and UTF-8 wherever they are rendered, with input validation and a restrictive CSP as defence in depth.
How it was found
- Open the reservation list and add or edit a reservation.
- Enter script markup into the Fullname field (or the Remarks field) and save the reservation.
- Open the reservation list or the edit view for that reservation, and the stored script runs automatically.
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 write-up has not been written yet. The Original tab links to the source.
A web page builds its HTML from text that users typed in, such as a reservation name. If that text is not cleaned or escaped, someone can type in a small script instead of a name, and the browser will run it as if the site itself had written it. Because the text is saved in the database, the script runs again every time anyone opens that page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.