mejbaurbahar/software-tester-skills/42crunch-api-security-testing

Claude Code and agent skill by mejbaurbahar/software-tester-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

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.

Install

npx vskill@latest install mejbaurbahar/software-tester-skills/42crunch-api-security-testing

SKILL.md

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 security requirement.
  • 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 maxLength and where applicable a restrictive pattern (regex) or format (e.g., uuid, email, uri).
  • Numbers/Integers: Must specify minimum and maximum boundaries to prevent integer overflows or resource exhaustion.
  • Arrays: Must specify maxItems and minItems to prevent unbounded payload attacks (DoS).
  • Objects: Must specify additionalProperties: false to 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 / 204 with strict output schemas.
  • 400 Bad Request with standardized validation error schema.
  • 401 Unauthorized & 403 Forbidden for auth failures.
  • 404 Not Found for resource lookups.
  • 429 Too Many Requests with rate limit headers.
  • 500 Internal Server Error with generic, non-leaking error responses (never stack traces).

2. OWASP API Security Top 10 (2023) Mapping

RiskName42Crunch Verification Rule
API1BOLA (Broken Object Level Authorization)Enforce path parameter format (e.g. uuid pattern), verify auth tokens on object IDs, assert tenant isolation.
API2Broken AuthenticationFlag weak schemes (e.g. Basic Auth over HTTP); require OAuth2/Bearer JWT with expiration; rate limit login endpoints.
API3Broken Object Property Level AuthPrevent Mass Assignment by enforcing additionalProperties: false on request bodies and filtering sensitive attributes (e.g. role, isAdmin) from response schemas.
API4Unrestricted Resource ConsumptionMandate maxLength, maxItems, pagination query parameters (limit with max boundary), and 429 rate limiting contracts.
API5BFLA (Broken Function Level Auth)Enforce strict role/scope requirements on administrative endpoints (e.g., /admin/* requires admin scope).
API6Unrestricted Sensitive Business FlowsIdentify high-frequency critical endpoints (e.g. checkout, coupon-redeem, password-reset) requiring CAPTCHA or velocity throttling.
API7Server-Side Request Forgery (SSRF)Restrict URL/webhook parameter schemas with strict regex patterns; disallow loopback/internal CIDR ranges.
API8Security MisconfigurationDisallow wildcard CORS (*), mandate HTTPS-only server URLs, remove detailed stack traces from 5xx schemas.
API9Improper Inventory ManagementFlag undocumented/deprecated API versions; enforce API version prefixes (/v1/, /v2/); remove debug endpoints.
API10Unsafe Consumption of APIsValidate 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)
yaml
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)
yaml
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
yaml
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: 85
CLI Quick Audit

When 42Crunch CLI (42c) or VS Code extension is installed:

bash
# Run local contract audit
42c audit openapi.yaml --min-score 85
# Conformance scan against live test server
42c scan openapi.yaml --target http://localhost:8080

5. Review Checklist for Agents

When reviewing or authoring an API contract:

  1. [ ] Is security defined at root and per-endpoint?
  2. [ ] Does every string have maxLength and a pattern or format?
  3. [ ] Does every numeric value have minimum and maximum?
  4. [ ] Does every array have maxItems?
  5. [ ] Is additionalProperties: false set on all request payload schemas?
  6. [ ] Are all error status codes (400, 401, 403, 404, 429, 500) documented with schemas?
  7. [ ] Are internal/admin paths guarded by distinct role scopes?
  8. [ ] Has the audit score achieved ≥ 85/100?

Security

  • Security scanPassed, 98 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/mejbaurbahar/software-tester-skills/42crunch-api-security-testing/badge)](https://verified-skill.com/skills/mejbaurbahar/software-tester-skills/42crunch-api-security-testing)

Something wrong with this skill or its page? Tell us.