[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ETA94EJGD8MXSNA6NXMMP9":3,"skill-same:01M6ETA94EJGD8MXSNA6NXMMP9":106},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":67,"commitSha":68,"skillDirectory":69,"forksCount":14,"repositoryHtmlUrl":70,"repositoryHomepageUrl":71,"ownerHtmlUrl":72,"ownerBlogUrl":6,"ownerDescription":73,"updatedAt":74,"install":75,"resources":88},"01M6ETA94EJGD8MXSNA6NXMMP9","detecting-broken-object-property-level-authorization",null,"Detect and test for OWASP API3:2023 Broken Object Property Level Authorization vulnerabilities including excessive data exposure and mass assignment attacks.","henriquescastilho\u002Fmy-claude","henriquescastilho","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F153296945?v=4","01M6ESH7EXPXTH9CVQ4K16SRG8","Henrique Scheer","01M6ESH7JHEK2PTNNH4HEH787Z",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetecting-broken-object-property-level-authorization\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"broken","authorization","detecting broken object property level authorization","property-level-authorization","penetration","id","cm","PS","api","data-exposure","api-testing","testing","excessive-data-exposure","mass-assignment","owasp-api3","bopla","api-security","pr","test","cybersecurity","2026-11-10 10:12:30",false,"---\nname: detecting-broken-object-property-level-authorization\ndescription: Detect and test for OWASP API3:2023 Broken Object Property Level Authorization\n  vulnerabilities including excessive data exposure and mass assignment attacks.\ndomain: cybersecurity\nsubdomain: api-security\ntags:\n- api-security\n- bopla\n- owasp-api3\n- mass-assignment\n- excessive-data-exposure\n- property-level-authorization\n- api-testing\n- penetration-testing\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1213\n- T1212\n---\n\n# Detecting Broken Object Property Level Authorization\n\n## Overview\n\nBroken Object Property Level Authorization (BOPLA), classified as API3:2023 in the OWASP API Security Top 10, combines two related vulnerability classes: Excessive Data Exposure (API returning more data than needed) and Mass Assignment (API accepting more data than intended). Even when APIs enforce object-level authorization correctly, they may fail to control which specific properties of an object a user can read or modify. Attackers exploit this by reading sensitive properties from API responses or injecting additional properties into request bodies to modify fields they should not have access to.\n\n\n## When to Use\n\n- When investigating security incidents that require detecting broken object property level authorization\n- When building detection rules or threat hunting queries for this domain\n- When SOC analysts need structured procedures for this analysis type\n- When validating security monitoring coverage for related attack techniques\n\n## Prerequisites\n\n- Target API with endpoints that return or accept object data\n- API documentation or schema (OpenAPI spec preferred)\n- Burp Suite or Postman for API request manipulation\n- Multiple user accounts with different privilege levels\n- Python 3.8+ with requests library for automated testing\n- Authorization to perform security testing\n\n## Vulnerability Patterns\n\n### Excessive Data Exposure\n\nThe API returns object properties the client does not need:\n\n```json\n\u002F\u002F GET \u002Fapi\u002Fv1\u002Fusers\u002F123\n\u002F\u002F Response includes sensitive fields the UI doesn't display:\n{\n  \"id\": 123,\n  \"username\": \"john_doe\",\n  \"email\": \"john@example.com\",\n  \"name\": \"John Doe\",\n  \"ssn\": \"123-45-6789\",           \u002F\u002F Sensitive - not needed by UI\n  \"salary\": 95000,                 \u002F\u002F Sensitive - not needed by UI\n  \"internal_notes\": \"VIP client\",  \u002F\u002F Internal - should not be exposed\n  \"password_hash\": \"$2b$12...\",    \u002F\u002F Critical - never expose\n  \"role\": \"admin\",                 \u002F\u002F May enable privilege discovery\n  \"created_by\": \"system_admin\",   \u002F\u002F Internal metadata\n  \"credit_card_last4\": \"4242\"     \u002F\u002F PCI compliance violation\n}\n```\n\n### Mass Assignment\n\nThe API binds client-supplied data to internal object properties without filtering:\n\n```http\n\u002F\u002F Normal user update request\nPUT \u002Fapi\u002Fv1\u002Fusers\u002F123\nContent-Type: application\u002Fjson\n\n{\n  \"name\": \"John Updated\",\n  \"email\": \"new@example.com\",\n  \"role\": \"admin\",           \u002F\u002F Attacker-injected: privilege escalation\n  \"is_verified\": true,       \u002F\u002F Attacker-injected: bypass verification\n  \"discount_rate\": 100,      \u002F\u002F Attacker-injected: business logic abuse\n  \"account_balance\": 999999  \u002F\u002F Attacker-injected: financial fraud\n}\n```\n\n## Testing Methodology\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"BOPLA Vulnerability Scanner\n\nTests APIs for Broken Object Property Level Authorization\nincluding Excessive Data Exposure and Mass Assignment.\n\"\"\"\n\nimport requests\nimport json\nimport sys\nfrom typing import Dict, List, Optional, Set\nfrom dataclasses import dataclass, field\nfrom copy import deepcopy\n\n@dataclass\nclass BOPLAFinding:\n    endpoint: str\n    method: str\n    vulnerability_type: str  # \"excessive_exposure\" or \"mass_assignment\"\n    severity: str\n    property_name: str\n    details: str\n\nclass BOPLAScanner:\n    SENSITIVE_PROPERTY_PATTERNS = {\n        \"critical\": [\n            \"password\", \"password_hash\", \"secret\", \"token\", \"api_key\",\n            \"private_key\", \"secret_key\", \"access_token\", \"refresh_token\",\n        ],\n        \"high\": [\n            \"ssn\", \"social_security\", \"tax_id\", \"credit_card\", \"card_number\",\n            \"cvv\", \"bank_account\", \"routing_number\",\n        ],\n        \"medium\": [\n            \"salary\", \"income\", \"internal_notes\", \"admin_notes\",\n            \"created_by\", \"modified_by\", \"ip_address\", \"session_id\",\n            \"role\", \"permissions\", \"is_admin\", \"is_superuser\", \"privilege\",\n        ],\n        \"low\": [\n            \"phone\", \"address\", \"date_of_birth\", \"dob\", \"age\",\n            \"gender\", \"ethnicity\", \"religion\",\n        ]\n    }\n\n    MASS_ASSIGNMENT_FIELDS = [\n        (\"role\", \"admin\"),\n        (\"is_admin\", True),\n        (\"is_verified\", True),\n        (\"is_active\", True),\n        (\"email_verified\", True),\n        (\"account_type\", \"premium\"),\n        (\"discount_rate\", 100),\n        (\"credit_limit\", 999999),\n        (\"permissions\", [\"admin\", \"write\", \"delete\"]),\n        (\"account_balance\", 999999),\n        (\"subscription_tier\", \"enterprise\"),\n        (\"rate_limit\", 999999),\n    ]\n\n    def __init__(self, base_url: str, auth_headers: Dict[str, str]):\n        self.base_url = base_url.rstrip('\u002F')\n        self.auth_headers = auth_headers\n        self.findings: List[BOPLAFinding] = []\n\n    def test_excessive_data_exposure(self, endpoint: str,\n                                      expected_fields: Set[str]) -> List[BOPLAFinding]:\n        \"\"\"Test if API response contains more fields than expected.\"\"\"\n        findings = []\n        url = f\"{self.base_url}{endpoint}\"\n\n        try:\n            response = requests.get(url, headers=self.auth_headers, timeout=10)\n            if response.status_code != 200:\n                return findings\n\n            data = response.json()\n\n            # Handle both single object and list responses\n            objects = data if isinstance(data, list) else [data]\n            if isinstance(data, dict) and \"data\" in data:\n                objects = data[\"data\"] if isinstance(data[\"data\"], list) else [data[\"data\"]]\n\n            for obj in objects[:5]:  # Check first 5 objects\n                if not isinstance(obj, dict):\n                    continue\n\n                response_fields = set(self._flatten_keys(obj))\n                unexpected_fields = response_fields - expected_fields\n\n                for field_name in unexpected_fields:\n                    severity = self._classify_sensitivity(field_name)\n                    if severity:\n                        finding = BOPLAFinding(\n                            endpoint=endpoint,\n                            method=\"GET\",\n                            vulnerability_type=\"excessive_exposure\",\n                            severity=severity,\n                            property_name=field_name,\n                            details=f\"Unexpected sensitive field '{field_name}' in response\"\n                        )\n                        findings.append(finding)\n                        self.findings.append(finding)\n\n        except (requests.exceptions.RequestException, json.JSONDecodeError):\n            pass\n\n        return findings\n\n    def test_mass_assignment(self, endpoint: str, method: str = \"PUT\",\n                              original_data: Optional[dict] = None) -> List[BOPLAFinding]:\n        \"\"\"Test if API accepts and processes additional injected properties.\"\"\"\n        findings = []\n        url = f\"{self.base_url}{endpoint}\"\n\n        # First, get the current object state\n        if original_data is None:\n            try:\n                response = requests.get(url, headers=self.auth_headers, timeout=10)\n                if response.status_code == 200:\n                    original_data = response.json()\n                else:\n                    original_data = {}\n            except (requests.exceptions.RequestException, json.JSONDecodeError):\n                original_data = {}\n\n        # Test each mass assignment field\n        for field_name, injected_value in self.MASS_ASSIGNMENT_FIELDS:\n            if field_name in original_data:\n                # Field exists - test if we can modify it\n                original_value = original_data[field_name]\n                if original_value == injected_value:\n                    continue  # Already has this value\n\n            test_data = deepcopy(original_data)\n            test_data[field_name] = injected_value\n\n            headers = {**self.auth_headers, \"Content-Type\": \"application\u002Fjson\"}\n\n            try:\n                if method == \"PUT\":\n                    response = requests.put(url, json=test_data,\n                                          headers=headers, timeout=10)\n                elif method == \"PATCH\":\n                    response = requests.patch(url, json={field_name: injected_value},\n                                            headers=headers, timeout=10)\n                elif method == \"POST\":\n                    response = requests.post(url, json=test_data,\n                                           headers=headers, timeout=10)\n\n                if response.status_code in (200, 201, 204):\n                    # Verify the field was actually modified\n                    verify_response = requests.get(url, headers=self.auth_headers, timeout=10)\n                    if verify_response.status_code == 200:\n                        updated_data = verify_response.json()\n                        if updated_data.get(field_name) == injected_value:\n                            finding = BOPLAFinding(\n                                endpoint=endpoint,\n                                method=method,\n                                vulnerability_type=\"mass_assignment\",\n                                severity=\"CRITICAL\" if field_name in [\"role\", \"is_admin\", \"permissions\"]\n                                         else \"HIGH\",\n                                property_name=field_name,\n                                details=f\"Successfully injected '{field_name}={injected_value}'\"\n                            )\n                            findings.append(finding)\n                            self.findings.append(finding)\n\n                            # Restore original value if possible\n                            if field_name in original_data:\n                                restore_data = {field_name: original_data[field_name]}\n                                requests.patch(url, json=restore_data,\n                                             headers=headers, timeout=10)\n\n            except requests.exceptions.RequestException:\n                continue\n\n        return findings\n\n    def test_graphql_property_exposure(self, graphql_endpoint: str,\n                                        query: str) -> List[BOPLAFinding]:\n        \"\"\"Test GraphQL APIs for property-level authorization issues.\"\"\"\n        findings = []\n        url = f\"{self.base_url}{graphql_endpoint}\"\n\n        # Introspection query to discover available fields\n        introspection = \"\"\"\n        {\n          __schema {\n            types {\n              name\n              fields {\n                name\n                type { name kind }\n              }\n            }\n          }\n        }\n        \"\"\"\n\n        try:\n            response = requests.post(\n                url,\n                json={\"query\": introspection},\n                headers=self.auth_headers,\n                timeout=10\n            )\n\n            if response.status_code == 200:\n                data = response.json()\n                if \"errors\" not in data:\n                    finding = BOPLAFinding(\n                        endpoint=graphql_endpoint,\n                        method=\"POST\",\n                        vulnerability_type=\"excessive_exposure\",\n                        severity=\"MEDIUM\",\n                        property_name=\"__schema\",\n                        details=\"GraphQL introspection enabled - full schema exposed\"\n                    )\n                    findings.append(finding)\n                    self.findings.append(finding)\n\n        except requests.exceptions.RequestException:\n            pass\n\n        return findings\n\n    def _flatten_keys(self, obj: dict, prefix: str = \"\") -> List[str]:\n        \"\"\"Recursively flatten nested dictionary keys.\"\"\"\n        keys = []\n        for key, value in obj.items():\n            full_key = f\"{prefix}.{key}\" if prefix else key\n            keys.append(full_key)\n            if isinstance(value, dict):\n                keys.extend(self._flatten_keys(value, full_key))\n        return keys\n\n    def _classify_sensitivity(self, field_name: str) -> Optional[str]:\n        \"\"\"Classify the sensitivity level of a field name.\"\"\"\n        lower_name = field_name.lower().split('.')[-1]\n        for severity, patterns in self.SENSITIVE_PROPERTY_PATTERNS.items():\n            for pattern in patterns:\n                if pattern in lower_name:\n                    return severity.upper()\n        return None\n\n    def generate_report(self) -> dict:\n        return {\n            \"total_findings\": len(self.findings),\n            \"by_type\": {\n                \"excessive_exposure\": len([f for f in self.findings\n                                          if f.vulnerability_type == \"excessive_exposure\"]),\n                \"mass_assignment\": len([f for f in self.findings\n                                       if f.vulnerability_type == \"mass_assignment\"]),\n            },\n            \"by_severity\": {\n                \"CRITICAL\": len([f for f in self.findings if f.severity == \"CRITICAL\"]),\n                \"HIGH\": len([f for f in self.findings if f.severity == \"HIGH\"]),\n                \"MEDIUM\": len([f for f in self.findings if f.severity == \"MEDIUM\"]),\n                \"LOW\": len([f for f in self.findings if f.severity == \"LOW\"]),\n            },\n            \"findings\": [\n                {\n                    \"endpoint\": f.endpoint,\n                    \"method\": f.method,\n                    \"type\": f.vulnerability_type,\n                    \"severity\": f.severity,\n                    \"property\": f.property_name,\n                    \"details\": f.details,\n                }\n                for f in self.findings\n            ]\n        }\n```\n\n## Mitigation\n\n```python\n# Server-side: Explicit property allowlists\nclass UserSerializer:\n    # Only expose these fields - never use to_json() or to_dict()\n    PUBLIC_FIELDS = ['id', 'username', 'name', 'avatar_url']\n    OWNER_FIELDS = PUBLIC_FIELDS + ['email', 'phone', 'preferences']\n    ADMIN_FIELDS = OWNER_FIELDS + ['role', 'created_at', 'last_login']\n\n    def serialize(self, user, requesting_user):\n        if requesting_user.is_admin:\n            fields = self.ADMIN_FIELDS\n        elif requesting_user.id == user.id:\n            fields = self.OWNER_FIELDS\n        else:\n            fields = self.PUBLIC_FIELDS\n\n        return {field: getattr(user, field) for field in fields}\n\n# Mass assignment protection - explicit allowlist for writable fields\nWRITABLE_FIELDS = {'name', 'email', 'phone', 'avatar_url', 'preferences'}\n\ndef update_user(user_id, request_data, requesting_user):\n    # Filter out any fields not in the allowlist\n    safe_data = {k: v for k, v in request_data.items() if k in WRITABLE_FIELDS}\n    # Apply updates only with safe data\n    User.objects.filter(id=user_id).update(**safe_data)\n```\n\n## References\n\n- OWASP API3:2023: https:\u002F\u002Fowasp.org\u002FAPI-Security\u002Feditions\u002F2023\u002Fen\u002F0xa3-broken-object-property-level-authorization\u002F\n- Salt Security BOPLA Analysis: https:\u002F\u002Fsalt.security\u002Fblog\u002Fapi3-2023-broken-object-property-level-authorization\n- Wallarm BOPLA Guide: https:\u002F\u002Flab.wallarm.com\u002Fapi32023-broken-object-property-level-authorization\u002F\n- API Security News BOPLA: https:\u002F\u002Fapisecurity.io\u002Fowasp-api-security-top-10\u002Fapi3-2023-broken-object-property-level-authorization\u002F\n- CloudDefense BOPLA: https:\u002F\u002Fwww.clouddefense.ai\u002Fowasp\u002F2023\u002F3\n","# Detecting Broken Object Property Level Authorization\n\n## Overview\n\nBroken Object Property Level Authorization (BOPLA), classified as API3:2023 in the OWASP API Security Top 10, combines two related vulnerability classes: Excessive Data Exposure (API returning more data than needed) and Mass Assignment (API accepting more data than intended). Even when APIs enforce object-level authorization correctly, they may fail to control which specific properties of an object a user can read or modify. Attackers exploit this by reading sensitive properties from API responses or injecting additional properties into request bodies to modify fields they should not have access to.\n\n\n## When to Use\n\n- When investigating security incidents that require detecting broken object property level authorization\n- When building detection rules or threat hunting queries for this domain\n- When SOC analysts need structured procedures for this analysis type\n- When validating security monitoring coverage for related attack techniques\n\n## Prerequisites\n\n- Target API with endpoints that return or accept object data\n- API documentation or schema (OpenAPI spec preferred)\n- Burp Suite or Postman for API request manipulation\n- Multiple user accounts with different privilege levels\n- Python 3.8+ with requests library for automated testing\n- Authorization to perform security testing\n\n## Vulnerability Patterns\n\n### Excessive Data Exposure\n\nThe API returns object properties the client does not need:\n\n```json\n\u002F\u002F GET \u002Fapi\u002Fv1\u002Fusers\u002F123\n\u002F\u002F Response includes sensitive fields the UI doesn't display:\n{\n  \"id\": 123,\n  \"username\": \"john_doe\",\n  \"email\": \"john@example.com\",\n  \"name\": \"John Doe\",\n  \"ssn\": \"123-45-6789\",           \u002F\u002F Sensitive - not needed by UI\n  \"salary\": 95000,                 \u002F\u002F Sensitive - not needed by UI\n  \"internal_notes\": \"VIP client\",  \u002F\u002F Internal - should not be exposed\n  \"password_hash\": \"$2b$12...\",    \u002F\u002F Critical - never expose\n  \"role\": \"admin\",                 \u002F\u002F May enable privilege discovery\n  \"created_by\": \"system_admin\",   \u002F\u002F Internal metadata\n  \"credit_card_last4\": \"4242\"     \u002F\u002F PCI compliance violation\n}\n```\n\n### Mass Assignment\n\nThe API binds client-supplied data to internal object properties without filtering:\n\n```http\n\u002F\u002F Normal user update request\nPUT \u002Fapi\u002Fv1\u002Fusers\u002F123\nContent-Type: application\u002Fjson\n\n{\n  \"name\": \"John Updated\",\n  \"email\": \"new@example.com\",\n  \"role\": \"admin\",           \u002F\u002F Attacker-injected: privilege escalation\n  \"is_verified\": true,       \u002F\u002F Attacker-injected: bypass verification\n  \"discount_rate\": 100,      \u002F\u002F Attacker-injected: business logic abuse\n  \"account_balance\": 999999  \u002F\u002F Attacker-injected: financial fraud\n}\n```\n\n## Testing Methodology\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"BOPLA Vulnerability Scanner\n\nTests APIs for Broken Object Property Level Authorization\nincluding Excessive Data Exposure and Mass Assignment.\n\"\"\"\n\nimport requests\nimport json\nimport sys\nfrom typing import Dict, List, Optional, Set\nfrom dataclasses import dataclass, field\nfrom copy import deepcopy\n\n@dataclass\nclass BOPLAFinding:\n    endpoint: str\n    method: str\n    vulnerability_type: str  # \"excessive_exposure\" or \"mass_assignment\"\n    severity: str\n    property_name: str\n    details: str\n\nclass BOPLAScanner:\n    SENSITIVE_PROPERTY_PATTERNS = {\n        \"critical\": [\n            \"password\", \"password_hash\", \"secret\", \"token\", \"api_key\",\n            \"private_key\", \"secret_key\", \"access_token\", \"refresh_token\",\n        ],\n        \"high\": [\n            \"ssn\", \"social_security\", \"tax_id\", \"credit_card\", \"card_number\",\n            \"cvv\", \"bank_account\", \"routing_number\",\n        ],\n        \"medium\": [\n            \"salary\", \"income\", \"internal_notes\", \"admin_notes\",\n            \"created_by\", \"modified_by\", \"ip_address\", \"session_id\",\n            \"role\", \"permissions\", \"is_admin\", \"is_superuser\", \"privilege\",\n        ],\n        \"low\": [\n            \"phone\", \"address\", \"date_of_birth\", \"dob\", \"age\",\n            \"gender\", \"ethnicity\", \"religion\",\n        ]\n    }\n\n    MASS_ASSIGNMENT_FIELDS = [\n        (\"role\", \"admin\"),\n        (\"is_admin\", True),\n        (\"is_verified\", True),\n        (\"is_active\", True),\n        (\"email_verified\", True),\n        (\"account_type\", \"premium\"),\n        (\"discount_rate\", 100),\n        (\"credit_limit\", 999999),\n        (\"permissions\", [\"admin\", \"write\", \"delete\"]),\n        (\"account_balance\", 999999),\n        (\"subscription_tier\", \"enterprise\"),\n        (\"rate_limit\", 999999),\n    ]\n\n    def __init__(self, base_url: str, auth_headers: Dict[str, str]):\n        self.base_url = base_url.rstrip('\u002F')\n        self.auth_headers = auth_headers\n        self.findings: List[BOPLAFinding] = []\n\n    def test_excessive_data_exposure(self, endpoint: str,\n                                      expected_fields: Set[str]) -> List[BOPLAFinding]:\n        \"\"\"Test if API response contains more fields than expected.\"\"\"\n        findings = []\n        url = f\"{self.base_url}{endpoint}\"\n\n        try:\n            response = requests.get(url, headers=self.auth_headers, timeout=10)\n            if response.status_code != 200:\n                return findings\n\n            data = response.json()\n\n            # Handle both single object and list responses\n            objects = data if isinstance(data, list) else [data]\n            if isinstance(data, dict) and \"data\" in data:\n                objects = data[\"data\"] if isinstance(data[\"data\"], list) else [data[\"data\"]]\n\n            for obj in objects[:5]:  # Check first 5 objects\n                if not isinstance(obj, dict):\n                    continue\n\n                response_fields = set(self._flatten_keys(obj))\n                unexpected_fields = response_fields - expected_fields\n\n                for field_name in unexpected_fields:\n                    severity = self._classify_sensitivity(field_name)\n                    if severity:\n                        finding = BOPLAFinding(\n                            endpoint=endpoint,\n                            method=\"GET\",\n                            vulnerability_type=\"excessive_exposure\",\n                            severity=severity,\n                            property_name=field_name,\n                            details=f\"Unexpected sensitive field '{field_name}' in response\"\n                        )\n                        findings.append(finding)\n                        self.findings.append(finding)\n\n        except (requests.exceptions.RequestException, json.JSONDecodeError):\n            pass\n\n        return findings\n\n    def test_mass_assignment(self, endpoint: str, method: str = \"PUT\",\n                              original_data: Optional[dict] = None) -> List[BOPLAFinding]:\n        \"\"\"Test if API accepts and processes additional injected properties.\"\"\"\n        findings = []\n        url = f\"{self.base_url}{endpoint}\"\n\n        # First, get the current object state\n        if original_data is None:\n            try:\n                response = requests.get(url, headers=self.auth_headers, timeout=10)\n                if response.status_code == 200:\n                    original_data = response.json()\n                else:\n                    original_data = {}\n            except (requests.exceptions.RequestException, json.JSONDecodeError):\n                original_data = {}\n\n        # Test each mass assignment field\n        for field_name, injected_value in self.MASS_ASSIGNMENT_FIELDS:\n            if field_name in original_data:\n                # Field exists - test if we can modify it\n                original_value = original_data[field_name]\n                if original_value == injected_value:\n                    continue  # Already has this value\n\n            test_data = deepcopy(original_data)\n            test_data[field_name] = injected_value\n\n            headers = {**self.auth_headers, \"Content-Type\": \"application\u002Fjson\"}\n\n            try:\n                if method == \"PUT\":\n                    response = requests.put(url, json=test_data,\n                                          headers=headers, timeout=10)\n                elif method == \"PATCH\":\n                    response = requests.patch(url, json={field_name: injected_value},\n                                            headers=headers, timeout=10)\n                elif method == \"POST\":\n                    response = requests.post(url, json=test_data,\n                                           headers=headers, timeout=10)\n\n                if response.status_code in (200, 201, 204):\n                    # Verify the field was actually modified\n                    verify_response = requests.get(url, headers=self.auth_headers, timeout=10)\n                    if verify_response.status_code == 200:\n                        updated_data = verify_response.json()\n                        if updated_data.get(field_name) == injected_value:\n                            finding = BOPLAFinding(\n                                endpoint=endpoint,\n                                method=method,\n                                vulnerability_type=\"mass_assignment\",\n                                severity=\"CRITICAL\" if field_name in [\"role\", \"is_admin\", \"permissions\"]\n                                         else \"HIGH\",\n                                property_name=field_name,\n                                details=f\"Successfully injected '{field_name}={injected_value}'\"\n                            )\n                            findings.append(finding)\n                            self.findings.append(finding)\n\n                            # Restore original value if possible\n                            if field_name in original_data:\n                                restore_data = {field_name: original_data[field_name]}\n                                requests.patch(url, json=restore_data,\n                                             headers=headers, timeout=10)\n\n            except requests.exceptions.RequestException:\n                continue\n\n        return findings\n\n    def test_graphql_property_exposure(self, graphql_endpoint: str,\n                                        query: str) -> List[BOPLAFinding]:\n        \"\"\"Test GraphQL APIs for property-level authorization issues.\"\"\"\n        findings = []\n        url = f\"{self.base_url}{graphql_endpoint}\"\n\n        # Introspection query to discover available fields\n        introspection = \"\"\"\n        {\n          __schema {\n            types {\n              name\n              fields {\n                name\n                type { name kind }\n              }\n            }\n          }\n        }\n        \"\"\"\n\n        try:\n            response = requests.post(\n                url,\n                json={\"query\": introspection},\n                headers=self.auth_headers,\n                timeout=10\n            )\n\n            if response.status_code == 200:\n                data = response.json()\n                if \"errors\" not in data:\n                    finding = BOPLAFinding(\n                        endpoint=graphql_endpoint,\n                        method=\"POST\",\n                        vulnerability_type=\"excessive_exposure\",\n                        severity=\"MEDIUM\",\n                        property_name=\"__schema\",\n                        details=\"GraphQL introspection enabled - full schema exposed\"\n                    )\n                    findings.append(finding)\n                    self.findings.append(finding)\n\n        except requests.exceptions.RequestException:\n            pass\n\n        return findings\n\n    def _flatten_keys(self, obj: dict, prefix: str = \"\") -> List[str]:\n        \"\"\"Recursively flatten nested dictionary keys.\"\"\"\n        keys = []\n        for key, value in obj.items():\n            full_key = f\"{prefix}.{key}\" if prefix else key\n            keys.append(full_key)\n            if isinstance(value, dict):\n                keys.extend(self._flatten_keys(value, full_key))\n        return keys\n\n    def _classify_sensitivity(self, field_name: str) -> Optional[str]:\n        \"\"\"Classify the sensitivity level of a field name.\"\"\"\n        lower_name = field_name.lower().split('.')[-1]\n        for severity, patterns in self.SENSITIVE_PROPERTY_PATTERNS.items():\n            for pattern in patterns:\n                if pattern in lower_name:\n                    return severity.upper()\n        return None\n\n    def generate_report(self) -> dict:\n        return {\n            \"total_findings\": len(self.findings),\n            \"by_type\": {\n                \"excessive_exposure\": len([f for f in self.findings\n                                          if f.vulnerability_type == \"excessive_exposure\"]),\n                \"mass_assignment\": len([f for f in self.findings\n                                       if f.vulnerability_type == \"mass_assignment\"]),\n            },\n            \"by_severity\": {\n                \"CRITICAL\": len([f for f in self.findings if f.severity == \"CRITICAL\"]),\n                \"HIGH\": len([f for f in self.findings if f.severity == \"HIGH\"]),\n                \"MEDIUM\": len([f for f in self.findings if f.severity == \"MEDIUM\"]),\n                \"LOW\": len([f for f in self.findings if f.severity == \"LOW\"]),\n            },\n            \"findings\": [\n                {\n                    \"endpoint\": f.endpoint,\n                    \"method\": f.method,\n                    \"type\": f.vulnerability_type,\n                    \"severity\": f.severity,\n                    \"property\": f.property_name,\n                    \"details\": f.details,\n                }\n                for f in self.findings\n            ]\n        }\n```\n\n## Mitigation\n\n```python\n# Server-side: Explicit property allowlists\nclass UserSerializer:\n    # Only expose these fields - never use to_json() or to_dict()\n    PUBLIC_FIELDS = ['id', 'username', 'name', 'avatar_url']\n    OWNER_FIELDS = PUBLIC_FIELDS + ['email', 'phone', 'preferences']\n    ADMIN_FIELDS = OWNER_FIELDS + ['role', 'created_at', 'last_login']\n\n    def serialize(self, user, requesting_user):\n        if requesting_user.is_admin:\n            fields = self.ADMIN_FIELDS\n        elif requesting_user.id == user.id:\n            fields = self.OWNER_FIELDS\n        else:\n            fields = self.PUBLIC_FIELDS\n\n        return {field: getattr(user, field) for field in fields}\n\n# Mass assignment protection - explicit allowlist for writable fields\nWRITABLE_FIELDS = {'name', 'email', 'phone', 'avatar_url', 'preferences'}\n\ndef update_user(user_id, request_data, requesting_user):\n    # Filter out any fields not in the allowlist\n    safe_data = {k: v for k, v in request_data.items() if k in WRITABLE_FIELDS}\n    # Apply updates only with safe data\n    User.objects.filter(id=user_id).update(**safe_data)\n```\n\n## References\n\n- OWASP API3:2023: https:\u002F\u002Fowasp.org\u002FAPI-Security\u002Feditions\u002F2023\u002Fen\u002F0xa3-broken-object-property-level-authorization\u002F\n- Salt Security BOPLA Analysis: https:\u002F\u002Fsalt.security\u002Fblog\u002Fapi3-2023-broken-object-property-level-authorization\n- Wallarm BOPLA Guide: https:\u002F\u002Flab.wallarm.com\u002Fapi32023-broken-object-property-level-authorization\u002F\n- API Security News BOPLA: https:\u002F\u002Fapisecurity.io\u002Fowasp-api-security-top-10\u002Fapi3-2023-broken-object-property-level-authorization\u002F\n- CloudDefense BOPLA: https:\u002F\u002Fwww.clouddefense.ai\u002Fowasp\u002F2023\u002F3\n",{"name":5,"tags":54,"author":56,"domain":48,"license":15,"version":57,"nist_csf":58,"subdomain":45,"description":7,"mitre_attack":63},[45,44,43,42,41,32,39,55],"penetration-testing","mahipal","1.0",[59,60,61,62],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01",[64,65,66],"T1190","T1213","T1212","main","7925716f065257435fdb12e97f7e52842147d5ad",".claude\u002Fskills\u002Fdetecting-broken-object-property-level-authorization","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude","https:\u002F\u002Fclaude.com\u002Fclaude-code","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho","Software · Applied AI · Quantitative Modeling · Building with Claude.","2026-06-10 12:24:46",{"source":8,"skillName":5,"commands":76,"prompt":86,"zipAvailable":87},[77,80,83],{"tool":78,"command":79},"npx","npx skills add henriquescastilho\u002Fmy-claude --skill detecting-broken-object-property-level-authorization",{"tool":81,"command":82},"bunx","bunx skills add henriquescastilho\u002Fmy-claude --skill detecting-broken-object-property-level-authorization",{"tool":84,"command":85},"pnpm","pnpm dlx skills add henriquescastilho\u002Fmy-claude --skill detecting-broken-object-property-level-authorization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetecting-broken-object-property-level-authorization\u002FSKILL.md",true,[89,94,100],{"path":90,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetecting-broken-object-property-level-authorization\u002FLICENSE",{"path":95,"resourceType":96,"resourceTypeDesc":97,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fapi-reference.md","REFERENCE","参考文档",2174,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetecting-broken-object-property-level-authorization\u002Freferences\u002Fapi-reference.md",{"path":101,"resourceType":102,"resourceTypeDesc":103,"sizeBytes":104,"sourceHtmlUrl":105},"scripts\u002Fagent.py","SCRIPT","脚本",6557,"https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fdetecting-broken-object-property-level-authorization\u002Fscripts\u002Fagent.py",[107,146,155,164,186,214],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":126,"publishedAt":49},"01M6F0B6XPQ65AX2X0DWK8KT3E","markitdown","Convert files and office documents to Markdown. Supports PDF, DOCX, PPTX, XLSX, images (with OCR), audio (with transcription), HTML, CSV, JSON, XML, ZIP, YouTube URLs, EPubs and more.","MIT","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[114,117,120,123],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000002","文档处理",{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000003","演示文稿",{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000004","电子表格",{"categoryNo":124,"categoryName":125,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000034","行政与办公人员",[109,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145],"docx","PDF","pptx","xlsx","documents","csv","ocr","Audio","Bash","markdown","convert","read","write","edit","html","images","files","youtube","with",{"skillNo":147,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":154,"publishedAt":49},"01M6F06SBHR9F0SDWE282Y8075","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002Fscientific_writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[150,151,152,153],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":26,"taxonomyTypeDesc":27},[109,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145],{"skillNo":156,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":163,"publishedAt":49},"01M6F02D4R14EJAPBWVDF9J9VQ","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-writer\u002F.claude\u002Fskills\u002Fmarkitdown\u002FSKILL.md",[159,160,161,162],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":118,"categoryName":119,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":121,"categoryName":122,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":124,"categoryName":125,"taxonomyType":26,"taxonomyTypeDesc":27},[109,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145],{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":49},"01M6F000KS6YB4MKS774G4R8ND","zarr-python","Chunked N-D arrays for cloud storage. Compressed arrays, parallel I\u002FO, S3\u002FGCS integration, NumPy\u002FDask\u002FXarray compatible, for large-scale scientific computing pipelines.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fzarr-python\u002FSKILL.md",[],[171,172,173,174,175,176,177,178,179,180,181,182,183,184,185],"python","zarr python","storage","integration","s3","gcs","cloud","dask","parallel","pipelines","arrays","numpy","scientific computing","scale","scientific",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":195,"publishedAt":49},"01M6EZZJWFXM1GR78KTW6J0DN8","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fwhat-if-oracle\u002FSKILL.md",[192],{"categoryNo":193,"categoryName":194,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[196,197,198,199,200,201,202,203,204,205,206,138,139,207,208,209,210,211,212,213],"oracle","what if oracle","go","run","ux","futures","analysis","explore","decision","branch","question","idea","exploration","options","stress-test","strategies","scenario","stress",{"skillNo":215,"name":216,"nameZh":6,"description":217,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":218,"categories":219,"keywords":230,"publishedAt":49},"01M6EZZCXAEB49RXGQCJX5E8GB","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Fhenriquescastilho\u002Fmy-claude\u002Fblob\u002Fmain\u002F.codex\u002Fvendor_imports\u002Fclaude\u002Fmarketplaces\u002Fclaude-scientific-skills\u002Fscientific-skills\u002Fvenue-templates\u002FSKILL.md",[220,223,226,227],{"categoryNo":221,"categoryName":222,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":224,"categoryName":225,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":193,"categoryName":194,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":228,"categoryName":229,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000036","内容创作者",[231,232,233,234,235,236,237,238,135,239,138,139,140,240,241,242,243,244,185,245],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","proposals","Academic","requirements","formatting","journal","chi"]