FirstBlood-#1668Stored 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:

  1. Visit firstbloodhackers.com/book-appointment.php and fill in the information required to make an appointment
  2. Click Book Appointment and intercept the request
  3. Add &ambulance=1 to the data and forward the request

  1. Take note of the created appointment ID

  1. Visit firstbloodhackers.com/api/ambulances.php?select={appointment ID} and take note of the ambId

  1. Visit firstbloodhackers.com/api/manageambulances.php and intercept the request
  2. Change the request to a PUT request
  3. 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:

  1. The attacker could steal a user's cookies.
  2. The attacker can steal data from whoever views the page.
  3. Users can execute arbitrary JavaScript code in the context of other users.

P2 High

This report contains multiple vulnerabilities:

  • Stored XSS
  • Stored XSS


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