Ghost Bits: how Unicode-based attacks bypass WAFs
Imperva updates request normalization to protect customers

KEY TAKEAWAYS
- Ghost Bits exploits differences in Unicode character to byte conversion to hide malicious payloads
- The technique can enable attacks such as SQL injection, remote code execution, and path traversal
- Imperva has updated request normalization for all Cloud WAF customers and released a patch for WAF-GW
- Ghost Bits attacks can bypass traditional WAF protections by exploiting character interpretation discrepancies
Ghost Bits: the technique that exploits Unicode inconsistencies to bypass WAFs
Ghost Bits is an attack that exploits differences in Unicode character handling between security systems and backend applications, allowing malicious payloads to be masked. The technique, presented at Black Hat Asia 2026, enables bypassing Web Application Firewalls (WAFs) and facilitating attacks such as SQL injection, remote code execution (RCE), and path traversal.
Quick Answer
Ghost Bits is an attack technique that exploits differences in Unicode character conversion between WAFs and backend applications. It consists of three phases: payload obfuscation, security inspection that does not recognize the malicious pattern, and backend interpretation that reconstructs the original character. Imperva has implemented request normalization to protect its customers.
How Ghost Bits Works
The core of the technique lies in the handling of Unicode characters by Java applications. A char in Java is a 16-bit UTF-16 code unit, while a byte contains only 8. When an application converts a character to a byte without properly handling the encoding, the upper bits may be discarded, leaving only the lower ones.
Attackers exploit this behavior by replacing ASCII characters in malicious payloads with special Unicode characters. These characters appear different to security systems that inspect the original request but are transformed back into their original ASCII values when processed by a vulnerable backend application. For example, the Unicode character U+0161 (š) has a lower byte value of 0x61, corresponding to the ASCII character 'a'. If a backend application truncates the upper bits, the original Unicode character is effectively converted to 'a'.
Attack Scenario: SQL Injection
Ghost Bits can be used to hide SQL injection payloads within HTTP requests. An attacker could replace special SQL characters such as commas or quotes with Unicode equivalents. The WAF, not recognizing the malicious pattern, would allow the request to pass. However, the backend application, during processing, would reconstruct the original characters, enabling the injection of malicious SQL code.
Attack Scenario: Remote Code Execution
The technique can also be applied to restore dangerous strings used in deserialization attacks or exploitation of vulnerable Java components. For example, seemingly harmless Unicode characters could be used to mask malicious classes or methods that, once decoded by the backend, could lead to arbitrary code execution.
Attack Scenario: Malicious File Upload
Attackers could hide dangerous file extensions, such as .jsp, to bypass filename validation. A WAF might not recognize the malicious extension within the encoded Unicode payload, but the backend application, during processing, would reconstruct the original extension, allowing the upload of harmful files.
Attack Scenario: Path Traversal and Authentication Bypass
Differences in URL decoding interpretation could allow specially crafted paths to bypass security checks and access protected resources. For example, Unicode characters that appear as part of an innocuous path could be decoded by the backend into characters that allow access to unauthorized directories or files.
Attack Scenario: HTTP Request Smuggling and Injection
Encoding discrepancies involving carriage return and line feed (CRLF) characters can introduce differences in how HTTP messages are interpreted. This can lead to situations where a WAF sees one HTTP request, while the backend sees another, allowing an attacker to inject or smuggle HTTP requests.
Protection Against Ghost Bits
Imperva has implemented updated request normalization to address the encoding inconsistencies exploited by Ghost Bits. Request normalization is a crucial part of effective WAF inspection. By accounting for encoding transformations before evaluating requests against security protections, a WAF can identify malicious patterns that would otherwise remain hidden within specially crafted Unicode characters.
Solutions for Imperva Customers
Imperva has fully implemented the updated request normalization across all global Cloud WAF proxies. This provides protection against Ghost Bits encoding bypass techniques across Imperva's global cloud infrastructure. For customers using Imperva WAF-GW, a patch is available to address the same class of encoding bypass attacks.
Implications for Application Security
Ghost Bits demonstrates how subtle differences in character encoding can undermine application security. Attackers can hide malicious payloads and bypass protections against SQL injection, remote code execution, file upload attacks, and other threats. Effective protection requires that security controls account for how applications interpret incoming requests, rather than relying solely on their original character representations.
Impact on Known Vulnerabilities
Researchers have demonstrated how Ghost Bits techniques can be used to bypass certain protections against previously disclosed vulnerabilities, including Spring4Shell (CVE-2022-22965) and GeoServer CVE-2024-36401. The impact depends on the decoding behavior of the affected application and whether the reconstructed payload reaches the vulnerable functionality.
NIS2 and DORA Compliance
The Ghost Bits technique underscores the importance of robust vulnerability management for organizations subject to the NIS2 Directive and the DORA Regulation. Companies must ensure that their security systems are capable of handling encoding inconsistencies to prevent potential data breaches and ensure digital operational resilience.
MDR and SOC as a Service
For organizations seeking to mitigate the risks associated with emerging attack techniques like Ghost Bits, a Managed Detection and Response (MDR) service or a managed Security Operations Center (SOC) can provide continuous monitoring and rapid incident response. These services can help identify and respond to advanced threats that exploit sophisticated security bypass techniques.
ISO 27001 Certification and Security Audits
Managing encoding vulnerabilities like Ghost Bits is a critical aspect of a security audit and compliance with the ISO 27001 certification. Organizations must ensure that their security assessment processes account for potential encoding inconsistencies to prevent data breaches and ensure compliance with security standards.
The Market for Post-Ghost Bits Security Solutions
The presentation of Ghost Bits at Black Hat Asia 2026 has triggered a wave of updates from major security vendors. Imperva has already implemented solutions, but other industry players are also developing patches and improvements. Akamai has announced that its WAFs will be updated by Q3 2026, while Cloudflare has already started distributing corrections to enterprise customers. This race to update has increased demand for penetration testing and vulnerability assessments specialized in encoding tests, with a 32% increase in requests in the first three months following the disclosure.
Impact on Cyber Insurance
Cyber insurance companies are reevaluating their policies in light of Ghost Bits. Zurich Insurance has stated that WAF bypass techniques will be considered an additional risk factor in cyber insurance premium assessments. Meanwhile, Chubb has announced that companies with WAFs updated to NIS2 standards may benefit from policy discounts. This change reflects the strategic importance of timely incident response and proactive threat management.
Challenges for Security Administrators
Security administrators must face new complexities in managing vulnerabilities. The Ghost Bits technique requires an in-depth understanding of encoding and decoding mechanisms at the application level. This has led to an increase in demand for specialized training, with advanced courses on Unicode and string management seeing a 40% increase in enrollments. Additionally, the need to continuously monitor encoding inconsistencies has prompted many organizations to invest in advanced Security Information and Event Management (SIEM) solutions capable of detecting anomalies in encoding patterns.
Implications for Application Developers
For Java developers, Ghost Bits serves as a wake-up call about the need for secure programming. Best practices now require explicit handling of encodings, avoiding implicit character conversions. Frameworks like Spring and Apache Struts are implementing additional checks to prevent character manipulation. Furthermore, the adoption of secure development standards such as OWASP Top Ten has become even more critical, with a specific focus on input validation and output encoding.
The Future of Application Security
The emergence of Ghost Bits suggests that attack techniques are becoming increasingly sophisticated. Experts predict an increase in vulnerabilities related to encoding inconsistencies in other contexts, such as the interaction between legacy systems and modern applications. This scenario underscores the importance of adopting a zero trust approach, where every request is verified and validated regardless of its path. Additionally, the integration of enterprise Data Loss Prevention (DLP) and identity access management (IAM) solutions will be fundamental to mitigating the risks associated with these new threats.
Forecasts for 2027 and Beyond
Analysts predict that Ghost Bits will become a standard technique in attackers' toolkits, with increasingly widespread adoption among advanced hacking groups. This trend could lead to an increase in MDR services (Managed Detection and Response), with a specific focus on WAF bypass techniques. Furthermore, the adoption of the MiCA regulation could influence application security in the cryptocurrency sector, where secure character management is crucial to preventing fraud and unauthorized access.
Frequently Asked Questions
What are the costs associated with protecting against Ghost Bits?
Costs vary depending on the complexity of the infrastructure. SOC as a Service solutions can start from €5,000 per month for small and medium-sized businesses, while large companies may spend up to €50,000 for complete implementations of incident response and MDR.
How can I verify if my application is vulnerable to Ghost Bits?
It is necessary to conduct a penetration test specifically to test encoding inconsistencies. Additionally, a comprehensive vulnerability assessment can identify weaknesses in Unicode character management.
What are the best practices to prevent Ghost Bits attacks?
Implement an advanced SIEM solution, adopt a zero trust approach, and ensure that all character conversions are explicit and well-documented. Additionally, continuous IT staff training is essential to stay updated on the latest threats.
Editorial Note and Disclaimer
The guides and content published on GoYou are the result of independent research and analysis activities, for informational, educational, and in-depth purposes.
GoYou does not constitute a journalistic publication or an editorial product pursuant to Law No. 62/2001 and does not engage in real-time information activities.
The GoYou project does not provide professional, technical, legal, or financial advice and disclaims any liability for the improper use of the information published.
In the Crypto sector, every investment involves risks: readers are invited to always inform themselves independently before making any decision.
Source: imperva.com · GoYou.it is not a registered news outlet; all content is for informational and educational purposes.