They exploit differences in how layers normalise requests. If a gateway, WAF, and backend do not interpret encoding consistently, the attacker can hide path traversal or similar behaviour inside apparently valid input. The risk rises because the control meant to stop the attack is evaluating the wrong representation of the request.
How Double Encoding Creates a Representation Gap
Double-encoded payloads are dangerous because security controls often inspect one representation of a request while the backend ultimately processes another. If a WAF, API gateway, reverse proxy, or application layer decodes input at different times, the same bytes can mean something harmless at one layer and malicious at the next. That mismatch is the opening an attacker needs.
In practice, the problem is not the encoding itself, but inconsistent normalisation. A control that looks for path traversal, delimiter abuse, or dangerous characters can miss an attack if those characters are hidden behind one encoding pass and only revealed after another component decodes again. The more layers that touch the request, the more important consistent parsing becomes.
Double encoding also tends to defeat assumptions about “already validated” input. A request can appear safe after a gateway sanitises it, then become unsafe after the backend performs its own decoding or routing logic. That is why these payloads are especially effective in layered API architectures where the trust boundary is split across products and teams.
Where API Defences Commonly Fail
API risk increases when validation, filtering, and routing do not happen against the same canonical form of the request. For example, if one layer decodes OWASP API Security Top 10 style controls at the edge but the backend reinterprets the payload later, the attacker can smuggle behaviour past the first line of defence. The result is not just a filter bypass, but a control-plane blind spot.
This is especially relevant where path handling, query parsing, JSON decoding, or file and object selectors are involved. The attacker is trying to make the security layer evaluate the wrong version of the request, then let the application act on the more dangerous version. In those cases, the risk can extend from traversal and authorization bypass to injection-like effects, depending on what the backend does with the decoded value.
Layered APIs also create inconsistency risks between security products and application code. A WAF may normalise once, an API gateway may normalise differently, and the service may decode again or apply framework-specific parsing rules. If defenders have not tested those exact combinations, they can end up trusting a decision that was made on an incomplete or stale interpretation of the payload.
How to Reduce the Risk of Encoding Bypass
Defence starts with a single canonical interpretation of request data. Validate after normalisation, ensure every layer agrees on the same decoding rules, and make it explicit which component is responsible for rejecting malformed or ambiguous input. If the stack cannot guarantee consistent parsing, the safest assumption is that an attacker will find the weakest interpreter.
Test for inconsistent behaviour across the full request path, not just at the edge. Security review should include proxy, gateway, WAF, framework, and application parsing differences, because the exploit often depends on their mismatch rather than on any one component failing outright. This is one reason NIST Cybersecurity Framework 2.0 remains useful for structuring control ownership, validation, and continuous improvement around request handling.
For teams that manage APIs at scale, the practical goal is not to ban every encoding variant, but to make decoding predictable and observable. Document the canonicalisation rules, log the post-normalisation value that was actually evaluated, and treat ambiguous encodings as suspicious rather than convenient. That reduces the chance that one layer “cleans” a payload while another layer later turns it back into an exploit.
Risk and Threat Considerations
Double-encoded payloads are attractive because they exploit trust between layers, not just weaknesses in one parser. If the control and the application disagree about what the request means, the attacker can hide traversal, delimiter manipulation, or other payload structure long enough to reach a more privileged processing stage.
Failure mechanism: One component decodes or sanitises input, then another component decodes it again or interprets it under different rules, so the malicious form is only revealed after the first control has already allowed the request.
Impact: The attacker may bypass edge controls, reach restricted resources, trigger unintended backend behaviour, or move from a filtering failure into a broader API abuse path.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack and risk surface, while NIST CSF 2.0 sets the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP API Security Top 10 | API8 — Security Misconfiguration | Double encoding exploits inconsistent API parsing and normalisation across layers. |
| Recommendation — Standardize request canonicalization and reject ambiguous encodings before authorization or routing. | ||
| NIST CSF 2.0 | PR.DS-01 — Data-at-rest is protected | Consistent handling of data in transit and processing supports secure request validation paths. |
| PR.PS-01 — Configuration management | Layered parser and gateway settings must be controlled to prevent inconsistent decoding behavior. | |
| DE.CM-01 — Networks and network services are monitored | Monitoring can surface anomalous payload patterns and repeated bypass attempts. | |
| Recommendation — Define and enforce canonical request handling across gateways, WAFs, and services. Align decoding and validation settings across all API processing layers. Monitor for abnormal encoding patterns and repeated malformed request attempts. | ||
Practitioner Guidance
What to verify: Confirm that validation occurs on the final canonical form the backend will actually use, not on a pre-decoded representation. If different services decode differently, treat that as a design defect, not a tuning issue.
Common mistake: Teams often harden the WAF and assume the job is done. With encoding-based bypasses, the real question is whether the gateway, proxy, framework, and application all agree on the same request meaning.
Practitioner takeaway: The safest API design is one where a payload cannot become “more dangerous” after passing a security layer, because every layer applies the same canonicalisation rules before any decision is made.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org