[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71GQX5RVCSHXFMBJ3CRCRAY":3,"skill-same:01M71GQX5RVCSHXFMBJ3CRCRAY":101},{"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":34,"publishedAt":55,"linkOnly":56,"markdownContent":57,"markdownBody":58,"frontMatter":59,"refName":74,"commitSha":75,"skillDirectory":76,"forksCount":14,"repositoryHtmlUrl":77,"repositoryHomepageUrl":6,"ownerHtmlUrl":78,"ownerBlogUrl":6,"ownerDescription":79,"updatedAt":80,"install":81,"resources":94},"01M71GQX5RVCSHXFMBJ3CRCRAY","api-postman-verify",null,"Uses Postman to perform structured API security testing by building collections that test for OWASP API Security Top 10 vulnerabilities including authentication bypass, authorization flaws, injection, and data exposure. The tester creates environments with multiple user roles, writes test scripts for automated security validation, and integrates Postman with OWASP ZAP and Newman for CI\u002FCD security testing. Activates for requests involving Postman security testing, API security collection, automated API testing, or OWASP API testing with Postman.","DCx7C5\u002Fai-marketplace","DCx7C5","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42419559?v=4","01M71C01G2AZV3NTNGWAWSHJPP","DC","01M71C01GQW6G50S2BYMS7PP3E",0,"MIT","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fweb-application\u002Fapi\u002Fpostman\u002Fverify\u002FSKILL.md",[18,23,26,29],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":30,"categoryName":31,"taxonomyType":32,"taxonomyTypeDesc":33},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],"api postman verify","api","verify","postman","read","scripts","de","top","exposure","newman","collection","Bash","cybersecurity","api-security","ci","testing","authentication","cm","automated-testing","security-validation","2026-11-10 10:12:30",false,"---\nname: api-postman-verify\ndescription: Uses Postman to perform structured API security testing by building collections that test for OWASP API Security Top 10 vulnerabilities including authentication bypass, authorization flaws, injection, and data exposure. The tester creates environments with multiple user roles, writes test scripts for automated security validation, and integrates Postman with OWASP ZAP and Newman for CI\u002FCD security testing. Activates for requests involving Postman security testing, API security collection, automated API testing, or OWASP API testing with Postman.\ndomain: cybersecurity\nsubdomain: api-security\ntags:\n- api-security\n- postman\n- owasp\n- automated-testing\n- security-validation\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmodel: sonnet\nmaxTurns: 20\ntools: [Read, Bash, Glob, Grep]\ncapec: []\n---\n\n# Performing API Security Testing with Postman\n\n## When to Use\n\n- Building repeatable API security test suites for OWASP API Security Top 10 coverage\n- Creating automated security regression tests that run in CI\u002FCD pipelines via Newman\n- Testing API authentication and authorization across multiple user roles systematically\n- Integrating Postman with OWASP ZAP proxy for combined manual and automated security testing\n- Establishing a baseline security test collection for new API endpoints before deployment\n\n**Do not use** against production APIs without authorization. Postman security testing involves sending potentially malicious payloads.\n\n## Prerequisites\n\n- Postman Desktop or web application with an active workspace\n- Target API with OpenAPI\u002FSwagger specification for collection import\n- Test accounts for at least three roles: unauthenticated, regular user, admin\n- Newman CLI installed for CI\u002FCD integration: `npm install -g newman`\n- OWASP ZAP configured as local proxy (localhost:8080) for Postman proxy integration\n- API environment variables for base URL, tokens, and test data\n\n## Workflow\n\n### Step 1: Environment and Collection Setup\n\nCreate Postman environments for multi-role testing:\n\n```json\n\u002F\u002F Environment: API Security Test - Regular User\n{\n    \"values\": [\n        {\"key\": \"base_url\", \"value\": \"https:\u002F\u002Ftarget-api.example.com\u002Fapi\u002Fv1\"},\n        {\"key\": \"auth_token\", \"value\": \"\"},\n        {\"key\": \"user_email\", \"value\": \"regular@test.com\"},\n        {\"key\": \"user_password\", \"value\": \"TestPass123!\"},\n        {\"key\": \"user_id\", \"value\": \"\"},\n        {\"key\": \"other_user_id\", \"value\": \"1002\"},\n        {\"key\": \"admin_endpoint\", \"value\": \"\u002Fadmin\u002Fusers\"},\n        {\"key\": \"test_order_id\", \"value\": \"\"},\n        {\"key\": \"other_user_order_id\", \"value\": \"5003\"}\n    ]\n}\n```\n\n**Pre-request script for automatic authentication:**\n```javascript\n\u002F\u002F Collection-level pre-request script for auto-login\nif (!pm.environment.get(\"auth_token\") || pm.environment.get(\"token_expired\")) {\n    const loginRequest = {\n        url: pm.environment.get(\"base_url\") + \"\u002Fauth\u002Flogin\",\n        method: \"POST\",\n        header: {\"Content-Type\": \"application\u002Fjson\"},\n        body: {\n            mode: \"raw\",\n            raw: JSON.stringify({\n                email: pm.environment.get(\"user_email\"),\n                password: pm.environment.get(\"user_password\")\n            })\n        }\n    };\n\n    pm.sendRequest(loginRequest, (err, res) => {\n        if (!err && res.code === 200) {\n            const token = res.json().access_token;\n            pm.environment.set(\"auth_token\", token);\n            pm.environment.set(\"user_id\", res.json().user.id);\n        }\n    });\n}\n```\n\n### Step 2: BOLA (API1) Test Collection\n\n```javascript\n\u002F\u002F Test: Access other user's profile (BOLA)\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002F{{other_user_id}}\n\u002F\u002F Auth: Bearer {{auth_token}}\n\n\u002F\u002F Test script:\npm.test(\"BOLA: Cannot access other user profile\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n\npm.test(\"BOLA: No user data leaked on denial\", function() {\n    if (pm.response.code === 200) {\n        const body = pm.response.json();\n        pm.expect(body).to.not.have.property(\"email\");\n        pm.expect(body).to.not.have.property(\"phone\");\n        pm.expect(body).to.not.have.property(\"address\");\n        \u002F\u002F Flag as BOLA if full profile returned\n        console.error(\"BOLA VULNERABILITY: Full profile returned for other user\");\n    }\n});\n\n\u002F\u002F Test: Access other user's order\n\u002F\u002F Request: GET {{base_url}}\u002Forders\u002F{{other_user_order_id}}\npm.test(\"BOLA: Cannot access other user order\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403, 404]);\n});\n\n\u002F\u002F Test: Modify other user's resource\n\u002F\u002F Request: PATCH {{base_url}}\u002Fusers\u002F{{other_user_id}}\n\u002F\u002F Body: {\"name\": \"Hacked\"}\npm.test(\"BOLA: Cannot modify other user profile\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n```\n\n### Step 3: Authentication (API2) Test Collection\n\n```javascript\n\u002F\u002F Test: Token validation\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Auth: Bearer invalid_token_value\n\npm.test(\"Auth: Invalid token rejected\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n\n\u002F\u002F Test: Expired token handling\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Auth: Bearer {{expired_token}}\n\npm.test(\"Auth: Expired token rejected\", function() {\n    pm.expect(pm.response.code).to.equal(401);\n});\n\n\u002F\u002F Test: Missing authentication\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Auth: None\n\npm.test(\"Auth: Unauthenticated request rejected\", function() {\n    pm.expect(pm.response.code).to.equal(401);\n});\n\n\u002F\u002F Test: SQL injection in login\n\u002F\u002F Request: POST {{base_url}}\u002Fauth\u002Flogin\n\u002F\u002F Body: {\"email\": \"' OR 1=1--\", \"password\": \"test\"}\n\npm.test(\"Auth: SQLi in login rejected\", function() {\n    pm.expect(pm.response.code).to.not.equal(200);\n    pm.expect(pm.response.text()).to.not.include(\"token\");\n});\n\n\u002F\u002F Test: Account enumeration\n\u002F\u002F Pre-request: Send login with valid email + wrong password, then invalid email + wrong password\npm.test(\"Auth: No account enumeration\", function() {\n    \u002F\u002F Compare with stored response from valid email attempt\n    const validEmailResponse = pm.environment.get(\"valid_email_response\");\n    const currentResponse = pm.response.text();\n    pm.expect(currentResponse).to.equal(validEmailResponse);\n});\n```\n\n### Step 4: Data Exposure (API3) and BFLA (API5) Tests\n\n```javascript\n\u002F\u002F Test: Excessive data exposure check\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\npm.test(\"Data Exposure: No sensitive fields in response\", function() {\n    const sensitiveFields = [\n        \"password\", \"password_hash\", \"passwordHash\",\n        \"ssn\", \"social_security\", \"credit_card\",\n        \"api_key\", \"secret_key\", \"mfa_secret\",\n        \"refresh_token\", \"session_id\"\n    ];\n    const responseText = pm.response.text().toLowerCase();\n    sensitiveFields.forEach(field => {\n        pm.expect(responseText).to.not.include('\"' + field + '\"');\n    });\n});\n\npm.test(\"Data Exposure: Security headers present\", function() {\n    pm.expect(pm.response.headers.has(\"X-Content-Type-Options\")).to.be.true;\n    pm.expect(pm.response.headers.has(\"X-Frame-Options\")).to.be.true;\n    pm.expect(pm.response.headers.get(\"X-Content-Type-Options\")).to.equal(\"nosniff\");\n});\n\npm.test(\"Data Exposure: No server info leaked\", function() {\n    pm.expect(pm.response.headers.has(\"Server\")).to.be.false;\n    pm.expect(pm.response.headers.has(\"X-Powered-By\")).to.be.false;\n});\n\n\u002F\u002F Test: BFLA - Admin endpoint access\n\u002F\u002F Request: GET {{base_url}}{{admin_endpoint}}\n\u002F\u002F Auth: Bearer {{auth_token}} (regular user)\n\npm.test(\"BFLA: Regular user cannot access admin endpoint\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n\n\u002F\u002F Test: BFLA - Admin function execution\n\u002F\u002F Request: DELETE {{base_url}}\u002Fusers\u002F{{other_user_id}}\n\u002F\u002F Auth: Bearer {{auth_token}} (regular user)\n\npm.test(\"BFLA: Regular user cannot delete other users\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n```\n\n### Step 5: Mass Assignment and Rate Limiting Tests\n\n```javascript\n\u002F\u002F Test: Mass assignment via profile update\n\u002F\u002F Request: PUT {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Body: {\"name\": \"Test\", \"role\": \"admin\", \"is_admin\": true}\n\npm.test(\"Mass Assignment: Role field not accepted\", function() {\n    if (pm.response.code === 200) {\n        const user = pm.response.json();\n        pm.expect(user.role).to.not.equal(\"admin\");\n        pm.expect(user.is_admin).to.not.equal(true);\n    }\n});\n\n\u002F\u002F Test: Rate limiting enforcement\n\u002F\u002F This test should be run with the Collection Runner at high iteration count\n\npm.test(\"Rate Limiting: Returns 429 when limit exceeded\", function() {\n    \u002F\u002F This test expects to be rate-limited after many iterations\n    const iterationCount = pm.info.iteration;\n    if (iterationCount > 50) {\n        \u002F\u002F After 50 iterations, we should see rate limiting\n        if (pm.response.code === 429) {\n            pm.expect(pm.response.headers.has(\"Retry-After\")).to.be.true;\n            console.log(\"Rate limiting enforced at iteration \" + iterationCount);\n        }\n    }\n});\n\n\u002F\u002F Test: Rate limit headers present\npm.test(\"Rate Limiting: Rate limit headers present\", function() {\n    const hasRateHeaders = pm.response.headers.has(\"X-RateLimit-Limit\") ||\n                           pm.response.headers.has(\"X-Rate-Limit-Limit\") ||\n                           pm.response.headers.has(\"RateLimit-Limit\");\n    pm.expect(hasRateHeaders).to.be.true;\n});\n```\n\n### Step 6: Newman CI\u002FCD Integration\n\n```bash\n# Run security test collection via Newman CLI\nnewman run \"API-Security-Tests.postman_collection.json\" \\\n    --environment \"Security-Test-Environment.postman_environment.json\" \\\n    --reporters cli,htmlextra,junit \\\n    --reporter-htmlextra-export .\u002Freports\u002Fsecurity-test-report.html \\\n    --reporter-junit-export .\u002Freports\u002Fsecurity-test-results.xml \\\n    --iteration-count 1 \\\n    --timeout-request 10000 \\\n    --delay-request 100 \\\n    --bail\n\n# Run with different user roles\nfor role in \"regular_user\" \"admin_user\" \"unauthenticated\"; do\n    echo \"Testing with role: $role\"\n    newman run \"API-Security-Tests.postman_collection.json\" \\\n        --environment \"Security-Test-${role}.postman_environment.json\" \\\n        --reporters cli,junit \\\n        --reporter-junit-export \".\u002Freports\u002Fsecurity-${role}.xml\"\ndone\n```\n\n**GitHub Actions Integration:**\n```yaml\n# .github\u002Fworkflows\u002Fapi-security-test.yml\nname: api-postman\non:\n  pull_request:\n    paths: ['src\u002Fapi\u002F**', 'openapi.yaml']\n\njobs:\n  security-test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: '20'\n      - run: npm install -g newman newman-reporter-htmlextra\n      - name: Run API Security Tests\n        run: |\n          newman run tests\u002Fpostman\u002Fapi-security.json \\\n            --environment tests\u002Fpostman\u002Fenv-staging.json \\\n            --reporters cli,htmlextra,junit \\\n            --reporter-htmlextra-export reports\u002Fsecurity.html \\\n            --reporter-junit-export reports\u002Fsecurity.xml\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with:\n          name: security-reports\n          path: reports\u002F\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Postman Collection** | Organized group of API requests with test scripts that can be shared, version-controlled, and executed automatically |\n| **Newman** | Command-line companion for Postman that enables running collections in CI\u002FCD pipelines and generating test reports |\n| **Pre-request Script** | JavaScript code that executes before a Postman request, used for dynamic authentication and test data setup |\n| **Test Script** | JavaScript code that executes after a Postman response, used to validate security assertions against the response |\n| **Collection Runner** | Postman feature that executes all requests in a collection sequentially with configurable iterations and delays |\n| **Environment Variables** | Key-value pairs scoped to a Postman environment that parameterize requests for different targets, roles, and configurations |\n\n## Tools & Systems\n\n- **Postman**: API platform for building, testing, and documenting APIs with built-in scripting and collection management\n- **Newman**: CLI runner for Postman collections supporting multiple reporters (HTML, JUnit, JSON) for CI\u002FCD integration\n- **OWASP ZAP**: Open-source security proxy that can be configured as Postman's proxy to scan all requests passively\n- **newman-reporter-htmlextra**: Enhanced HTML reporter for Newman that generates detailed test reports with request\u002Fresponse data\n- **Postman Flows**: Visual workflow builder for chaining complex security test sequences with conditional logic\n\n## Common Scenarios\n\n### Scenario: API Security Regression Suite for CI\u002FCD\n\n**Context**: A development team releases API updates bi-weekly. They need an automated security test suite that runs on every pull request to catch authorization and authentication regressions before merge.\n\n**Approach**:\n1. Import the OpenAPI spec into Postman to generate a base collection with all endpoints\n2. Create three environments: unauthenticated, regular user, admin with appropriate credentials\n3. Add security test scripts to each request: BOLA checks, auth validation, data exposure scanning, header security\n4. Create a dedicated \"Security Tests\" folder with injection payloads, mass assignment tests, and rate limit checks\n5. Export the collection and environments to the repository\n6. Configure Newman in GitHub Actions to run on every PR affecting API code\n7. Set the pipeline to fail on any security test failure, blocking the merge\n\n**Pitfalls**:\n- Hardcoding authentication tokens in collections instead of using pre-request scripts for dynamic token generation\n- Not testing with all user roles - only testing authenticated vs unauthenticated misses role-based authorization issues\n- Running security tests against production instead of staging environments\n- Not updating the collection when new endpoints are added, leaving gaps in coverage\n- Ignoring Newman exit codes in CI\u002FCD, allowing failing security tests to pass silently\n\n## Output Format\n\n```\n## API Security Test Report - Postman\u002FNewman\n\n**Collection**: API Security Tests v2.3\n**Environment**: Staging - Regular User\n**Date**: 2024-12-15\n**Total Requests**: 85\n**Total Tests**: 234\n**Passed**: 219\n**Failed**: 15\n\n### Failed Tests Summary\n\n| # | Request | Test Name | Severity |\n|---|---------|-----------|----------|\n| 1 | GET \u002Fusers\u002F1002 | BOLA: Cannot access other user profile | Critical |\n| 2 | GET \u002Forders\u002F5003 | BOLA: Cannot access other user order | Critical |\n| 3 | GET \u002Fadmin\u002Fusers | BFLA: Regular user cannot access admin endpoint | Critical |\n| 4 | PUT \u002Fusers\u002Fme | Mass Assignment: Role field not accepted | High |\n| 5 | GET \u002Fusers\u002Fme | Data Exposure: No sensitive fields in response | High |\n| 6 | POST \u002Fauth\u002Flogin | Auth: No account enumeration | Medium |\n| ... | ... | ... | ... |\n\n### Recommendations\n1. Fix BOLA on \u002Fusers\u002F{id} and \u002Forders\u002F{id} - add object-level authorization checks\n2. Fix BFLA on \u002Fadmin\u002Fusers - enforce role-based access control middleware\n3. Fix mass assignment on PUT \u002Fusers\u002Fme - implement field allowlist\n4. Remove password_hash and mfa_secret from user serialization\n5. Standardize login error messages to prevent account enumeration\n```\n","# Performing API Security Testing with Postman\n\n## When to Use\n\n- Building repeatable API security test suites for OWASP API Security Top 10 coverage\n- Creating automated security regression tests that run in CI\u002FCD pipelines via Newman\n- Testing API authentication and authorization across multiple user roles systematically\n- Integrating Postman with OWASP ZAP proxy for combined manual and automated security testing\n- Establishing a baseline security test collection for new API endpoints before deployment\n\n**Do not use** against production APIs without authorization. Postman security testing involves sending potentially malicious payloads.\n\n## Prerequisites\n\n- Postman Desktop or web application with an active workspace\n- Target API with OpenAPI\u002FSwagger specification for collection import\n- Test accounts for at least three roles: unauthenticated, regular user, admin\n- Newman CLI installed for CI\u002FCD integration: `npm install -g newman`\n- OWASP ZAP configured as local proxy (localhost:8080) for Postman proxy integration\n- API environment variables for base URL, tokens, and test data\n\n## Workflow\n\n### Step 1: Environment and Collection Setup\n\nCreate Postman environments for multi-role testing:\n\n```json\n\u002F\u002F Environment: API Security Test - Regular User\n{\n    \"values\": [\n        {\"key\": \"base_url\", \"value\": \"https:\u002F\u002Ftarget-api.example.com\u002Fapi\u002Fv1\"},\n        {\"key\": \"auth_token\", \"value\": \"\"},\n        {\"key\": \"user_email\", \"value\": \"regular@test.com\"},\n        {\"key\": \"user_password\", \"value\": \"TestPass123!\"},\n        {\"key\": \"user_id\", \"value\": \"\"},\n        {\"key\": \"other_user_id\", \"value\": \"1002\"},\n        {\"key\": \"admin_endpoint\", \"value\": \"\u002Fadmin\u002Fusers\"},\n        {\"key\": \"test_order_id\", \"value\": \"\"},\n        {\"key\": \"other_user_order_id\", \"value\": \"5003\"}\n    ]\n}\n```\n\n**Pre-request script for automatic authentication:**\n```javascript\n\u002F\u002F Collection-level pre-request script for auto-login\nif (!pm.environment.get(\"auth_token\") || pm.environment.get(\"token_expired\")) {\n    const loginRequest = {\n        url: pm.environment.get(\"base_url\") + \"\u002Fauth\u002Flogin\",\n        method: \"POST\",\n        header: {\"Content-Type\": \"application\u002Fjson\"},\n        body: {\n            mode: \"raw\",\n            raw: JSON.stringify({\n                email: pm.environment.get(\"user_email\"),\n                password: pm.environment.get(\"user_password\")\n            })\n        }\n    };\n\n    pm.sendRequest(loginRequest, (err, res) => {\n        if (!err && res.code === 200) {\n            const token = res.json().access_token;\n            pm.environment.set(\"auth_token\", token);\n            pm.environment.set(\"user_id\", res.json().user.id);\n        }\n    });\n}\n```\n\n### Step 2: BOLA (API1) Test Collection\n\n```javascript\n\u002F\u002F Test: Access other user's profile (BOLA)\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002F{{other_user_id}}\n\u002F\u002F Auth: Bearer {{auth_token}}\n\n\u002F\u002F Test script:\npm.test(\"BOLA: Cannot access other user profile\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n\npm.test(\"BOLA: No user data leaked on denial\", function() {\n    if (pm.response.code === 200) {\n        const body = pm.response.json();\n        pm.expect(body).to.not.have.property(\"email\");\n        pm.expect(body).to.not.have.property(\"phone\");\n        pm.expect(body).to.not.have.property(\"address\");\n        \u002F\u002F Flag as BOLA if full profile returned\n        console.error(\"BOLA VULNERABILITY: Full profile returned for other user\");\n    }\n});\n\n\u002F\u002F Test: Access other user's order\n\u002F\u002F Request: GET {{base_url}}\u002Forders\u002F{{other_user_order_id}}\npm.test(\"BOLA: Cannot access other user order\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403, 404]);\n});\n\n\u002F\u002F Test: Modify other user's resource\n\u002F\u002F Request: PATCH {{base_url}}\u002Fusers\u002F{{other_user_id}}\n\u002F\u002F Body: {\"name\": \"Hacked\"}\npm.test(\"BOLA: Cannot modify other user profile\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n```\n\n### Step 3: Authentication (API2) Test Collection\n\n```javascript\n\u002F\u002F Test: Token validation\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Auth: Bearer invalid_token_value\n\npm.test(\"Auth: Invalid token rejected\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n\n\u002F\u002F Test: Expired token handling\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Auth: Bearer {{expired_token}}\n\npm.test(\"Auth: Expired token rejected\", function() {\n    pm.expect(pm.response.code).to.equal(401);\n});\n\n\u002F\u002F Test: Missing authentication\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Auth: None\n\npm.test(\"Auth: Unauthenticated request rejected\", function() {\n    pm.expect(pm.response.code).to.equal(401);\n});\n\n\u002F\u002F Test: SQL injection in login\n\u002F\u002F Request: POST {{base_url}}\u002Fauth\u002Flogin\n\u002F\u002F Body: {\"email\": \"' OR 1=1--\", \"password\": \"test\"}\n\npm.test(\"Auth: SQLi in login rejected\", function() {\n    pm.expect(pm.response.code).to.not.equal(200);\n    pm.expect(pm.response.text()).to.not.include(\"token\");\n});\n\n\u002F\u002F Test: Account enumeration\n\u002F\u002F Pre-request: Send login with valid email + wrong password, then invalid email + wrong password\npm.test(\"Auth: No account enumeration\", function() {\n    \u002F\u002F Compare with stored response from valid email attempt\n    const validEmailResponse = pm.environment.get(\"valid_email_response\");\n    const currentResponse = pm.response.text();\n    pm.expect(currentResponse).to.equal(validEmailResponse);\n});\n```\n\n### Step 4: Data Exposure (API3) and BFLA (API5) Tests\n\n```javascript\n\u002F\u002F Test: Excessive data exposure check\n\u002F\u002F Request: GET {{base_url}}\u002Fusers\u002Fme\n\npm.test(\"Data Exposure: No sensitive fields in response\", function() {\n    const sensitiveFields = [\n        \"password\", \"password_hash\", \"passwordHash\",\n        \"ssn\", \"social_security\", \"credit_card\",\n        \"api_key\", \"secret_key\", \"mfa_secret\",\n        \"refresh_token\", \"session_id\"\n    ];\n    const responseText = pm.response.text().toLowerCase();\n    sensitiveFields.forEach(field => {\n        pm.expect(responseText).to.not.include('\"' + field + '\"');\n    });\n});\n\npm.test(\"Data Exposure: Security headers present\", function() {\n    pm.expect(pm.response.headers.has(\"X-Content-Type-Options\")).to.be.true;\n    pm.expect(pm.response.headers.has(\"X-Frame-Options\")).to.be.true;\n    pm.expect(pm.response.headers.get(\"X-Content-Type-Options\")).to.equal(\"nosniff\");\n});\n\npm.test(\"Data Exposure: No server info leaked\", function() {\n    pm.expect(pm.response.headers.has(\"Server\")).to.be.false;\n    pm.expect(pm.response.headers.has(\"X-Powered-By\")).to.be.false;\n});\n\n\u002F\u002F Test: BFLA - Admin endpoint access\n\u002F\u002F Request: GET {{base_url}}{{admin_endpoint}}\n\u002F\u002F Auth: Bearer {{auth_token}} (regular user)\n\npm.test(\"BFLA: Regular user cannot access admin endpoint\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n\n\u002F\u002F Test: BFLA - Admin function execution\n\u002F\u002F Request: DELETE {{base_url}}\u002Fusers\u002F{{other_user_id}}\n\u002F\u002F Auth: Bearer {{auth_token}} (regular user)\n\npm.test(\"BFLA: Regular user cannot delete other users\", function() {\n    pm.expect(pm.response.code).to.be.oneOf([401, 403]);\n});\n```\n\n### Step 5: Mass Assignment and Rate Limiting Tests\n\n```javascript\n\u002F\u002F Test: Mass assignment via profile update\n\u002F\u002F Request: PUT {{base_url}}\u002Fusers\u002Fme\n\u002F\u002F Body: {\"name\": \"Test\", \"role\": \"admin\", \"is_admin\": true}\n\npm.test(\"Mass Assignment: Role field not accepted\", function() {\n    if (pm.response.code === 200) {\n        const user = pm.response.json();\n        pm.expect(user.role).to.not.equal(\"admin\");\n        pm.expect(user.is_admin).to.not.equal(true);\n    }\n});\n\n\u002F\u002F Test: Rate limiting enforcement\n\u002F\u002F This test should be run with the Collection Runner at high iteration count\n\npm.test(\"Rate Limiting: Returns 429 when limit exceeded\", function() {\n    \u002F\u002F This test expects to be rate-limited after many iterations\n    const iterationCount = pm.info.iteration;\n    if (iterationCount > 50) {\n        \u002F\u002F After 50 iterations, we should see rate limiting\n        if (pm.response.code === 429) {\n            pm.expect(pm.response.headers.has(\"Retry-After\")).to.be.true;\n            console.log(\"Rate limiting enforced at iteration \" + iterationCount);\n        }\n    }\n});\n\n\u002F\u002F Test: Rate limit headers present\npm.test(\"Rate Limiting: Rate limit headers present\", function() {\n    const hasRateHeaders = pm.response.headers.has(\"X-RateLimit-Limit\") ||\n                           pm.response.headers.has(\"X-Rate-Limit-Limit\") ||\n                           pm.response.headers.has(\"RateLimit-Limit\");\n    pm.expect(hasRateHeaders).to.be.true;\n});\n```\n\n### Step 6: Newman CI\u002FCD Integration\n\n```bash\n# Run security test collection via Newman CLI\nnewman run \"API-Security-Tests.postman_collection.json\" \\\n    --environment \"Security-Test-Environment.postman_environment.json\" \\\n    --reporters cli,htmlextra,junit \\\n    --reporter-htmlextra-export .\u002Freports\u002Fsecurity-test-report.html \\\n    --reporter-junit-export .\u002Freports\u002Fsecurity-test-results.xml \\\n    --iteration-count 1 \\\n    --timeout-request 10000 \\\n    --delay-request 100 \\\n    --bail\n\n# Run with different user roles\nfor role in \"regular_user\" \"admin_user\" \"unauthenticated\"; do\n    echo \"Testing with role: $role\"\n    newman run \"API-Security-Tests.postman_collection.json\" \\\n        --environment \"Security-Test-${role}.postman_environment.json\" \\\n        --reporters cli,junit \\\n        --reporter-junit-export \".\u002Freports\u002Fsecurity-${role}.xml\"\ndone\n```\n\n**GitHub Actions Integration:**\n```yaml\n# .github\u002Fworkflows\u002Fapi-security-test.yml\nname: api-postman\non:\n  pull_request:\n    paths: ['src\u002Fapi\u002F**', 'openapi.yaml']\n\njobs:\n  security-test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n      - uses: actions\u002Fsetup-node@v4\n        with:\n          node-version: '20'\n      - run: npm install -g newman newman-reporter-htmlextra\n      - name: Run API Security Tests\n        run: |\n          newman run tests\u002Fpostman\u002Fapi-security.json \\\n            --environment tests\u002Fpostman\u002Fenv-staging.json \\\n            --reporters cli,htmlextra,junit \\\n            --reporter-htmlextra-export reports\u002Fsecurity.html \\\n            --reporter-junit-export reports\u002Fsecurity.xml\n      - uses: actions\u002Fupload-artifact@v4\n        if: always()\n        with:\n          name: security-reports\n          path: reports\u002F\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| **Postman Collection** | Organized group of API requests with test scripts that can be shared, version-controlled, and executed automatically |\n| **Newman** | Command-line companion for Postman that enables running collections in CI\u002FCD pipelines and generating test reports |\n| **Pre-request Script** | JavaScript code that executes before a Postman request, used for dynamic authentication and test data setup |\n| **Test Script** | JavaScript code that executes after a Postman response, used to validate security assertions against the response |\n| **Collection Runner** | Postman feature that executes all requests in a collection sequentially with configurable iterations and delays |\n| **Environment Variables** | Key-value pairs scoped to a Postman environment that parameterize requests for different targets, roles, and configurations |\n\n## Tools & Systems\n\n- **Postman**: API platform for building, testing, and documenting APIs with built-in scripting and collection management\n- **Newman**: CLI runner for Postman collections supporting multiple reporters (HTML, JUnit, JSON) for CI\u002FCD integration\n- **OWASP ZAP**: Open-source security proxy that can be configured as Postman's proxy to scan all requests passively\n- **newman-reporter-htmlextra**: Enhanced HTML reporter for Newman that generates detailed test reports with request\u002Fresponse data\n- **Postman Flows**: Visual workflow builder for chaining complex security test sequences with conditional logic\n\n## Common Scenarios\n\n### Scenario: API Security Regression Suite for CI\u002FCD\n\n**Context**: A development team releases API updates bi-weekly. They need an automated security test suite that runs on every pull request to catch authorization and authentication regressions before merge.\n\n**Approach**:\n1. Import the OpenAPI spec into Postman to generate a base collection with all endpoints\n2. Create three environments: unauthenticated, regular user, admin with appropriate credentials\n3. Add security test scripts to each request: BOLA checks, auth validation, data exposure scanning, header security\n4. Create a dedicated \"Security Tests\" folder with injection payloads, mass assignment tests, and rate limit checks\n5. Export the collection and environments to the repository\n6. Configure Newman in GitHub Actions to run on every PR affecting API code\n7. Set the pipeline to fail on any security test failure, blocking the merge\n\n**Pitfalls**:\n- Hardcoding authentication tokens in collections instead of using pre-request scripts for dynamic token generation\n- Not testing with all user roles - only testing authenticated vs unauthenticated misses role-based authorization issues\n- Running security tests against production instead of staging environments\n- Not updating the collection when new endpoints are added, leaving gaps in coverage\n- Ignoring Newman exit codes in CI\u002FCD, allowing failing security tests to pass silently\n\n## Output Format\n\n```\n## API Security Test Report - Postman\u002FNewman\n\n**Collection**: API Security Tests v2.3\n**Environment**: Staging - Regular User\n**Date**: 2024-12-15\n**Total Requests**: 85\n**Total Tests**: 234\n**Passed**: 219\n**Failed**: 15\n\n### Failed Tests Summary\n\n| # | Request | Test Name | Severity |\n|---|---------|-----------|----------|\n| 1 | GET \u002Fusers\u002F1002 | BOLA: Cannot access other user profile | Critical |\n| 2 | GET \u002Forders\u002F5003 | BOLA: Cannot access other user order | Critical |\n| 3 | GET \u002Fadmin\u002Fusers | BFLA: Regular user cannot access admin endpoint | Critical |\n| 4 | PUT \u002Fusers\u002Fme | Mass Assignment: Role field not accepted | High |\n| 5 | GET \u002Fusers\u002Fme | Data Exposure: No sensitive fields in response | High |\n| 6 | POST \u002Fauth\u002Flogin | Auth: No account enumeration | Medium |\n| ... | ... | ... | ... |\n\n### Recommendations\n1. Fix BOLA on \u002Fusers\u002F{id} and \u002Forders\u002F{id} - add object-level authorization checks\n2. Fix BFLA on \u002Fadmin\u002Fusers - enforce role-based access control middleware\n3. Fix mass assignment on PUT \u002Fusers\u002Fme - implement field allowlist\n4. Remove password_hash and mfa_secret from user serialization\n5. Standardize login error messages to prevent account enumeration\n```\n",{"name":5,"tags":60,"capec":62,"model":63,"tools":64,"domain":47,"maxTurns":68,"nist_csf":69,"subdomain":48,"description":7},[48,38,61,53,54],"owasp",[],"sonnet",[65,46,66,67],"Read","Glob","Grep",20,[70,71,72,73],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01","main","a91f1293287ffa9f4f1b8f486cd6e835a1568c84","skills\u002Fweb-application\u002Fapi\u002Fpostman\u002Fverify","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace","https:\u002F\u002Fgithub.com\u002FDCx7C5","#Python","2026-09-01 11:21:00",{"source":8,"skillName":5,"commands":82,"prompt":92,"zipAvailable":93},[83,86,89],{"tool":84,"command":85},"npx","npx skills add DCx7C5\u002Fai-marketplace --skill api-postman-verify",{"tool":87,"command":88},"bunx","bunx skills add DCx7C5\u002Fai-marketplace --skill api-postman-verify",{"tool":90,"command":91},"pnpm","pnpm dlx skills add DCx7C5\u002Fai-marketplace --skill api-postman-verify","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fweb-application\u002Fapi\u002Fpostman\u002Fverify\u002FSKILL.md",true,[95],{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"index.json","REFERENCE","参考文档",685,"https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fweb-application\u002Fapi\u002Fpostman\u002Fverify\u002Findex.json",[102,125,146,166,188,203],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":55},"01M71HAPZ01KQ30RKTB0FFSQ05","services-wmi-persistence-detect","Detect WMI event subscription persistence by enumerating ActiveScriptEventConsumer, CommandLineEventConsumer, and permanent subscriptions in the WMI repository.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fpersistence\u002Fdetect\u002FSKILL.md",[],[109,110,111,112,113,41,52,114,115,116,117,118,119,120,121,122,123,47,124],"services","detect","services wmi persistence detect","wmi","persistence","process","activescript","event","subscriptions","commandline-consumer","repository","subscription","event-subscription","t1546.003","forensics","process-forensics",{"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":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":55},"01M71HAK6JTTTS229T17WJMMCG","services-wmi-exec-exploit","Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fservices\u002Fwmi\u002Fexec\u002Fexploit\u002FSKILL.md",[],[132,109,133,112,134,135,136,47,46,137,138,139,140,141,41,142,143,39,144,145],"exploit","services wmi exec exploit","exec","remote","traffic","analysis","team","across","crackmapexec","native","command","lateral movement","lateral-movement","Impacket",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":55},"01M71HAG6MHKNQV8KDZKMT4886","registry-artifact-extract","Extract and analyze Windows Registry hives to uncover user activity, installed software, autostart entries, and evidence of system compromise.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fregistry\u002Fartifact\u002Fextract\u002FSKILL.md",[],[153,154,155,156,157,158,47,46,45,137,159,160,41,39,161,162,163,164,165,63],"artifact","registry","registry artifact extract","extract","evidence-collection","artifact-analysis","analyze","uncover","software","activity","digital-forensics","windows-registry","regripper",{"skillNo":167,"name":168,"nameZh":6,"description":169,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":172,"publishedAt":55},"01M71HACR4A8XTWTTSXK4124AA","processes-token-impersonate-detect","Detect Windows token impersonation and privilege abuse including SeImpersonatePrivilege exploitation via Potato attacks and token stealing techniques.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Ftoken\u002Fimpersonate\u002Fdetect\u002FSKILL.md",[],[110,173,174,175,176,177,178,52,179,47,124,180,181,182,183,184,185,186,187,41],"processes token impersonate detect","token","processes","attacks","windows","escalation","techniques","privilege-escalation","seimpersonate","token-impersonation","printspoofer","exploitation","potato","impersonation","via",{"skillNo":189,"name":190,"nameZh":6,"description":191,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":192,"categories":193,"keywords":194,"publishedAt":55},"01M71HAABSB4Z6QFSXEG00R4RK","processes-thread-injection-detect","Detect Windows thread injection techniques including CreateRemoteThread, QueueUserAPC, NtCreateThreadEx, and thread hijacking via process memory analysis.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fthread\u002Finjection\u002Fdetect\u002FSKILL.md",[],[195,196,110,197,175,177,198,52,199,179,47,124,137,36,200,201,202,187,41,114],"thread","processes thread injection detect","injection","memory","process-injection","apc-injection","thread-injection","nt-api",{"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":15,"licenseFileUrl":6,"sourceHtmlUrl":207,"categories":208,"keywords":209,"publishedAt":55},"01M71HA7H311V5G14WMX58HQSS","processes-hollow-technique-detect","Detect process hollowing (RunPE) by identifying processes with mismatched image paths between PEB and VAD tree, or unmapped PE headers in memory.","https:\u002F\u002Fgithub.com\u002FDCx7C5\u002Fai-marketplace\u002Fblob\u002Fmain\u002Fskills\u002Fwindows\u002Fprocesses\u002Fhollow\u002Ftechnique\u002Fdetect\u002FSKILL.md",[],[210,110,175,211,198,52,212,213,47,124,214,215,216,217,218,219,41,114,220,221],"processes hollow technique detect","tree","memory-forensics","process-hollow","peb","runpe","image","pe-header","in memory","with","mismatched","headers"]