Skip to content
Access control Write-up Intermediate

BAC (Authorization Bypass Allows Former Owner to Add Teachers After Role Downgrade)

A teacher who had been downgraded from class owner could still replay a previously captured request to add co-teachers, even though the interface hides that function from teachers. An attacker with a teacher account could therefore add arbitrary teachers to a class they no longer own.

HBlackGhost Follow

Published on medium.com

بس� الله الرح� ن الرحي� , اللَّهُ� َّ ‌صَلِّ ‌عَلَى ‌� ُحَ� َّدٍ ‌وَعَلَى ‌آلِ ‌� ُحَ� َّدٍ، ‌ك� ا ‌صليت ‌على ‌إبراهي� ، وعلى آل إبراهي� ، إنك ح� يد � جيد، اللَّهُ� َّ بَارِكْ عَلَى � ُحَ� َّدٍ وَعَلَى آلِ � ُحَ� َّدٍ، ك� ا باركت على إبراهي� وعلى آل إبراهي� ، إنك ح� يد � جيد , الله� لك الح� د ك� ا ينبغي لجلال وجهك وعظي� سلطانك االله� لك…

HBlack Ghost, on medium.com

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

Likely the server authorised the add-teacher action based on a stale or missing role check, so a replayed request from a downgraded teacher was still accepted.

Impact

A teacher without owner rights could add arbitrary teachers to a class, bypassing the intended role restriction.

What the attacker needed

A teacher account in a class; a captured add-teacher request; ability to replay requests

The fix

The server should re-check the caller's current role and ownership on every add-teacher request rather than trusting the earlier state.

How it was found

  1. Create a school leader account, then create a school and a class.
  2. Create a teacher account and accept the invitation to the class.
  3. As the leader, set yourself as owner and capture the add/remove co-teacher requests.
  4. Transfer ownership back so the second account is only a teacher.
  5. Replay the saved add-teacher request from the teacher account and observe it succeeds.

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 website has different roles, like owner and teacher, and each role should only be allowed to do certain things. Here the server checked the role when the page was loaded but not properly when the request was sent again later, so an old saved request still worked. This means someone with fewer permissions could still perform an action reserved for the owner.

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 HBlackGhost

View all

3 more disclosed reports, best first.

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.