Black Hat Asia 2026 | Cast Attack: A New Threat Posed by Ghost Bits in Java

skim AI Analysis | Black Hat

Black Hat's Black Hat Asia 2026 | Cast Attack: A New Threat Posed by Ghost Bits in Java: skim's analysis identifies 9 key moments, with 1 potential conflict of interest flagged. Security researchers Xinyu Bai and Zhihui Chen introduce 'Cast Attack,' an exploitation technique leveraging silent high-order bit truncation ('Ghost Bits') during Java char-to-byte conversions.

Category: Tech. Format: Educational. YouTube video analyzed by skim.

Summary

Security researchers Xinyu Bai and Zhihui Chen introduce 'Cast Attack,' an exploitation technique leveraging silent high-order bit truncation ('Ghost Bits') during Java char-to-byte conversions. They demonstrate how this flaw enables WAF bypasses, authentication bypasses, arbitrary file reads in Spring, supply-chain SMTP injection, and HTTP header injection across major Java libraries.

skim AI Analysis

Credibility assessment: Code-Backed Vulnerability Talk. Xinyu Bai and Zhihui Chen anchor every claim in reproducible payloads, vendor patch diffs, and assigned CVEs across major Java projects including Spring, Jetty, Jira, and the JDK.

Bias assessment: Offensive Research Perspective. The presentation maintains a technical focus on vulnerability mechanics, with only a brief mention of Alibaba Cloud WAF rules near the conclusion.

Originality: 94% — Novel Attack Class Discovery. The researchers formalize 'Ghost Bits' and 'Cast Attack' as a systemic vulnerability class in Java, presenting original CVEs, WAF bypass payloads, and custom AI auditing findings.

Depth: 91% — Byte-Level Root Cause Analysis. The talk traces bugs from high-level application behavior down to exact char-to-byte narrowing conversions, bitwise masking operations, and multi-layer parsing discrepancies.

Key Points (9)

1. Zhihui Chen Defines Ghost Bits in Java Type Casts

Timestamp: 00:02:03 to 00:05:12

Zhihui Chen explains that converting a 16-bit Java char to an 8-bit byte silently drops the high-order eight bits, which the researchers call 'Ghost Bits.' Discovered while testing Chinese characters in Burp Suite, this truncation turns Unicode character U+5858 into ASCII 'X' (0x58). Searching open-source repositories revealed that explicit byte casts, 0xFF bitmasks, and byte-stream writes are pervasive across the Java ecosystem.

Significance (High): Exposes a fundamental data-loss behavior in routine Java type conversions that silently mutates multi-byte characters after security checks occur.

Sources in support: Xinyu Bai (Security Researcher (B1ue)), Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

2. Xinyu Bai Shows WAF Bypasses in JSON and BCEL

Timestamp: 00:05:12 to 00:08:01

Xinyu Bai demonstrates how Ghost Bits bypass Web Application Firewalls in JDK's BCEL, Jackson, and Fastjson. Because BCEL's decoder writes only the lower eight bits and Jackson masks hex characters, attackers can disguise SQL injection or bytecode payloads as Chinese characters that pass WAF inspection before decoding into malicious commands. Similarly, Fastjson's Character.digit handling and hex escape logic allow disguised inputs to resolve into the @type deserialization keyword.

Significance (High): Renders signature-based WAF inspection ineffective when downstream Java deserializers and JSON parsers truncate Unicode characters into exploit strings.

Sources in support: Xinyu Bai (Security Researcher (B1ue))

3. Bypassing WAFs in Web Containers and Spring4Shell

Timestamp: 00:08:02 to 00:11:47

Continuing the WAF bypass demonstrations, Xinyu Bai shows how Apache Tomcat's RFC 2231 header parser, URL decoders across seven Java frameworks, and JDK's Base64 decoder all strip high-order bits. Attackers can upload JSP web shells or trigger GeoServer and Spring4Shell exploits by substituting blocked keywords like 'jsp', 'Runtime', or 'class' with Unicode equivalents that collapse into the forbidden ASCII strings during framework decoding.

Significance (High): Proves that standard CVE signatures on perimeter firewalls can be evaded across Tomcat, Spring, Jetty, and Undertow using Ghost Bit character substitutions.

Sources in support: Xinyu Bai (Security Researcher (B1ue))

4. Jetty Bitwise Mutation Enables Openfire Bypass

Timestamp: 00:11:53 to 00:16:16

Zhihui Chen analyzes CVE-2023-32315 in Openfire, explaining how Ghost Bits emerge inside bitwise operations even without an explicit byte cast. Because Eclipse Jetty's URL parser applies bitwise logic that collapses the '>' character (0x3E) into decimal 14 (hex E), an attacker can send '%2>' instead of '%2e'. This stealthy payload evades WAF rules and Openfire's path-based access controls before Jetty resolves it into '../' for an authentication bypass.

