Skip to content
Access control Write-up Beginner

Improper Access Control — Generic: How I Gained Full Contro

A publicly accessible Swagger page exposed admin API endpoints that lacked authentication and authorization checks. An attacker could create a new admin account, reset existing admin passwords, delete admins, and manipulate employee records.

rezauditore Follow

Published on medium.com

In a recent report, I came across a Swagger UI that exposed API endpoints, which could have let an attacker take full control of the system’s admin functions / Admin panel. It was a simple, public Swagger page revealing sensitive admin endpoints with no authentication or authorization protection.

rezauditore, 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 admin API endpoints were deployed without any authentication or role-based authorization checks, and the Swagger documentation page that listed them was publicly accessible.

Impact

An attacker could take over admin accounts, lock out legitimate admins causing a denial of service, and manipulate or delete employee data.

What the attacker needed

Publicly reachable Swagger page; No account needed

The fix

The issue was fixed after the report; the recommended fix is to put Swagger documentation behind authentication and enforce authentication and role-based authorization on all sensitive API endpoints.

How it was found

  1. Access the publicly available Swagger documentation page that lists the API routes.
  2. Send a request to the AddAdmin endpoint to create a new admin account.
  3. Use the Admins/List endpoint to retrieve an existing admin's employee ID.
  4. Call the ResetPassword endpoint with that ID to take over the existing admin account.
  5. Call the Delete endpoint to remove admin accounts and lock out legitimate admins.
  6. Use the EmployeeManagers Add, Edit and Delete endpoints to change employee records.

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.

Swagger is a tool that lists and documents a website's API endpoints, which are the URLs that programs use to talk to the server. Here, that list was public and the admin-only actions on it did not check who was calling them, so anyone could add themselves as an administrator or reset other admins' passwords.

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 rezauditore

View all

1 more disclosed report, 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.