Skip to content
Access control Write-up Beginner

How I Found an Unauthenticated POST Endpoint in a Production API

An unauthenticated POST endpoint allowed anyone to create department records in a production attendance management system, while sibling methods correctly required authentication. An attacker could pollute the organisation's department list and, with no rate limiting, flood the database with records.

Md Zishan Firoz Follow

Published on infosecwriteups.com

Today I want to share a real vulnerability I recently discovered and responsibly disclosed — walking you through my exact methodology, from initial recon to the final PoC. No fluff, just the process.

Md Zishan Firoz, on infosecwriteups.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 authentication middleware was applied per-route rather than globally, and the POST route was missing it.

Impact

An anonymous attacker could inject arbitrary department names into the internal org chart and, because there is no rate limiting, flood the database with millions of records, causing slowdowns and increased storage costs.

What the attacker needed

No account needed; Network access to the API

The fix

Authentication middleware should be applied globally at the router level, public endpoints explicitly allowlisted, rate limiting added to write endpoints, and Swagger UI restricted to internal or authenticated users.

How it was found

  1. Find the API documentation at /api/docs, which was publicly accessible.
  2. Notice in the Swagger UI that the POST method for /api/department had no lock icon, unlike PUT and DELETE.
  3. Send a POST request to /api/department without any authentication token and receive HTTP 201 Created.
  4. Fetch the newly created department by its ID to confirm it persists.
  5. Send PUT and DELETE requests without a token and receive 401, confirming only POST was unprotected.

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.

Some web applications have different rules for different actions on the same resource. Here, reading and deleting departments required a login, but creating a new department did not. That meant anyone on the internet could add fake departments to the company's internal system without logging in.

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.

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.