Significance (High): Demonstrates that Ghost Bit truncation also occurs in bitwise arithmetic, creating non-standard URL encodings that defeat both WAFs and authentication filters.

Sources in support: Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

5. Spring URL Decoding Flaw Allows Arbitrary File Read

Timestamp: 00:16:20 to 00:19:33

Examining a patched vulnerability in Spring, Zhihui Chen details how Ghost Bits in Spring's hexadecimal URL decoding logic led to an arbitrary file read when serving static resources on Jetty. By sending engineered Chinese characters that truncate into '%u002e', an attacker bypasses Spring's literal '../' string check. When Jetty subsequently parses the '%u002e' encoding as dots, the double-parsed path resolves to directory traversal and returns arbitrary files from disk.

Significance (High): Highlights how Ghost Bit truncation combined with differential URL parsing between Spring and Jetty exposes local server files without special preconditions.

Sources in support: Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

6. Low-Level Java Mail Bug Triggers Supply-Chain SMTP Injection

Timestamp: 00:19:34 to 00:22:24

Zhihui Chen presents CVE-2025-7962, a Ghost Bit truncation flaw in a core Java SMTP SDK that assumes input strings contain only standard ASCII. By supplying Unicode characters whose lower eight bits equal Carriage Return and Line Feed (CRLF), attackers can prematurely terminate SMTP commands and inject arbitrary headers, bodies, and recipients.

Significance (High): Shows how a single char-to-byte cast in a foundational mail library compromises dozens of enterprise applications that pass user email addresses downstream.

Sources in support: Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

7. Hijacking Jira System Emails and Confluence Domains

Timestamp: 00:22:29 to 00:26:56

Demonstrating real-world exploits of CVE-2025-7962, Zhihui Chen shows how entering a Ghost Bit payload into Atlassian Jira 9.12.16's registration and password-reset flow replaces legitimate system emails with attacker-controlled phishing content.

Significance (High): Proves that SMTP Ghost Bit truncation allows unauthenticated attackers to send authentic phishing emails from Jira and bypass enterprise domain restrictions in Confluence.

Sources in support: Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

8. CRLF Truncation Causes Request Smuggling and JDK XSS

Timestamp: 00:27:08 to 00:30:25

Zhihui Chen expands CRLF generation to HTTP, showing that Apache HttpClient 4.5.9 and below blindly cast char arrays to bytes when building request headers (HTTPCLIENT-1974, HTTPCLIENT-1978), allowing Ghost Bits to split one request into two for HTTP request smuggling. Conversely, in the JDK built-in HTTP server (CVE-2026-21933), reflecting untrusted Unicode input into response headers truncates into CRLF, enabling response header splitting and cross-site scripting (XSS).

Significance (High): Establishes that char-to-byte header truncation compromises both HTTP clients via request smuggling and HTTP servers via response splitting and XSS.

Sources in support: Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

9. Xinyu Bai Unveils SecX AI Auditor and New Library Bugs

Timestamp: 00:30:35 to 00:36:29

To scale discovery across the massive Java dependency ecosystem, Xinyu Bai and collaborator Zongzheng Zheng built an automated AI code-auditing tool that translates Ghost Bit patterns into detection rules. Scanning open-source projects uncovered exploitable char-to-byte flaws in Netty cookie encoding (enabling response header injection), Lettuce Redis string writing (corrupting JSON structures), JDK's XMLWriter (mutating XML tags), and Jodd's URL handler (enabling path traversal to /etc/passwd).

Significance (High): Provides an automated blueprint for hunting Ghost Bit vulnerabilities at scale while revealing fresh injection flaws in Netty, Lettuce, JDK XMLWriter, and Jodd.

Sources in support: Xinyu Bai (Security Researcher (B1ue)), Zhihui Chen (Security Engineer, Alibaba Cloud (1ue))

Key Sources

  • Xinyu Bai — Security Researcher (B1ue)
  • Zhihui Chen — Security Engineer, Alibaba Cloud (1ue)

Potential Conflicts of Interest (1)

Alibaba Cloud WAF Promotion (Low severity)

Type: Commercial

Zhihui Chen is employed as a security engineer at Alibaba Cloud, and co-speaker Xinyu Bai highlights Alibaba Cloud WAF protection rules at the end of the talk.

Significance: The closing remediation advice singles out Alibaba Cloud WAF as having deployed defenses against Ghost Bit bypasses while omitting competing WAF vendors.

This analysis was generated by skim (skim.plus), an AI-powered content analysis platform by Credible AI. Scores and classifications represent the platform's AI-generated assessment and should be considered alongside other sources.