Looking for an overview? See the AWS WAF product page
Resolving AWS WAF 403 Errors
AWS WAF uses cryptographic puzzles to verify requests. When requests lack a valid aws-waf-token cookie, servers return 403 errors with an embedded JavaScript challenge. MeshPrivacy solves these puzzles server-side and returns valid tokens with 5-10 minute TTL.
Error Codes
| Code | Meaning | Resolution |
|---|---|---|
| 403 | Challenge required or token invalid | Generate valid aws-waf-token via API |
| 200 | Challenge HTML with JavaScript puzzle | Solve embedded cryptographic challenge |
Token TTL: 5-10 minutes depending on WAF configuration.
Real-time API status: trust.meshprivacy.com
Challenge Parameters
Parameters from Challenge Response
key - Encryption key for puzzleiv - Initialization vectorcontext - Challenge context identifiergokuProps - Configuration objectThese parameters are encrypted with AES and require computational solving.
Cookie Format
aws-waf-token Cookie
- URL-safe Base64 encoded
- Contains encrypted challenge solution
- Session-specific binding
- Expiration timestamp included
Integration Example
aws-waf.js
// Submit AWS WAF task to MeshPrivacy
const response = await fetch('https://api.meshprivacy.com/v1/tasks/submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': API_KEY
},
body: JSON.stringify({
service: 'aws', // AWS WAF service identifier (DB endpoint_id is "aws", not "aws_waf")
url: 'https://target-site.com/',
script_url: 'https://target-site.com/aws-waf/challenge.js', // WAF challenge script
proxy_config: 'http://user:pass@ip:port', // Your proxy
user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36...'
})
});
const { task_id } = await response.json();
// Poll for result
const result = await fetch(`https://api.meshprivacy.com/v1/tasks/result/${task_id}`, {
headers: { 'X-API-Key': API_KEY }
});
const { cookies } = await result.json();
// Use cookies['aws-waf-token'] - valid for 5-10 minutesFAQ
AWS WAF requires solving an AES-encrypted computational puzzle. The challenge parameters (key, iv, context) are extracted from the response and used to compute the valid token.
