igbuend/grimbard/encoding-bypass-anti-pattern
Claude Code and agent skill by igbuend/grimbard
- community
Checking that the SKILL.md file is still in the repository.
Security anti-pattern for encoding bypass vulnerabilities (CWE-838). Use when generating or reviewing code that handles URL encoding, Unicode normalization, or character set conversions before security validation. Detects validation before normalization and double-encoding issues.
Install
npx vskill@latest install igbuend/grimbard/encoding-bypass-anti-patternSKILL.md
Encoding Bypass Anti-Pattern
Severity: High
Summary
Encoding bypass evades security checks via alternate encodings. Occurs when validation happens before decoding/normalization. Encoded payload appears safe but becomes malicious after processing. Bypasses WAFs, input filters, enables XSS and SQL injection.
The Anti-Pattern
Flawed order of operations: Validate then Decode/Normalize. Security checks run on encoded data, application later uses decoded version, re-introducing the vulnerability.
BAD Code Example
GOOD Code Example
JavaScript/Node.js Examples
BAD:
GOOD:
Java Examples
BAD:
GOOD:
Detection
Python:
- Validation before
unicodedata.normalize() - Input checks before
urllib.parse.unquote() - Regex patterns before string normalization
- HTML entity validation before
html.unescape()
JavaScript/Node.js:
- Validation before
decodeURIComponent() - Path checks before
path.normalize() - Express middleware order (validate before decode)
- Input checks before
Buffer.from(input, 'base64')
Java:
- Validation before
URLDecoder.decode() - Security checks before
Normalizer.normalize() - Input validation before
StringEscapeUtils.unescapeHtml() - Path validation before
Paths.get().normalize()
PHP:
- Validation before
urldecode() - Input checks before
html_entity_decode() - Path validation before
realpath()
Search Patterns:
- Grep:
normalize\(|decode\(|unescape\(|URLDecoder|decodeURIComponent - Look for validation logic (if statements, regex) before these functions
- Check for double decoding: multiple decode calls in sequence
- Review web framework routing (automatic decoding may occur)
Common Encoding Bypass Techniques:
- URL encoding:
%3cfor<,%2e%2e%2ffor../ - Double URL encoding:
%253cfor<(decoded twice) - Unicode variants:
<(U+FF1C) for< - HTML entities:
<or<for< - Unicode escapes:
\u003cfor< - Mixed encoding:
%u003cor%c0%bcfor< - Path traversal:
..%2f,..%5c,%2e%2e/
Prevention
- [ ] Normalize/decode before validation: Always bring data to its simplest, canonical form before performing any security checks on it.
- [ ] Use parameterized queries (for SQL) and other safe APIs that handle encoding internally. This is the best defense against injection attacks.
- [ ] Enforce strict character encoding for all input (e.g., reject any data that is not valid UTF-8).
- [ ] Be aware of implicit decoding performed by your web framework or libraries and ensure your validation logic runs after it.
- [ ] Canonicalize paths and URLs before validating them to prevent path traversal attacks.
Testing for Encoding Bypass
Manual Testing:
- Test URL encoding:
%3cscript%3e,..%2f..%2f - Test double encoding:
%253cscript%253e,..%252f..%252f - Test Unicode variants:
<script>,../ - Test HTML entities:
<script>,<script> - Test mixed encoding:
%u003cscript%u003e - Verify filters catch all encoding variants
Automated Testing:
- Static Analysis: Semgrep, CodeQL to detect validation-before-decode patterns
- DAST: Burp Suite Intruder with encoding payloads, OWASP ZAP fuzzer
- Payload Lists: SecLists encoding bypass payloads
- Custom Scripts: Automated encoding variant generation
Example Test:
Burp Suite Test:
Remediation Steps
- Identify decoding operations - Use detection patterns to find decode/normalize functions
- Trace data flow - Follow user input from entry to security validation
- Check validation order - Verify decode/normalize happens before validation
- Reverse order if needed - Move normalization before security checks
- Add missing normalization - Insert decode/normalize if absent
- Test with encoding variants - Use payload list from Testing section
- Verify canonicalization - Ensure all paths/URLs are normalized
- Review framework behavior - Check for automatic decoding in web framework
Related Security Patterns & Anti-Patterns
- SQL Injection Anti-Pattern: A common goal of encoding bypass attacks.
- Cross-Site Scripting (XSS) Anti-Pattern: Often enabled by bypassing filters with encoded payloads.
- Path Traversal Anti-Pattern: Can be achieved by using encoded representations of
../. - Unicode Security Anti-Pattern: A collection of issues related to handling Unicode securely.
References
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/encoding-bypass-anti-pattern/SKILL.md
Popularity
- Repository stars
- 4
- Repository forks
- 1
- 7-day trend score
- 8
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/igbuend/grimbard/encoding-bypass-anti-pattern)