News

Ghost Bits: How Imperva protects web applications against WAF-bypass attacks using Unicode encoding

News | 01.12.2026

Imperva Threat Research (part of Thales) has released a detailed analysis of the Ghost Bits attack technique, first disclosed at Black Hat Asia 2026. This method exploits inconsistencies in how Web Application Firewalls (WAFs) and backend applications (primarily Java-based) interpret Unicode characters. Attackers manipulate character encoding to disguise malicious payloads and bypass security controls—opening the door to SQL injection, Remote Code Execution (RCE), and authentication bypass. In response to this threat, Imperva has deployed updated request normalization mechanisms across all Cloud WAF nodes worldwide and released a patch for on-premises Imperva WAF-GW solutions.

Key Takeaways

Ghost Bits is a security bypass technique presented at Black Hat Asia 2026 that exploits differences in how security systems and backend logic process Unicode characters. By substituting standard characters in the attack code, threat actors conceal malicious payloads from traditional WAF signatures, triggering SQL injection, Remote Code Execution (RCE), Path Traversal, and other critical incidents.

To neutralize this threat, the Imperva team has implemented enhanced request normalization across all Cloud WAF proxies within its global cloud infrastructure, and released a corresponding update for Imperva WAF-GW users.

What Is Ghost Bits and What Is the Vulnerability?

Ghost Bits is a class of encoding-based attacks that takes advantage of how Java applications and frameworks convert Unicode characters into bytes. This technique clearly demonstrates a fundamental architectural security challenge: different infrastructure components processing the same HTTP request may interpret its contents differently.

The technical root of the issue lies in data type handling:

  • In Java, the char type represents a 16-bit UTF-16 code unit, whereas the byte type contains only 8 bits.
  • When an application converts a character into a byte without proper encoding handling, the upper 8 bits may be discarded (truncated), leaving only the lower 8 bits for processing.

Attackers exploit this behavior by replacing recognizable ASCII characters in malicious payloads with specially crafted Unicode characters. To a security system inspecting the initial request, these characters appear legitimate and harmless; however, when processed by a vulnerable backend, they are transformed back into their original ASCII values.

This enables attackers to covertly transmit restricted commands, dangerous file extensions, and control sequences disguised as benign Unicode text.

How Ghost Bits Bypasses Traditional WAF Detection

Conventional detection mechanisms in Web Application Firewalls rely heavily on identifying known malicious patterns in incoming HTTP traffic. However, when a WAF and a target application decode the exact same input differently, a blind spot emerges.

A Ghost Bits attack typically unfolds in three stages:

  1. Payload obfuscation. The attacker constructs a malicious request and replaces key ASCII characters with Unicode characters whose lower 8 bits match the original values.
  2. Security inspection. The encoded payload reaches the WAF. If the analysis engine does not account for the backend's character truncation logic, the malicious pattern goes unrecognized, and the request is allowed through.
  3. Backend interpretation. A vulnerable Java component processes the request, discards the upper bits, reconstructs the original malicious characters, and executes the attack.

Unlike exploits targeting a single specific coding bug, Ghost Bits exploits systemic inconsistencies in character handling across different architectural layers. This makes the technique particularly dangerous, as the exact same encoding manipulation can be leveraged across a wide variety of attack vectors.

Potential Attack Scenarios

Research into Ghost Bits has shown that encoding inconsistencies affect a wide range of Java frameworks and application components, opening up the following capabilities for attackers:

  • SQL Injection (SQLi): Modified Unicode characters mask SQL statements until they are decoded or truncated by vulnerable application logic prior to querying the database.
  • Remote Code Execution (RCE): Encoding transformations allow the restoration of critical strings used in deserialization attacks or when exploiting vulnerable Java components.
  • Malicious File Uploads: Attackers can disguise executable file extensions (such as .jsp) to bypass filename validation filters at the perimeter before the backend restores the original extension upon saving.
  • Path Traversal and Authentication Bypass: Inconsistent URL decoding allows threat actors to craft specialized resource paths that bypass access control checks.
  • HTTP Request Smuggling / Injection: Discrepancies in handling Carriage Return and Line Feed (CRLF) characters cause HTTP message boundary errors between proxy servers and the backend.

Furthermore, researchers demonstrated that Ghost Bits techniques can bypass certain existing protection rules for previously disclosed critical vulnerabilities, including Spring4Shell (CVE-2022-22965) and GeoServer (CVE-2024-36401).

The ultimate impact depends on the decoding behavior of the specific application and whether the reconstructed payload reaches a vulnerable handler. Ghost Bits is not a single vulnerability with a single exploit, but rather a versatile obfuscation technique that opens multiple avenues for compromise.

How Imperva Solutions Protect Infrastructure Against Ghost Bits

To counter encoding inconsistencies, Imperva engineers have implemented and deployed updated Request Normalization algorithms.

Request normalization is a critical stage of deep traffic inspection in modern WAAP/WAF solutions. By accounting for all possible encoding transformations before evaluating a request against security rules, the WAF can detect malicious patterns hidden behind non-standard Unicode characters. This approach addresses the core mechanism of a Ghost Bits attack: a malicious request can no longer evade inspection simply because its characters are represented in an alternative form prior to reaching the application server.

Current protection status for Imperva customers:

  • Imperva Cloud WAF: Updated normalization logic is fully deployed across all Imperva cloud proxy nodes worldwide. Cloud service customers are automatically protected against Ghost Bits bypass techniques with no manual configuration required.
  • Imperva WAF-GW (Gateway): For organizations running on-premises or hybrid WAF-GW security gateways, a dedicated patch has been released to remediate this class of attacks. Administrators are advised to apply the available update to ensure maximum protection.

These measures strengthen the Imperva platform's ability to identify obfuscated attacks at the perimeter, preventing attempts to circumvent existing application security policies.

Takeaways for CISOs and Information Security Professionals

The Ghost Bits technique clearly illustrates how subtle nuances in character encoding can undermine the security of even well-architected infrastructure. By exploiting the gap between perimeter inspection logic and internal data processing within Java applications, attackers can conceal payloads for SQL injection, RCE, and unauthorized file uploads.

Effective defense requires security controls to deeply understand how target applications actually interpret incoming traffic, rather than relying solely on matching raw input characters. Thanks to the global update to Imperva Cloud WAF and the patch release for Imperva WAF-GW, organizations protected by Thales / Imperva technologies gain proactive defense against sophisticated WAF bypass methods.

Protect Your Web Applications and APIs with Softprom

Softprom is an official distributor of Imperva (Thales) solutions in the region. Our team possesses deep technical expertise in protecting web applications, APIs, and mission-critical data, providing end-to-end support to customers and partners at every stage of project implementation: from auditing current architecture and running Proof of Concept (PoC) pilots to deployment, fine-tuning security policies, and ongoing maintenance.

Want to test the resilience of your web applications against modern WAF bypass techniques or evaluate the capabilities of the Imperva platform within your infrastructure? Contact Softprom specialists today.