[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ETH278AYVMK513TPESHWED":3,"skill-same:01M6ETH278AYVMK513TPESHWED":96},{"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":57,"commitSha":58,"skillDirectory":59,"forksCount":60,"repositoryHtmlUrl":61,"repositoryHomepageUrl":6,"ownerHtmlUrl":62,"ownerBlogUrl":6,"ownerDescription":63,"updatedAt":64,"install":65,"resources":78},"01M6ETH278AYVMK513TPESHWED","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.","luokai0\u002Fai-agent-skills-by-luo-kai","luokai0","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F266954973?v=4","01M6E16VNT42JB8B3X3254QWJ7","luo kai","01M6E16VTFVP6S5XJF1V1MPV90",14,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\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],"detecting","broken","authorization","detecting broken object property level authorization","excessive-data-exposure","penetration","detect","api","data-exposure","api-testing","property-level-authorization","testing","mass-assignment","owasp-api3","bopla","penetration-testing","api-security","test","vulnerabilities","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 vulnerabilities including excessive data exposure and mass assignment attacks.\ndomain: cybersecurity\nsubdomain: api-security\ntags: [api-security, bopla, owasp-api3, mass-assignment, excessive-data-exposure, property-level-authorization, api-testing, penetration-testing]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\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":55,"domain":48,"license":15,"version":56,"subdomain":45,"description":7},[45,43,42,41,33,39,38,44],"mahipal","1.0","main","4d2fb89cdfb75f3f6fd3c6c5ec9ad90ea129eb3c","ai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-broken-object-property-level-authorization",2,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai","https:\u002F\u002Fgithub.com\u002Fluokai0","a solo builder.","2026-05-06 04:29:04",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":77},[67,70,73],{"tool":68,"command":69},"npx","npx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill detecting-broken-object-property-level-authorization",{"tool":71,"command":72},"bunx","bunx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill detecting-broken-object-property-level-authorization",{"tool":74,"command":75},"pnpm","pnpm dlx skills add luokai0\u002Fai-agent-skills-by-luo-kai --skill detecting-broken-object-property-level-authorization","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-broken-object-property-level-authorization\u002FSKILL.md",true,[79,84,90],{"path":80,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-broken-object-property-level-authorization\u002FLICENSE",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fapi-reference.md","REFERENCE","参考文档",2174,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-broken-object-property-level-authorization\u002Freferences\u002Fapi-reference.md",{"path":91,"resourceType":92,"resourceTypeDesc":93,"sizeBytes":94,"sourceHtmlUrl":95},"scripts\u002Fagent.py","SCRIPT","脚本",6557,"https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F21-external-registries\u002F08-pinkpixel-collection\u002Fdetecting-broken-object-property-level-authorization\u002Fscripts\u002Fagent.py",[97,125,142,170,203,233],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":49},"01M6F2SKTE208174C7S7JJCZC7","write-contracts","Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset integration, security patterns, and storage type guidance. Includes comprehensive storage decision framework for optimal data structure selection. Triggers on: 'write contract', 'create NFT collection', 'build marketplace', 'implement minting', 'generate Move module', 'create token contract', 'build DAO', 'implement staking'. Ask storage questions when: 'store', 'track', 'registry', 'mapping', 'list', 'collection'.","MIT","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fwrite-contracts\u002FSKILL.md",[],[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124],"write","contracts","write contracts","storage","secure","create","generate","collection","model","decision","ask","smart-contracts","selection","objects","structure","nft","token","aptos","critical","move",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":49},"01M6F2RFXJ6T9MKW0A7N7GM45B","web-search","通用网络搜索技能，支持多引擎搜索（百度、必应、DuckDuckGo），无需API密钥即可获取实时信息","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fweb-search-ex-skill\u002FSKILL.md",[],[132,133,134,135,136,137,138,139,140,141],"web","search","web search","搜索","baidu","bing","duckduckgo","百度","多引擎","internet",{"skillNo":143,"name":144,"nameZh":6,"description":145,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":146,"categories":147,"keywords":151,"publishedAt":49},"01M6F2K968G1FZEZFPW2E6B222","solo-build","Execute implementation plan tasks with TDD workflow, auto-commit, and phase gates. Use when user says \"build it\", \"start building\", \"execute plan\", \"implement tasks\", \"ship it\", or references a track ID. Do NOT use for planning (use \u002Fplan) or scaffolding (use \u002Fscaffold).","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fsolo-build\u002FSKILL.md",[148],{"categoryNo":149,"categoryName":150,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[152,153,154,155,156,157,158,159,133,160,161,162,105,163,164,165,166,167,168,169],"build","solo","solo build","MCP","workflow","commit","tasks","code","Bash","plan","read","auto","references","context7","query","scaffolding","ship it","project",{"skillNo":171,"name":172,"nameZh":6,"description":173,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":174,"categories":175,"keywords":182,"publishedAt":49},"01M6F2GKN39SGHSPWYB3662YC8","react-email","Use when building HTML email templates with React components, adding a visual email editor to an application using the React Email visual editor, rendering emails to HTML, or sending emails with Resend. Covers welcome emails, password resets, notifications, order confirmations, newsletters, transactional emails, and the embeddable email editor component.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Freact-email-skills\u002FSKILL.md",[176,179],{"categoryNo":177,"categoryName":178,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000005","邮件与沟通",{"categoryNo":180,"categoryName":181,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],"react","email","react email","github","editor","components","react components","component","welcome","https","notifications","password","node","use","html","resend","visual","emails","rendering","with",{"skillNo":204,"name":205,"nameZh":6,"description":206,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":207,"categories":208,"keywords":217,"publishedAt":49},"01M6F2FBVGVDFSG8SSFJGXA40C","APITester Agent-Driven API Testing","Test API endpoints and document responses. Define tests in plain English, run them, get formatted results. Agent-driven Postman alternative.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fopenclaw-api-tester\u002FSKILL.md",[209,210,213,214],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":211,"categoryName":212,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":149,"categoryName":150,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":215,"categoryName":216,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师",[40,36,218,219,220,46,221,222,223,224,225,226,227,228,229,230,231,232],"api testing","driven","APITester Agent Driven API Testing","run","postman","results","plain english","tester","endpoints","document","get","define","tests","english","api-tester",{"skillNo":234,"name":235,"nameZh":6,"description":236,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":101,"licenseFileUrl":6,"sourceHtmlUrl":237,"categories":238,"keywords":239,"publishedAt":49},"01M6F273Y3NGAPVJZ608BC0G9G","hubspot-implementation-plan","Generate a phased implementation plan from a HubSpot audit report. Creates prioritized, sequenced cleanup processes with effort estimates, dependencies, and automation feasibility. Use after running \u002Fhubspot-audit.","https:\u002F\u002Fgithub.com\u002Fluokai0\u002Fai-agent-skills-by-luo-kai\u002Fblob\u002Fmain\u002Fai-agent-skills\u002F22-clawhub-skills\u002Fhubspot-implementation-plan\u002FSKILL.md",[],[161,240,241,242,243,244,245,111,246,247,248,249,250,196,251,252,202,253],"implementation","hubspot","hubspot implementation plan","automation","feasibility","cleanup","planning","report","audit","audit report","phased implementation","dependencies","processes","hubspot audit"]