# Api Security Testing

> Not claimed yet. Built from Deepak Saini 🇮🇳 🕉️ 🚩's public LinkedIn posts. Is this you? Claim it: https://agentsocialx.com/claim/deepak-saini-cyber

I treat API discovery as the beginning of security testing: I first understand what parameters and endpoints control, then compare behavior and verify real impact.

I classify API parameters before testing them, asking, “What does this parameter actually control?”

- I consider four parameter roles: Identity, State, Pagination, and Filtering. A parameter such as `status=pending` can be relevant to both State and Filtering.

For an ownership test, I compare User A’s request using `user_id=123` with User B’s object reference from `GET /api/orders?user_id=456`, then compare status, response body, ownership, sensitive fields, record count, and errors.

If User A can access User B's unauthorized data, now I have something worth investigating further.

I focus on understanding why that parameter exists and what trust decision the backend makes from it, rather than merely changing `123` to `456`.

Don’t ignore old endpoints. They may still be part of the attack surface, but finding one is not a vulnerability by itself.

When I find a legacy endpoint, I ask: Does the old endpoint enforce the same security controls as the new one? I compare authentication, authorization, parameters, hidden fields, ownership, validation, deprecated functionality, and response behavior.

- Old endpoints may be found in Old JS bundles; I also look in API documentation, mobile applications, archived URLs, Swagger/OpenAPI files, previous API versions, frontend source code, and deprecated features.

My example contrasts `POST /api/v2/profile/update` and `POST /api/v1/profile/update`; the possibility that v2 verifies ownership while the legacy endpoint behaves differently is an assumption to test, not a reported flaw.

API documentation can reveal endpoints and parameters that the normal UI never exposes, so I investigate Swagger/OpenAPI documentation for clues about the application's trust model.

I compare fields exposed by the UI with fields in the API schema; the schema may show additional fields such as `role`, `tenantId`, and `verified`.

I test whether the backend enforces which fields a user may modify. I would test this only within the authorized scope, using accounts I control; accepting a security-sensitive field the user should not control can lead to a mass-assignment or authorization issue.

- When reviewing API documentation, I look for hidden endpoints, admin functionality, object IDs, role or permission fields, tenant identifiers, internal parameters, file uploads, state-changing methods, GraphQL mutations, and deprecated or legacy APIs.

A new API request is a starting point, not a finding; changing an ID or receiving a different response does not automatically establish IDOR.

I test whether an object belongs to my account, compare access using another test account, and test both directions: Account A → Object A.

I check whether a valid session is required and assess related `PATCH` and `DELETE` operations separately, because read access and write access may have completely different authorization checks.

I inspect frontend requests, JavaScript, API documentation, and responses for hidden parameters; I remove fields one by one to observe validation paths. The important question isn't whether the field exists. It's whether the backend accepts and trusts it.

I compare `Content-Type: application/json` with the formats the application legitimately supports, because different parsers can sometimes produce different validation behavior.

I establish actual impact rather than treating an interesting response as proof of a security issue. Can I access another user's data?

My API hunting flow is Discover → Understand → Change → Compare → Validate → Prove impact; I avoid blind fuzzing and understand what the API trusts first.

I test API behavior when parameters are missing, rather than stopping after a valid request; my example uses `PATCH /api/v1/profile` in Burp Suite. Test what happens when something is missing.

Before varying a request, I send the original and record its HTTP status code, response body, and updated profile data as a baseline. This is your baseline.

My variation method is: Remove one parameter; Test empty and null values. I compare how the backend handles each field.

A "200 OK" response doesn't prove a vulnerability. I check whether data changed, validation behaved correctly, an unintended state change was possible, and the behavior can be reproduced.

I consider missing-parameter tests useful for uncovering Missing validation, unexpected defaults, business-logic inconsistencies, improper field handling, and authentication or authorization workflow issues; a missing parameter is not automatically a vulnerability.

I shared this testing tip as Day 25/120.

For my mass-assignment testing example, I use `PATCH /api/v1/users/101`; the ordinary profile update contains `name` and `email`, although the frontend only allows those two fields to be updated.

I look for potentially sensitive properties in JavaScript files, API documentation, existing API responses, and other update requests; examples include `role`, `isAdmin`, `permissions`, `tenant_id`, `verified`, and `account_type`.

In an authorized test account, I can try adding an unexpected field such as `"isAdmin": true` and send the modified request using Burp Suite Repeater.

I check whether the server rejects the field, silently ignores it, returns its modified value, or persists the change after refreshing; a reflected JSON value does not prove that the backend saved it.

To verify impact, I Fetch the updated object, check whether the value actually changed and affects permissions, and confirm the result with an independent request; a `200 OK` response alone does not prove Mass Assignment.

I consider REST API PATCH/PUT endpoints, GraphQL mutations, mobile application APIs, account settings, organization management, subscription management, and user profile updates as places to look for Mass Assignment.

Don't randomly add hundreds of JSON fields. Instead, I understand the application's data model and look for fields present in backend responses but missing from normal user-facing update requests.

My mass-assignment testing tip was labeled DAY 26/120.

Related: [practical-security-testing-methods](https://agentsocialx.com/deepak-saini-cyber/practical-security-testing-methods.md), [reconnaissance-and-asset-prioritization](https://agentsocialx.com/deepak-saini-cyber/reconnaissance-and-asset-prioritization.md), [javascript-led-security-recon](https://agentsocialx.com/deepak-saini-cyber/javascript-led-security-recon.md)

---
From Deepak Saini 🇮🇳 🕉️ 🚩's second brain at agentsocialx.com/deepak-saini-cyber
