[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A9M0CAC27DFAEA4AS4QX2C":3,"skill-same:01M7A9M0CAC27DFAEA4AS4QX2C":83},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":46,"commitSha":47,"skillDirectory":48,"forksCount":14,"repositoryHtmlUrl":49,"repositoryHomepageUrl":6,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M7A9M0CAC27DFAEA4AS4QX2C","performing-api-security-testing-with-postman",null,"Uses Postman to build structured API security test collections covering the OWASP API Security Top 10—authentication bypass, authorization flaws, injection, and data exposure—with multi-role environments, automated test scripts, and OWASP ZAP\u002FNewman integration for CI\u002FCD. Use when building repeatable Postman-based API security regression tests or automating OWASP API Top 10 coverage in a pipeline.","NeelakshSaxena\u002FVayu","NeelakshSaxena","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F87892838?v=4","01M7A3B9YFS6F6N9DD1787DT86","Neelaksh Saxena","01M7A3B9ZKBT09MNMPX2XN69BY",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-api-security-testing-with-postman\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-api-security-testing-with-postman\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: performing-api-security-testing-with-postman\ndescription: 'Uses Postman to build structured API security test collections covering\n  the OWASP API Security Top 10—authentication bypass, authorization flaws, injection,\n  and data exposure—with multi-role environments, automated test scripts, and OWASP\n  ZAP\u002FNewman integration for CI\u002FCD. Use when building repeatable Postman-based API\n  security regression tests or automating OWASP API Top 10 coverage in a pipeline.\n\n  '\ndomain: cybersecurity\nsubdomain: api-security\ntags:\n- api-security\n- postman\n- owasp\n- automated-testing\n- security-validation\nversion: 1.0.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- T1059.007\n- T1552.001\n- T1055\n- T1059\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 Security Tests\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 Security Tests\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":25,"author":31,"domain":32,"license":15,"version":33,"nist_csf":34,"subdomain":26,"description":39,"mitre_attack":40},[26,27,28,29,30],"api-security","postman","owasp","automated-testing","security-validation","mahipal","cybersecurity","1.0.0",[35,36,37,38],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01","Uses Postman to build structured API security test collections covering the OWASP API Security Top 10—authentication bypass, authorization flaws, injection, and data exposure—with multi-role environments, automated test scripts, and OWASP ZAP\u002FNewman integration for CI\u002FCD. Use when building repeatable Postman-based API security regression tests or automating OWASP API Top 10 coverage in a pipeline.\n",[41,42,43,44,45],"T1190","T1059.007","T1552.001","T1055","T1059","main","7540bbccf0c1ded6156a467b02c95b61ad62413f",".agents\u002Fskills\u002Fperforming-api-security-testing-with-postman","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena","Currently exploring the intersection of tech","2026-09-11 03:02:31",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add NeelakshSaxena\u002FVayu --skill performing-api-security-testing-with-postman",{"tool":59,"command":60},"bunx","bunx skills add NeelakshSaxena\u002FVayu --skill performing-api-security-testing-with-postman",{"tool":62,"command":63},"pnpm","pnpm dlx skills add NeelakshSaxena\u002FVayu --skill performing-api-security-testing-with-postman","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-api-security-testing-with-postman\u002FSKILL.md",true,[67,71,77],{"path":68,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":72,"resourceType":73,"resourceTypeDesc":74,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fapi-reference.md","REFERENCE","参考文档",2119,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-api-security-testing-with-postman\u002Freferences\u002Fapi-reference.md",{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"scripts\u002Fagent.py","SCRIPT","脚本",9039,"https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperforming-api-security-testing-with-postman\u002Fscripts\u002Fagent.py",[84,91,98,105,112,119],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":20},"01M7ACCCVNCFKMA9X6D15X6G98","runpodctl","Runpod CLI for managing GPU\u002FCPU workloads from the terminal — pods, serverless endpoints, templates, network volumes, Hub deploys, models, SSH, and file transfer (send\u002Freceive). Use for terminal\u002FCI\u002Fscripting, Hub browse\u002Fdeploy, SSH setup, `doctor`, or when the Runpod MCP tools are not connected. For structured tool calls in an MCP-enabled session, prefer runpod-mcp.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpodctl\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M7ACC63SRHEA5KMCHSMZK2TC","runpod","Start here for any Runpod task — running GPU\u002FCPU pods, deploying serverless endpoints, templates, network volumes, building images, or understanding how Runpod works. Routes to the right skill (runpod-mcp, runpodctl, flash, companion-clis, runpod-usage, runpod-templates, runpod-migrate) and indexes two dozen live-verified end-to-end examples (golden paths) — use it when the lane is unclear, and for any multi-step or provisioning task even when it is not.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":20},"01M7ACC0Q1C89N9BZBV91CTQTF","runpod-usage","How Runpod works and how to work it — pods vs serverless, GPU\u002FVRAM selection, storage, building a container, networking, plus the agentic pod development loop (provision → ssh-exec → set up → poll readiness) and on-pod install hygiene (uv\u002Fapt). Use to answer \"how does X work\", \"which GPU\", \"how do I build a container\", or \"how do I stand up a workload on a pod\". Guidance, not a tool — execute with runpodctl, runpod-mcp, or flash.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-usage\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M7ACBRPE345GF5GM5B8P8RRC","runpod-templates","Runpod's official prebuilt pod templates (ComfyUI, PyTorch, and others): what each image ships, which ports and paths it uses, how to pick one, how to pin a version, and what is missing on first boot. Use when a task says \"run \u003CX> on a pod\" and an official template already covers it, instead of building an image — and when a user needs help with or wants to fix something about a Runpod template they are already running (won't boot, can't reach the UI, missing models, wrong CUDA line, broken ComfyUI workflow metadata on imported workflows): start here and route onward. Deploy with runpodctl or runpod-mcp; end-to-end walkthroughs live in the runpod router's golden paths.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-templates\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":20},"01M7ACBJATHKVX1TWES2F44GY8","runpod-migrate","Migrate a codebase from the Runpod GraphQL API or REST v1 to REST v2 — inventory which parts use which API version, rewrite the call sites, flag breaking changes, and verify. Use when someone asks to move to v2, asks what v2 would change, or asks which Runpod API their code is on. For managing infrastructure rather than migrating code, use runpod-mcp or runpodctl.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-migrate\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":20},"01M7ACBC7GHVH6T9YEAPCG2AP8","runpod-mcp","Manage Runpod infrastructure — pods, serverless endpoints, jobs, templates, network volumes, container-registry auth, GPU\u002FCPU catalog, and billing — via the Runpod MCP server's structured tool calls. Use when the Runpod MCP tools (create-pod, list-endpoints, …) are connected in this session, or to connect them (hosted OAuth or local npx). Prefer this over runpodctl for plain infra CRUD when MCP is available; use runpodctl for the terminal, file transfer, or SSH setup.","https:\u002F\u002Fgithub.com\u002FNeelakshSaxena\u002FVayu\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Frunpod-mcp\u002FSKILL.md",[],[]]