JSON Security Specifications (24 KB)
โ๏ธ Protocol Overview
The Aevum Zenth JSON Security Specification defines the standardized payload structure, authentication flow, encryption parameters, and validation rules for all internal and external API communications. The 24 KB variant is optimized for constrained environments, edge nodes, and high-throughput microservices.
๐ Authentication & Authorization
All JSON payloads must carry an opaque bearer token via the standard header. Token validation occurs before deserialization to prevent injection and resource exhaustion attacks.
{
"Authorization: Bearer az_eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9...
"X-AZ-Request-ID: uuid-v7:01J7X...4k2p
"X-AZ-Client-Version: 24kb-spec/4.2.0
}
| Header | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | JWT with ES256 signature, max lifetime 15m |
X-AZ-Request-ID | string | Yes | UUIDv7 for distributed tracing & audit logs |
X-AZ-Scope | string[] | Conditional | Comma-separated resource scopes (e.g., `read:data,write:config`) |
๐ Payload Encryption
Sensitive payloads must be encrypted using AES-256-GCM with ECDH key exchange (P-256 curve). The JSON wrapper contains metadata for decryption context.
{
"version: 1,
"enc: "A256GCM",
"kid: "az-edge-north-04",
"iv: "base64:8x3kL9mP0qR2tV5w",
"payload: "base64:encrypted_hex_stream_here"
}
Decryption services must validate the `kid` against the active key rotation schedule. Expired keys automatically trigger a 401.04 response.
๐ Schema Validation
All inbound/outbound JSON must conform to JSON Schema Draft 2020-12. The 24 KB module enforces strict type coercion and rejects unknown keys by default.
- Required fields are validated before business logic execution
- String lengths are capped at 4096 bytes to prevent buffer attacks
- Numbers are restricted to 64-bit IEEE 754 range
- Arrays are limited to 1000 elements maximum
- Objects reject duplicate keys per RFC 8259 ยง1.2 (enforced via strict parser)
๐ฆ 24 KB Module Constraints
This specification is tailored for environments with strict memory budgets (edge devices, IoT gateways, high-density containers). The following hard limits apply:
| Parameter | Limit | Fallback |
|---|---|---|
| Parsed JSON Size | 24,576 bytes | Truncate + 413 Payload Too Large |
| Max Nesting Depth | 6 levels | Reject with 400.02 |
| Allocation Budget | โค 32 KB RSS | Switch to zero-copy stream parser |
| Parse Timeout | 5 ms | Abort & queue for retry |
compact serialization flag to strip whitespace and shorten key aliases. This typically reduces payloads by 18-22% without loss of semantic integrity.
๐ก๏ธ Mandatory Security Headers
Every response from Aevum Zenth endpoints must include the following security headers to enforce transport and application-level protections.
| Header | Value | Purpose |
|---|---|---|
Content-Type | application/json; charset=utf-8 | Prevent MIME sniffing |
X-Content-Type-Options | nosniff | Block content type override |
Strict-Transport-Security | max-age=31536000; includeSubDomains; preload | Enforce HTTPS |
X-AZ-Security-Level | enterprise | Internal compliance tagging |
Cache-Control | no-store, no-cache, must-revalidate | Prevent sensitive data caching |
โ ๏ธ Error Response Format
All error states return standardized JSON matching RFC 7807 (Problem Details) with Aevum Zenth extensions.
{
"type: "https://api.aevumzenth.com/errors/invalid-schema",
"title: "Schema Validation Failed",
"status: 400,
"code: "AZ_VALIDATION_ERR",
"detail: "Field 'payload.metadata' exceeded 24 KB limit.",
"instance: "/v4/authenticate"
}
๐ Compliance & Audit
This specification aligns with:
- ISO/IEC 27001:2022 (Information Security Management)
- NIST SP 800-171 (Controlled Unclassified Information)
- OWASP API Security Top 10 (2023 Edition)
- GDPR Art. 32 (Security of Processing)
Automated compliance scans run every 24 hours against all endpoints serving this spec. Audit logs are immutable and retained for 7 years per jurisdictional requirements.