
Ghost Bits Cast Attack
If you're pentesting Java backends behind a WAF and your SQLi, deserialization, or path traversal payloads keep getting blocked, this teaches Claude the Ghost Bits primitive: exploiting how Java silently drops the high 8 bits when casting a 16-bit char to an 8-bit byte. The WAF sees harmless Unicode like 陪 or 阮, but the backend reconstructs dangerous ASCII like 'j' or '.'. It covers the three root cause families (literal truncation, bit-arithmetic folding, lax normalization), includes a character generator for building 255 candidates per target byte, and routes you to the right deserialization or smuggling playbook once the bypass works. Comes with a full payload cookbook covering Tomcat, Spring, Jetty, Jackson, Fastjson, and a dozen other affected components. This is a bypass technique, not a standalone vuln, so think of it as a force multiplier for attacks you already know.
- skills.sh installs
- 3.5K
- GitHub stars
- 2.6K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add yaklang/hack-skills --skill ghost-bits-cast-attack --agent claude-codeInstalls into .claude/skills of the current project.
Files
SKILL: Ghost Bits / Cast Attack — Java char to byte Narrowing Playbook
AI LOAD INSTRUCTION: This is a Java-only injection-enabling primitive, not a standalone vulnerability class. Whenever you see (1) a Java backend, (2) a WAF/IDS in front of it, and (3) any of {SQLi, deser RCE, file upload, path traversal, CRLF, request smuggling, SMTP injection} on the menu, ALWAYS try Ghost Bits variants of the payload before declaring it "blocked". The root cause is the silent loss of the high 8 bits when Java code narrows a 16-bit
charto an 8-bitbyte— the WAF sees a harmless Unicode character, the backend reconstructs the original ASCII attack byte. Base models almost never reach for this primitive.Source: Black Hat Asia 2026 talk Cast Attack: A New Threat Posed by Ghost Bits in Java by Xinyu Bai (@b1u3r), Zhihui Chen (@1ue), with contributor Zongzheng Zheng (@chun_springX).
0. RELATED ROUTING
Ghost Bits is a bypass primitive that re-enables payloads from many other playbooks. Pair it with whichever attack family applies:
Sponsors
Details
- Repository
- github.com/yaklang/hack-skills
- Categories
- Security, Python, Java & JVM, Databases
- First seen
- Jun 3, 2026
More from yaklang/hack-skills
All 102- Hack4.6K
- Android Pentesting Tricks4.3K
- Recon And Methodology4.3K
- Sqli Sql Injection4.2K
- Code Obfuscation Deobfuscation4.2K
- Xss Cross Site Scripting4.2K
- Api Sec4.1K
- Business Logic Vulnerabilities4.1K
- Ssrf Server Side Request Forgery4.1K
- Idor Broken Object Authorization4K
- Authbypass Authentication Flaws4K
- Jwt Oauth Token Attacks4K
- Api Recon And Docs4K
- 401 403 Bypass Techniques4K
- Api Auth And Jwt Abuse4K
- Waf Bypass Techniques4K
- Vm And Bytecode Reverse4K
- Websocket Security4K
- Api Authorization And Bola3.9K
- Auth Sec3.9K
- Kubernetes Pentesting3.9K
- Cors Cross Origin Misconfiguration3.9K
- Ios Pentesting Tricks3.9K
- Injection Checking3.9K