WAFFLED: A New Attack Technique Bypassing Major Web Application Firewalls

In the ever-evolving landscape of cybersecurity, a novel attack method named WAFFLED has emerged, capable of circumventing leading Web Application Firewalls (WAFs) by exploiting subtle parsing discrepancies. Unlike traditional attacks that manipulate malicious payloads, WAFFLED focuses on altering benign components of HTTP requests, such as headers and content-type parameters, to deceive WAFs into misinterpreting the data.

Understanding the WAFFLED Attack

WAFFLED, developed by researchers from Northeastern and Dartmouth, leverages advanced fuzzing techniques combined with automated differential testing to identify inconsistencies between how WAFs and backend web frameworks parse HTTP requests. By introducing specific mutations in non-malicious parts of a request—like inserting null bytes into multipart boundaries or reordering header parameters—the attack creates scenarios where the WAF perceives the request as harmless, while the backend processes and executes the embedded malicious code.

Scope of the Vulnerability

The research team conducted extensive testing across five prominent WAF providers: AWS WAF, Azure WAF, Google Cloud Armor, Cloudflare WAF, and ModSecurity. Their findings revealed 1,207 unique bypasses, indicating that each of these WAFs could be tricked under certain configurations. Alarmingly, over 90% of live websites were found to accept multipart/form-data content types, even when they were originally configured to handle application/x-www-form-urlencoded data. This widespread acceptance significantly increases the risk of WAFFLED-based attacks.

Real-World Implications

The implications of the WAFFLED attack are profound. By exploiting parsing discrepancies, attackers can bypass security measures designed to protect web applications, leading to potential data breaches, unauthorized access, and other malicious activities. For instance, a misconfigured WAF could allow an attacker to inject malicious scripts into a web application, leading to cross-site scripting (XSS) attacks or SQL injection vulnerabilities.

Mitigation Strategies

In response to these findings, the researchers have developed HTTP-Normalizer, an open-source proxy tool designed to rigorously validate HTTP requests against current RFC standards. By re-parsing incoming messages and reserializing them into a canonical form, HTTP-Normalizer effectively neutralizes the parsing discrepancies exploited by WAFFLED. Initial trials have demonstrated its effectiveness in rejecting or sanitizing 100% of sampled WAFFLED inputs with minimal performance overhead.

Organizations are advised to implement the following measures to mitigate the risks associated with WAFFLED:

– Deploy HTTP-Normalizer: Integrate this proxy tool into your web infrastructure to ensure strict compliance with HTTP standards and eliminate parsing inconsistencies.

– Update WAF Rulesets: Ensure that your WAF is configured with the latest managed rulesets, such as Azure DRS 2.1 or ModSecurity CRS 3.3, which address known vulnerabilities.

– Restrict Content Types: Disable support for uncommon content types unless explicitly required by your application to reduce the attack surface.

– Enforce Strict Header Checks: Implement rigorous validation of Content-Type, Content-Length, and Transfer-Encoding headers at both the WAF and application layers to detect and block anomalous requests.

Industry Response

The disclosure of the WAFFLED attack has prompted swift action from major WAF providers. Google classified the issue as a Tier 1, Priority 1 vulnerability and has issued a bug bounty for its discovery. Cloudflare, Microsoft, and the ModSecurity community have acknowledged the flaw and are in the process of rolling out fixes to address the identified vulnerabilities. Notably, AWS WAF’s stricter parsing mechanisms were found to be resilient against the WAFFLED attack, underscoring the importance of meticulous adherence to RFC standards in parsing logic.

Conclusion

The emergence of the WAFFLED attack serves as a critical reminder of the complexities involved in web application security. It highlights the necessity for continuous vigilance, regular updates to security protocols, and the adoption of tools like HTTP-Normalizer to safeguard against sophisticated evasion techniques. By understanding and addressing the nuances of parsing discrepancies, organizations can enhance their defenses and maintain the integrity of their web applications in the face of evolving cyber threats.