
ghost-bits-cast-attack
Java "Ghost Bits" / Cast Attack playbook (Black Hat Asia 2026)
by yaklangFree
Description
Ghost Bits and Cast Attack is an agent skill from the yaklang hack-skills collection, listed on skills.sh. It is a playbook for Java services where a 16-bit char is silently narrowed to an 8-bit byte. When that happens, the high bits are lost, so a Unicode character that looks harmless to a WAF or IDS can be turned back into an ASCII attack byte by the backend. The page treats this as a Java-only primitive rather than a standalone vulnerability class, and lists the kinds of attack it can help test: SQL injection, deserialization, file upload, path traversal, CRLF, request smuggling and SMTP injection. It is based on a Black Hat Asia 2026 talk titled Cast Attack: A New Threat Posed by Ghost Bits in Java, by Xinyu Bai and Zhihui Chen, with a contributor credited on the page.…
Highlights
- Explains the 16-bit to 8-bit char narrowing in Java
- Covers SQLi, deserialization, upload and path traversal cases
- Covers CRLF, request smuggling and SMTP injection cases
- Based on a Black Hat Asia 2026 talk
Ratings & Reviews
No ratings yet
Be the first to rate ghost-bits-cast-attack.
People also visit
ghost-bits-cast-attack FAQ
What is the Ghost Bits primitive?
In Java, a 16-bit char that is narrowed to an 8-bit byte loses its high 8 bits. The page explains that this can change what a WAF sees compared with what the backend reconstructs.
Which attack types does the skill list?
SQL injection, deserialization RCE, file upload, path traversal, CRLF, request smuggling and SMTP injection, each as a case where the page says a Ghost Bits variant should be tried.
How do I install it?
Run: npx skills add https://github.com/yaklang/hack-skills --skill ghost-bits-cast-attack
Which security audits does it show?
Gen Agent Trust Hub: Pass. Socket: Warn. Snyk: Pass.
What are the best ghost-bits-cast-attack alternatives?
Popular alternatives to ghost-bits-cast-attack include binary-protection-bypass, jndi-injection and vm-and-bytecode-reverse. See all ghost-bits-cast-attack alternatives









