Skip to content

OWASP ASVS Compliance

Standard: OWASP Application Security Verification Standard v4.0.3 Target Level: Level 1 (with partial Level 2 coverage) Self-Assessment Date: February 2026 Product Version: 1.5.x License: Apache 2.0 (open source core)


Overview

ContractShield is a runtime API security middleware that validates every HTTP request against the application’s OpenAPI contract before it reaches business logic. This document maps ContractShield’s capabilities to specific OWASP ASVS requirements that it helps applications satisfy.

ContractShield does not replace a full ASVS compliance program. It is a security control that addresses specific verification requirements, particularly in input validation, API security, and business logic protection.


ASVS Coverage Summary

ASVS ChapterCoverageRole
V1 — Architecture, Design & Threat ModelingPartialEnforces contract-first design
V4 — Access ControlPartialCEL invariants enforce business rules
V5 — Validation, Sanitization & EncodingStrongCore capability
V7 — Error Handling & LoggingPartialStructured security event logging
V8 — Data ProtectionPartialBlocks exfiltration of unexpected fields
V12 — Files & ResourcesPartialPath traversal prevention
V13 — API & Web ServiceStrongCore capability
V14 — ConfigurationPartialSecure defaults, deny-by-default

V5 — Validation, Sanitization & Encoding

This is ContractShield’s primary domain. Every request is validated against the OpenAPI specification before reaching application code.

RequirementDescriptionStatusHow ContractShield addresses it
5.1.1HTTP parameter pollution prevention✅ MetContract validation rejects parameters not defined in the OpenAPI spec
5.1.2Framework mass assignment protections✅ MetRejects any field not explicitly defined in the request schema — core feature
5.1.3Positive validation (allowlisting)✅ MetAllowlist-by-design: only fields defined in the OpenAPI contract are accepted
5.1.4Structured data strongly typed and validated✅ MetJSON Schema validation enforces types, formats, patterns, min/max on every field
5.1.5URL redirects/forwards to allowlisted destinationsPartialSSRF detection blocks internal IP ranges and dangerous protocols
5.2.2Unstructured data sanitizedPartialDetects injection patterns in string fields
5.2.4SQL injection prevention✅ MetDetects SQL injection patterns; Pro sink-aware RASP traces to database layer
5.2.5NoSQL injection prevention✅ MetDetects NoSQL operators ($gt, $ne, $where, etc.) in request payloads
5.2.6LDAP injection preventionPartialDetects common LDAP injection patterns
5.2.7OS command injection prevention✅ MetDetects backticks, $(), pipes, semicolons, &&, || in payloads
5.2.8Path traversal prevention✅ MetDetects ../, encoded variants, and absolute path injection
5.3.3Output encoding (JSON)PartialEnforces response schema compliance (Pro)

V13 — API & Web Service Security

RequirementDescriptionStatusHow ContractShield addresses it
13.1.1All API responses match defined schemas✅ MetResponse validation against OpenAPI contract (Pro)
13.1.2API schema validation on all input✅ MetCore feature — every request validated against OpenAPI schema
13.1.3RESTful API accepts only defined content types✅ MetContent-Type validation against spec
13.1.4Authorization checks on all endpointsPartialCEL invariants can enforce authorization rules
13.2.1Protection against mass assignment✅ MetRejects fields not in schema — primary defense
13.2.2JSON schema validation✅ MetFull JSON Schema draft-07 validation
13.2.5RESTful services validate incoming content type✅ MetValidates Content-Type header against spec

V4 — Access Control

RequirementDescriptionStatusHow ContractShield addresses it
4.1.1Trusted enforcement point for access controlPartialMiddleware enforces contract before business logic executes
4.1.2Deny by default✅ MetAllowlist model: undefined = denied
4.2.1Sensitive data/API protected against IDORPartialBOLA/IDOR auto-detection planned (v1.6); CEL invariants can enforce ownership checks now

V1 — Architecture, Design & Threat Modeling

RequirementDescriptionStatusHow ContractShield addresses it
1.1.6Centralized security controls✅ MetSingle middleware enforces policy across all endpoints
1.1.7Enforcement of security controls server-side✅ MetAll validation is server-side, cannot be bypassed by client
1.5.2Input validation approach documented✅ MetOpenAPI spec IS the documentation of validation rules

V7 — Error Handling & Logging

RequirementDescriptionStatusHow ContractShield addresses it
7.1.1Log security-relevant events✅ MetAll violations logged with timestamp, method, path, violation type, action taken
7.1.2Log all access control failures✅ MetAll rejected requests logged with details
7.1.4Each log event includes sufficient context✅ MetStructured JSON logs with IP, path, method, violation, mode

V12 — Files & Resources

RequirementDescriptionStatusHow ContractShield addresses it
12.3.1Path traversal prevention✅ MetDetects ../ and encoded path traversal in all string fields
12.3.2File paths from user input not directly usedPartialBlocks path traversal patterns in request payloads

V14 — Configuration

RequirementDescriptionStatusHow ContractShield addresses it
14.2.1Component dependencies up to date✅ MetAutomated dependency updates via Dependabot
14.4.1Deny unknown HTTP methodsPartialValidates HTTP method against OpenAPI spec

Attack Vectors & CWE Mapping

ContractShield provides runtime protection against these attack categories:

AttackCWEOWASP API Top 10Detection
Mass AssignmentCWE-915API6:2023Schema allowlisting — extra fields rejected
Prototype PollutionCWE-1321—Semantic detection of __proto__, constructor, prototype keys
SQL InjectionCWE-89API8:2023Pattern + sink-aware RASP (Pro)
NoSQL InjectionCWE-943API8:2023MongoDB/Mongoose operator detection
Command InjectionCWE-78API8:2023Shell metacharacter detection
SSRFCWE-918API7:2023Internal IP, localhost, dangerous protocol detection
Path TraversalCWE-22API8:2023Encoded and raw ../ detection
BOLA/IDORCWE-639API1:2023CEL invariants + auto-detection (v1.6)
Excessive Data ExposureCWE-213API3:2023Response schema enforcement (Pro)

What ContractShield Does NOT Cover

For a complete ASVS compliance program, these areas require additional controls:

AreaASVS ChapterRecommended Tooling
AuthenticationV2Your auth framework (Passport, Spring Security, etc.)
Session ManagementV3Your session library + secure defaults
CryptographyV6Your TLS termination + encryption libraries
File Upload ValidationV12 (partial)Dedicated file validation + virus scanning
Business Logic (complex)V10Application-specific logic + testing
CommunicationsV9TLS/mTLS at infrastructure level

Verification

This self-assessment can be verified by:

  1. Code review — ContractShield is open source under Apache 2.0
  2. Testing — Run the included test suite: npm test / pytest / mvn test
  3. Penetration testing — We use ContractShield on our own PTaaS platform (ptaas.contractshield.dev) in block mode
  4. Independent audit — We welcome third-party security assessments

Last updated: February 2026 — ContractShield v1.5.x