42crunch-api-security-testing
Skill1 starsChanged 53 days agoMITView on GitHub
Use when auditing, scanning, or remediating OpenAPI/Swagger API definitions for security vulnerabilities — 42Crunch audit scoring, OWASP API Security Top 10 compliance, BOLA/BFLA prevention, schema strictness, and shift-left API CI/CD testing.
In this repository98 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- a-b-testingSkill
- acceptance-testingSkill
- accessibility-testingSkill
- ai-agent-evaluationSkill
- ai-code-securitySkill
- ai-ml-testingSkill
- analytics-tracking-testingSkill
- api-testingSkill
- authn-authz-testingSkill
- autonomous-qa-orchestrationSkill
- bdd-gherkin-testingSkill
- blockchain-smart-contract-testingSkill
- bug-reportingSkill
- chaos-resilience-testingSkill
- chatbot-voice-agent-testingSkill
- cicd-testingSkill
- cli-testingSkill
- cloud-infrastructure-testingSkill
- code-coverage-analysisSkill
- compatibility-testingSkill
- compliance-testingSkill
- concurrency-race-condition-testingSkill
- configuration-feature-flag-testingSkill
- contract-testingSkill
- cross-browser-testingSkill
- database-testingSkill
- data-migration-testingSkill
- data-pipeline-etl-testingSkill
- date-time-timezone-testingSkill
- desktop-app-testingSkill
- disaster-recovery-backup-testingSkill
- e2e-testingSkill
- email-notification-testingSkill
- event-driven-messaging-testingSkill
- exploratory-testingSkill
- flaky-test-managementSkill
- functional-testingSkill
- fuzz-testingSkill
- game-testingSkill
- graphql-testingSkill
- iac-container-security-testingSkill
- installation-upgrade-testingSkill
- integration-testingSkill
- iot-embedded-testingSkill
- llm-security-auditSkill
- llm-testingSkill
- localization-testingSkill
- manual-testingSkill
- mcp-testingSkill
- memory-leak-resource-testingSkill
- microservices-testingSkill
- mobile-testingSkill
- mutation-testingSkill
- observability-testingSkill
- payment-ecommerce-testingSkill
- performance-testingSkill
- production-monitoring-synthetic-testingSkill
- property-based-testingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 45
Every endpoint (except explicit public endpoints like login/register) must define a security requirement.
- Very specific: line 50
Strings: Must specify maxLength and where applicable a restrictive pattern (regex) or format (e.g., uuid, email, uri).
- Very specific: line 51
Numbers/Integers: Must specify minimum and maximum boundaries to prevent integer overflows or resource exhaustion.
- Very specific: line 52
Arrays: Must specify maxItems and minItems to prevent unbounded payload attacks (DoS).
- Very specific: line 53
Objects: Must specify additionalProperties: false to mitigate Mass Assignment vulnerabilities.
- Very specific: line 177
When 42Crunch CLI (42c) or VS Code extension is installed:
- Distinctive: line 189
When reviewing or authoring an API contract:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
42Crunch API Security Testing
Overview
42Crunch provides automated, contract-driven API security testing. It enforces security at the OpenAPI/Swagger definition layer and verifies live implementation conformance, enabling an automated Audit -> Scan -> Remediate -> Validate cycle directly within AI-assisted developer workflows.
The Continuous API Security Loop
┌───────────────┐
│ 1. AUDIT │ Static contract analysis of OpenAPI / Swagger specs
└───────┬───────┘
▼
┌───────────────┐
│ 2. SCAN │ Dynamic conformance scanning of active endpoints
└───────┬───────┘
▼
┌───────────────┐
│ 3. REMEDIATE │ Propose exact contract & code fixes (BOLA, schemas)
└───────┬───────┘
▼
┌───────────────┐
│ 4. VALIDATE │ Re-audit to verify score meets threshold (>85/100)
└───────────────┘1. OpenAPI Security Audit Criteria (Scoring 0–100)
A high 42Crunch audit score requires comprehensive, strict contract definitions:
Authentication & Authorization
- Every endpoint (except explicit public endpoints like login/register) must define a
securityrequirement. - Global security definitions must declare granular scopes (e.g.
read:users,write:orders). - Unauthenticated endpoints must explicitly set
security: []with documented rationale.
Strict Schema Definition & Input Constraints
- Strings: Must specify
maxLengthand where applicable a restrictivepattern(regex) orformat(e.g.,uuid,email,uri). - Numbers/Integers: Must specify
minimumandmaximumboundaries to prevent integer overflows or resource exhaustion. - Arrays: Must specify
maxItemsandminItemsto prevent unbounded payload attacks (DoS). - Objects: Must specify
additionalProperties: falseto mitigate Mass Assignment vulnerabilities. - Enums: Restrict input values to known permitted sets rather than arbitrary strings.
Response Contracts
- Explicit definitions for all HTTP response codes:
200/201/204with strict output schemas.400 Bad Requestwith standardized validation error schema.401 Unauthorized&403 Forbiddenfor auth failures.404 Not Foundfor resource lookups.429 Too Many Requestswith rate limit headers.500 Internal Server Errorwith generic, non-leaking error responses (never stack traces).
2. OWASP API Security Top 10 (2023) Mapping
| Risk | Name | 42Crunch Verification Rule |
| API1 | BOLA (Broken Object Level Authorization) | Enforce path parameter format (e.g. uuid pattern), verify auth tokens on object IDs, assert tenant isolation. |
| API2 | Broken Authentication | Flag weak schemes (e.g. Basic Auth over HTTP); require OAuth2/Bearer JWT with expiration; rate limit login endpoints. |
| API3 | Broken Object Property Level Auth | Prevent Mass Assignment by enforcing additionalProperties: false on request bodies and filtering sensitive attributes (e.g. role, isAdmin) from response schemas. |
| API4 | Unrestricted Resource Consumption | Mandate maxLength, maxItems, pagination query parameters (limit with max boundary), and 429 rate limiting contracts. |
| API5 | BFLA (Broken Function Level Auth) | Enforce strict role/scope requirements on administrative endpoints (e.g., /admin/* requires admin scope). |
| API6 | Unrestricted Sensitive Business Flows | Identify high-frequency critical endpoints (e.g. checkout, coupon-redeem, password-reset) requiring CAPTCHA or velocity throttling. |
| API7 | Server-Side Request Forgery (SSRF) | Restrict URL/webhook parameter schemas with strict regex patterns; disallow loopback/internal CIDR ranges. |
| API8 | Security Misconfiguration | Disallow wildcard CORS (*), mandate HTTPS-only server URLs, remove detailed stack traces from 5xx schemas. |
| API9 | Improper Inventory Management | Flag undocumented/deprecated API versions; enforce API version prefixes (/v1/, /v2/); remove debug endpoints. |
| API10 | Unsafe Consumption of APIs | Validate responses from third-party integrations with strict schema filters before internal processing. |
3. Remediation Patterns (Before vs. After)
Example 1: Preventing Mass Assignment & Unbounded Strings
❌ Vulnerable Spec (Audit Score: ~35/100)
paths:
/users:
post:
summary: Create user
requestBody:
content:
application/json:
schema:
type: object
properties:
username:
type: string
email:
type: string
role:
type: string✅ Remediated Spec (Audit Score: ~95/100)
paths:
/users:
post:
summary: Create user
security:
- BearerAuth: ["users:create"]
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- username
- email
properties:
username:
type: string
minLength: 3
maxLength: 30
pattern: '^[a-zA-Z0-9_-]+$'
email:
type: string
format: email
maxLength: 255
responses:
'201':
description: User created
content:
application/json:
schema:
$ref: '#/components/schemas/UserResponse'
'400':
$ref: '#/components/responses/400BadRequest'
'401':
$ref: '#/components/responses/401Unauthorized'4. Automation & CI/CD Shift-Left
GitHub Actions Integration
name: 42Crunch API Security Audit
on:
push:
paths:
- '**/openapi.yaml'
- '**/openapi.json'
pull_request:
jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 42Crunch API Security Audit
uses: 42Crunch/api-security-audit-action@v3
with:
api-token: ${{ secrets.SECURITY_API_TOKEN }}
min-score: 85CLI Quick Audit
When 42Crunch CLI (42c) or VS Code extension is installed:
# Run local contract audit
42c audit openapi.yaml --min-score 85
# Conformance scan against live test server
42c scan openapi.yaml --target http://localhost:80805. Review Checklist for Agents
When reviewing or authoring an API contract:
- Is
securitydefined at root and per-endpoint? - Does every string have
maxLengthand apatternorformat? - Does every numeric value have
minimumandmaximum? - Does every array have
maxItems? - Is
additionalProperties: falseset on all request payload schemas? - Are all error status codes (
400,401,403,404,429,500) documented with schemas? - Are internal/admin paths guarded by distinct role scopes?
- Has the audit score achieved ≥ 85/100?
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

