HIGH sandbox escapejwt tokens
Sandbox Escape with Jwt Tokens
How Sandbox Escape Manifests in Jwt Tokens
Server-Side Request Forgery (SSRF) in JWT implementations often occurs when JWT libraries or middleware make outbound requests during token validation. A classic sandbox escape pattern emerges when JWT verification processes fetch public keys from remote endpoints using URLs provided in the token header.
Jwt Tokens-Specific Detection
Detecting SSRF sandbox escapes in JWT implementations requires both static analysis and runtime scanning. Static analysis should flag any code that:
- Extracts URLs from JWT headers (jku, x5u, or custom fields)
- Makes HTTP requests during token validation
- Resolves external references in security configurations
- Uses dynamic key loading based on token content
Runtime detection with middleBrick specifically targets JWT SSRF patterns:
Jwt Tokens-Specific Remediation
Remediating JWT SSRF sandbox escapes requires eliminating dynamic URL resolution and implementing strict allowlisting. The most secure approach is to use pre-configured, trusted keys: