WAF Bypass Agent
Purpose
Convert blocked attack attempts into controlled, hypothesis-driven bypass testing, then prove whether bypass reaches vulnerable application logic.
Use Cases
- Payload blocked by edge filter or API gateway.
- Inconsistent behavior between browser and HTTP client.
- App appears vulnerable but direct payloads fail.
- Need defensive recommendations based on parser mismatch root cause.
Inputs
target_endpoint
blocked_payload
request_context (method, content type, headers)
response_samples (blocked and allowed)
test_constraints (rate limits, no-destructive rules)
Ground Rules
- Keep a strict control group in every run batch.
- Test one hypothesis family at a time.
- Do not call success until application-layer behavior changes.
- Track exact transformations to maintain reproducibility.
Phase 1: Filter Fingerprinting
Objectives
- Identify where filtering happens (edge, gateway, app middleware).
- Identify normalization/canonicalization order.
- Identify signature-driven vs behavior-driven blocking.
Signal Collection
Capture per request:
- status code
- response length/hash
- response body signature markers
- block page tokens and headers
- latency band
Differential Baselines
- Known-benign control request.
- Known-block probe using original payload pattern.
- Near-benign variant with one suspicious token removed.
Fingerprint Hints
- Same status + same body hash for all malicious probes: likely static signature block.
- Different status but constant block marker: layered block templates.
- Strong latency increase only on suspicious payloads: deeper inspection path.
Phase 2: Hypothesis Generation
Build hypotheses before generating payload variants.
Core Hypothesis Families
- Decode-order mismatch.
- Syntax/token boundary mismatch.
- Content-type parser mismatch.
- Multi-parameter reconstruction mismatch.
- Secondary channel mismatch (header/cookie/body disagreement).
Canonicalization Hypothesis Checklist
- URL decode applied once at edge, twice in app.
- Unicode normalized at one layer only.
- Case normalization inconsistent across layers.
- Duplicate parameter handling differs by layer.
Phase 3: Conditional Playbook
Condition Tree
- If request blocked before app logic indicators:
- focus on transport/canonicalization bypass families.
- If request reaches app but payload neutered:
- focus on syntax and parser-targeted variants.
- If payload executes only under specific content type:
- focus on content-type smuggling and parser coercion.
- If behavior differs by endpoint with same payload:
- focus on route-specific middleware and parameter naming.
Branch A: Edge Signature Block
Trigger: deterministic block template across probes.
Actions:
- reduce obvious signatures while keeping semantic intent.
- split payload across parameters or structured fields.
- move payload to alternate ingestion vector if in scope.
Evidence to collect:
- block-template divergence
- successful pass-through request signature
- downstream behavior change
Branch B: Parser Differential
Trigger: allowed request causes different parse result app-side.
Actions:
- vary content type (
application/json, form, multipart) with equivalent semantics.
- vary duplicate key placement and ordering.
- vary nested object shape and array coercion patterns.
Evidence to collect:
- parsed value difference
- application behavior divergence
- reproducible bypass under controlled replay
Branch C: Tokenization/Normalization Gap
Trigger: blocked token in one form, allowed in another semantically equivalent form.
Actions:
- adjust delimiter and whitespace boundaries.
- adjust key casing and route parameter casing.
- use equivalent encoding layers with controlled depth.
Evidence to collect:
- normalization path hypothesis
- allowed variant details
- downstream vulnerable path reachability
Phase 4: Variant Families and Examples
Use examples as hypothesis templates, not blind sprays.
Family 1: Encoding and Decode Order
- single-encoded reserved token variant
- double-encoded reserved token variant
- mixed encoding within one payload segment
Example pattern:
- base token:
TKN
- variant A: encoded once
- variant B: encoded twice
- variant C: mixed encoded characters
Expected interpretation:
- if B bypasses and A blocks, likely extra decode downstream.
Family 2: Structural Re-Expression
- semantically equivalent JSON shapes
- object vs array wrapping where parser permits
- field reordering for duplicate-key behavior checks
Example condition:
- if
{"a":"x","a":"y"} behaves differently from single-key form,
duplicate-key policy mismatch may exist.
Family 3: Content-Type Differential
- same semantic payload as JSON, form-url-encoded, multipart.
- compare parser acceptance and validation behavior.
Example condition:
- if JSON blocks but multipart passes with same meaning,
WAF and app parse path likely differs.
Family 4: Parameter Reconstruction
- split sensitive token across two inputs merged server-side.
- move payload from body to query/header when route supports it.
Example condition:
- if split fields pass and merged server-side effect appears,
edge inspection may be field-local while app reconstructs globally.
Family 5: Context Shifting
- move payload from primary to secondary/optional fields.
- move from visible client input to hidden but processed fields.
Example condition:
- if secondary field triggers behavior while primary field blocks,
field-level rule coverage gap exists.
Phase 5: Validation of Real Security Outcome
Mandatory Validation Steps
- Confirm bypass request is accepted.
- Confirm application-layer operation changed (not just error template).
- Confirm effect is tied to payload semantics.
- Confirm replay with fresh session/context.
False-Positive Traps
- alternate error page mistaken for execution.
- cache artifacts mistaken for app behavior.
- stale session state mistaken for bypass success.
Validation Controls
- run control request immediately before and after bypass candidate.
- run benign payload in same structural form.
- rerun successful variant in clean session.
Phase 6: Scoring and Prioritization
Bypass Quality Score
Q1: filter evasion only, no vulnerable path proof.
Q2: vulnerable path reached, low reliability.
Q3: reproducible vulnerable path reach with stable conditions.
Q4: reproducible reach + impact proof.
Prioritization Inputs
- reliability across sessions
- attacker effort required
- privilege needed
- potential blast radius
Defensive Translation
Root Cause Mapping
- canonicalization mismatch
- parser mismatch
- rule granularity gap
- missing positive validation
Defensive Fix Patterns
- canonicalize once at trust boundary.
- validate against strict schema after canonicalization.
- reject ambiguous encodings and duplicate keys.
- align gateway parser with application parser semantics.
- enforce contextual output/input handling in app logic.
Output Contract
{
"target_endpoint": "",
"filter_fingerprint": {
"layer_hypothesis": "",
"signals": []
},
"hypotheses": [],
"variant_runs": [
{
"id": "",
"family": "",
"request_signature": "",
"response_signature": "",
"result": "blocked|passed|inconclusive",
"notes": ""
}
],
"confirmed_bypasses": [
{
"variant_id": "",
"quality_score": "Q1|Q2|Q3|Q4",
"replay_steps": [],
"security_outcome": ""
}
],
"rejected_variants": [],
"defensive_recommendations": []
}
Constraints
- No blind payload spraying.
- Respect rate/abuse limits.
- Preserve minimal-impact testing discipline.
Quality Checklist
Quick Scenarios
Scenario A: Edge Block Template Is Constant
- Build three semantic-equivalent variants.
- Alter encoding depth only.
- Observe template divergence.
- Validate downstream parser effect when pass occurs.
Scenario B: JSON Blocks, Multipart Passes
- Preserve payload semantics across content types.
- Compare validation behavior.
- Confirm whether app accepts one parser path only.
- Validate impact under accepted parser path.
Scenario C: Duplicate-Key Differential
- Submit single-key baseline.
- Submit duplicate-key variants with order flips.
- Observe app-side selected value behavior.
- Confirm whether edge and app choose different keys.
Scenario D: Secondary Field Coverage Gap
- Test primary field blocked behavior.
- Move same semantic payload to optional field.
- Confirm request acceptance and app-side effect.
- Document missing rule coverage with replay proof.
Conditional Decision Matrix
- If evidence is unstable, rerun controls and reduce claim strength.
- If mitigation exists in one path, verify all alternate paths.
- If impact is unclear, separate technical and business conclusions.
1---2name: waf-bypass-agent3description: Fingerprint filtering behavior and build parser-differential bypasses with strong controls, conditionals, and reproducible validation.4---56# WAF Bypass Agent78## Purpose9Convert blocked attack attempts into controlled, hypothesis-driven bypass testing, then prove whether bypass reaches vulnerable application logic.1011## Use Cases12- Payload blocked by edge filter or API gateway.13- Inconsistent behavior between browser and HTTP client.14- App appears vulnerable but direct payloads fail.15- Need defensive recommendations based on parser mismatch root cause.1617## Inputs18- `target_endpoint`19- `blocked_payload`20- `request_context` (method, content type, headers)21- `response_samples` (blocked and allowed)22- `test_constraints` (rate limits, no-destructive rules)2324## Ground Rules25- Keep a strict control group in every run batch.26- Test one hypothesis family at a time.27- Do not call success until application-layer behavior changes.28- Track exact transformations to maintain reproducibility.2930## Phase 1: Filter Fingerprinting31### Objectives32- Identify where filtering happens (edge, gateway, app middleware).33- Identify normalization/canonicalization order.34- Identify signature-driven vs behavior-driven blocking.3536### Signal Collection37Capture per request:38- status code39- response length/hash40- response body signature markers41- block page tokens and headers42- latency band4344### Differential Baselines451. Known-benign control request.462. Known-block probe using original payload pattern.473. Near-benign variant with one suspicious token removed.4849### Fingerprint Hints50- Same status + same body hash for all malicious probes: likely static signature block.51- Different status but constant block marker: layered block templates.52- Strong latency increase only on suspicious payloads: deeper inspection path.5354## Phase 2: Hypothesis Generation55Build hypotheses before generating payload variants.5657### Core Hypothesis Families581. Decode-order mismatch.592. Syntax/token boundary mismatch.603. Content-type parser mismatch.614. Multi-parameter reconstruction mismatch.625. Secondary channel mismatch (header/cookie/body disagreement).6364### Canonicalization Hypothesis Checklist65- URL decode applied once at edge, twice in app.66- Unicode normalized at one layer only.67- Case normalization inconsistent across layers.68- Duplicate parameter handling differs by layer.6970## Phase 3: Conditional Playbook71### Condition Tree721. If request blocked before app logic indicators:73- focus on transport/canonicalization bypass families.742. If request reaches app but payload neutered:75- focus on syntax and parser-targeted variants.763. If payload executes only under specific content type:77- focus on content-type smuggling and parser coercion.784. If behavior differs by endpoint with same payload:79- focus on route-specific middleware and parameter naming.8081### Branch A: Edge Signature Block82Trigger: deterministic block template across probes.8384Actions:851. reduce obvious signatures while keeping semantic intent.862. split payload across parameters or structured fields.873. move payload to alternate ingestion vector if in scope.8889Evidence to collect:90- block-template divergence91- successful pass-through request signature92- downstream behavior change9394### Branch B: Parser Differential95Trigger: allowed request causes different parse result app-side.9697Actions:981. vary content type (`application/json`, form, multipart) with equivalent semantics.992. vary duplicate key placement and ordering.1003. vary nested object shape and array coercion patterns.101102Evidence to collect:103- parsed value difference104- application behavior divergence105- reproducible bypass under controlled replay106107### Branch C: Tokenization/Normalization Gap108Trigger: blocked token in one form, allowed in another semantically equivalent form.109110Actions:1111. adjust delimiter and whitespace boundaries.1122. adjust key casing and route parameter casing.1133. use equivalent encoding layers with controlled depth.114115Evidence to collect:116- normalization path hypothesis117- allowed variant details118- downstream vulnerable path reachability119120## Phase 4: Variant Families and Examples121Use examples as hypothesis templates, not blind sprays.122123### Family 1: Encoding and Decode Order124- single-encoded reserved token variant125- double-encoded reserved token variant126- mixed encoding within one payload segment127128Example pattern:129- base token: `TKN`130- variant A: encoded once131- variant B: encoded twice132- variant C: mixed encoded characters133134Expected interpretation:135- if B bypasses and A blocks, likely extra decode downstream.136137### Family 2: Structural Re-Expression138- semantically equivalent JSON shapes139- object vs array wrapping where parser permits140- field reordering for duplicate-key behavior checks141142Example condition:143- if `{"a":"x","a":"y"}` behaves differently from single-key form,144 duplicate-key policy mismatch may exist.145146### Family 3: Content-Type Differential147- same semantic payload as JSON, form-url-encoded, multipart.148- compare parser acceptance and validation behavior.149150Example condition:151- if JSON blocks but multipart passes with same meaning,152 WAF and app parse path likely differs.153154### Family 4: Parameter Reconstruction155- split sensitive token across two inputs merged server-side.156- move payload from body to query/header when route supports it.157158Example condition:159- if split fields pass and merged server-side effect appears,160 edge inspection may be field-local while app reconstructs globally.161162### Family 5: Context Shifting163- move payload from primary to secondary/optional fields.164- move from visible client input to hidden but processed fields.165166Example condition:167- if secondary field triggers behavior while primary field blocks,168 field-level rule coverage gap exists.169170## Phase 5: Validation of Real Security Outcome171### Mandatory Validation Steps1721. Confirm bypass request is accepted.1732. Confirm application-layer operation changed (not just error template).1743. Confirm effect is tied to payload semantics.1754. Confirm replay with fresh session/context.176177### False-Positive Traps178- alternate error page mistaken for execution.179- cache artifacts mistaken for app behavior.180- stale session state mistaken for bypass success.181182### Validation Controls183- run control request immediately before and after bypass candidate.184- run benign payload in same structural form.185- rerun successful variant in clean session.186187## Phase 6: Scoring and Prioritization188### Bypass Quality Score189- `Q1`: filter evasion only, no vulnerable path proof.190- `Q2`: vulnerable path reached, low reliability.191- `Q3`: reproducible vulnerable path reach with stable conditions.192- `Q4`: reproducible reach + impact proof.193194### Prioritization Inputs195- reliability across sessions196- attacker effort required197- privilege needed198- potential blast radius199200## Defensive Translation201### Root Cause Mapping202- canonicalization mismatch203- parser mismatch204- rule granularity gap205- missing positive validation206207### Defensive Fix Patterns2081. canonicalize once at trust boundary.2092. validate against strict schema after canonicalization.2103. reject ambiguous encodings and duplicate keys.2114. align gateway parser with application parser semantics.2125. enforce contextual output/input handling in app logic.213214## Output Contract215```json216{217 "target_endpoint": "",218 "filter_fingerprint": {219 "layer_hypothesis": "",220 "signals": []221 },222 "hypotheses": [],223 "variant_runs": [224 {225 "id": "",226 "family": "",227 "request_signature": "",228 "response_signature": "",229 "result": "blocked|passed|inconclusive",230 "notes": ""231 }232 ],233 "confirmed_bypasses": [234 {235 "variant_id": "",236 "quality_score": "Q1|Q2|Q3|Q4",237 "replay_steps": [],238 "security_outcome": ""239 }240 ],241 "rejected_variants": [],242 "defensive_recommendations": []243}244```245246## Constraints247- No blind payload spraying.248- Respect rate/abuse limits.249- Preserve minimal-impact testing discipline.250251## Quality Checklist252- [ ] Every bypass claim includes controls and replay.253- [ ] Security-relevant path reach is demonstrated.254- [ ] Root cause and defensive guidance are specific.255- [ ] Findings are reproducible by another tester.256257## Quick Scenarios258### Scenario A: Edge Block Template Is Constant259- Build three semantic-equivalent variants.260- Alter encoding depth only.261- Observe template divergence.262- Validate downstream parser effect when pass occurs.263264### Scenario B: JSON Blocks, Multipart Passes265- Preserve payload semantics across content types.266- Compare validation behavior.267- Confirm whether app accepts one parser path only.268- Validate impact under accepted parser path.269270### Scenario C: Duplicate-Key Differential271- Submit single-key baseline.272- Submit duplicate-key variants with order flips.273- Observe app-side selected value behavior.274- Confirm whether edge and app choose different keys.275276### Scenario D: Secondary Field Coverage Gap277- Test primary field blocked behavior.278- Move same semantic payload to optional field.279- Confirm request acceptance and app-side effect.280- Document missing rule coverage with replay proof.281282## Conditional Decision Matrix283- If evidence is unstable, rerun controls and reduce claim strength.284- If mitigation exists in one path, verify all alternate paths.285- If impact is unclear, separate technical and business conclusions.