Back to Skills

ghost-bits-cast-attack

Java "Ghost Bits" / Cast Attack playbook (Black Hat Asia 2026). Use when attacking Java services where 16-bit char is silently narrowed to 8-bit byte to bypass WAF/IDS for SQL injection, deserialization RCE, file upload (Webshell), path traversal, CRLF injection, request smuggling, and SMTP injection. Affects Tomcat, Spring, Jetty, Undertow, Vert.x, Jackson, Fastjson, Apache Commons BCEL, Apache HttpClient, Angus Mail, JDK HttpServer, Lettuce, Jodd, XMLWriter and re-enables many "patched" CVEs t

1,443stars192forksUpdated 7/24/2026

Security Assessment

Critical Risk(20/100)

Detected risks:

Offensive Security Exploitation Toolkit(Ships working WAF-bypass and injection/RCE exploitation payloads targeting Java stacks, Dual-use: intended for authorized red-team / penetration-testing engagements only)
Security Score20/100

About ghost-bits-cast-attack

ghost-bits-cast-attack is an offensive-security playbook documenting the Java "Ghost Bits" / Cast Attack technique presented at Black Hat Asia 2026. Its core primitive abuses the silent loss of the high 8 bits when Java code narrows a 16-bit char to an 8-bit byte: a WAF or IDS inspects a harmless-looking Unicode character while the backend reconstructs the original ASCII attack byte, re-enabling payloads a security filter would otherwise block.

The skill is a bypass primitive rather than a standalone vulnerability class. It packages routing guidance and payload variants for pairing the narrowing trick with common attack families — injection, deserialization RCE, file-upload webshells, path traversal, CRLF injection, HTTP request smuggling, and SMTP injection — and calls out affected components such as Tomcat, Spring, Jetty, Undertow, Vert.x, Jackson, Fastjson, Apache Commons BCEL, Apache HttpClient, Angus Mail, JDK HttpServer, Lettuce, Jodd, and XMLWriter. A companion cookbook collects concrete transformation recipes.

It is intended for authorized red-team engagements, penetration testing, and defensive research where testers must verify whether a Java stack behind a WAF is vulnerable to char-to-byte narrowing. Because it contains working exploitation payloads and is explicitly designed to defeat security controls, it should only ever be used against systems you have explicit written permission to test.

FAQ

What does the Ghost Bits / Cast Attack technique do?

It re-enables 'patched' or WAF-blocked payloads against Java backends by abusing the narrowing of a 16-bit char to an 8-bit byte, letting a tester confirm whether a filter can be bypassed even when the literal payload is rejected.

Which systems are in scope?

Java services sitting behind a WAF/IDS, across frameworks and libraries including Tomcat, Spring, Jetty, Undertow, Vert.x, Jackson, Fastjson, Apache Commons BCEL, Apache HttpClient, Angus Mail, JDK HttpServer, Lettuce, Jodd, and XMLWriter.

Is it a standalone exploit?

No. It is a bypass primitive that pairs with other attack families (injection, deserialization RCE, upload, traversal, CRLF, request smuggling, SMTP injection); you combine the narrowing trick with whichever payload the target permits.

Is this safe to run casually?

No. This is a dual-use offensive tool that ships live exploitation payloads. It is appropriate only for authorized penetration testing or security research on systems you are explicitly permitted to attack; other use may be illegal.

All Files

2 files
PAYLOAD_COOKBOOK.md23.4 KB
View
SKILL.md29.4 KB
View

Install ghost-bits-cast-attack

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill