CVE-2026-21876 — Root cause, Reproduction, Impact and Lessons Learned
好的,我需要帮用户总结一篇文章,控制在100字以内。首先,我要仔细阅读文章内容,抓住主要信息。 文章讲的是OWASP CRS的一个漏洞,影响ModSecurity WAF。作者在2025-2026年间发现这个漏洞,主要是在处理multipart请求的字符集时存在缺陷。攻击者可以通过添加一个无效参数绕过安全检查,影响多个框架和WAF产品。 接下来,我需要把这些要点浓缩成简洁的句子。确保涵盖漏洞、影响范围、攻击方法和结论。 最后,检查字数是否符合要求,并确保表达清晰准确。 </think> 这篇文章描述了OWASP CRS中一个WAF绕过漏洞的发现与分析。该漏洞存在于处理multipart请求字符集的规则中,允许攻击者通过添加特定参数绕过安全检查。此漏洞影响多个WAF产品和常见框架,强调了依赖单一安全层的风险。 2026-4-12 07:22:5 Author: infosecwriteups.com(查看原文) 阅读量:12 收藏

Daytrift Newgen

  • Author: Daytrift Newgen
  • Target: OWASP CRS < 4.22.0/3.3.8
  • Impact: WAF Bypass
  • Status: Patched, PoC is available

Press enter or click to view image in full size

TL;DR

Around the turn of 2025 and 2026, I researched the ModSecurity WAF for vulnerabilities, specifically its rule component — OWASP CRS. By the end of 2025, after spending three days delving into the process, I discovered a vulnerability in rule 922110, which checks whether the character sets of request parts match an allowed regex.

In this article, I will briefly describe the cause of the vulnerability, focusing more on how to reproduce it and the associated risks. I will save the complete operational chain and workarounds for a separate report.

Why I looked at this

At first, I looked into a more niche WAF and discovered the flaw. I assumed the vulnerability was specific to that particular product. However, the next morning — already in 2026 — it occurred to me to test this on a pure ModSecurity setup. The result was surprising, as the same behavior was observed there as well…

So my main goal was to blind the WAF and completely bypass its filters, and since I had initially latched onto the idea of request smuggling, I started by trying to break the parser. To do this, I targeted the most challenging aspect for parsers: multipart requests and their character sets. Since the rule engine detects suspicious character sets, I tried to find a way to confuse this check, for example, by overwriting them, which ultimately led to the discovery of the vulnerability.

Get Daytrift Newgen’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

After consulting with the vendor, we concluded that the vulnerability ran even deeper — it affected the ruleset rather than the engine itself. Initially, I approached the investigation with a fresh perspective using a black-box method, so the root cause of the vulnerability wasn’t immediately apparent.

The vulnerability

The problem lay in how the rule processes charsets and when it does so.

SecRule MULTIPART_PART_HEADERS "@rx ^content-type\s*:\s*(.*)$" \
"id:922110,phase:2,block,capture,t:none,t:lowercase,chain"
SecRule TX:1 "!@rx ^(?:<-REGEX->)$" \
"setvar:'tx.inbound_anomaly_score_pl1=+%{tx.critical_anomaly_score}'"

With each iteration through the multipart parts, the value of the internal variable TX:1 is overwritten with a new charset value, and ONLY WHEN THE CYCLE IS DONE is it checked for safety. Thus, to exploit this vulnerability, all it takes is a single multipart parameter at the end in a valid encoding.

…and here’s why it’s actually dangerous

  1. The main reason: many frameworks (Django, Flask, Spring, PHP, etc.) support multipart as well as x-www-form-urlencoded, which is the most common method for transmitting POST parameters.
  2. The vulnerability does not affect a specific WAF (ModSecurity, Coraza), but rather one of the most widely used rule sets, and many WAF products support it.
  3. Although the vulnerability itself does not grant full access to the system, it successfully bypasses the security layer that developers often rely on.

Proof-of-Concept

As I mentioned earlier, to bypass the rule, all you need to do is add a non-functional parameter at the end of the request. Here, I will provide an example of a raw request to illustrate how the attack works.

Here, the request is predictably blocked by ModSecurity because the character set does not match the list of allowed values:

Press enter or click to view image in full size

Failed

And here, the request successfully bypasses the security measures because the variable storing the character set has been successfully overwritten with a valid value.

Press enter or click to view image in full size

Succeeded!

Conclusion

The main takeaway is that you shouldn’t rely solely on a WAF. Sometimes vulnerabilities exist for years before they’re discovered. And their friends, the bug hunters, will help track them down :)


文章来源: https://infosecwriteups.com/cve-2026-21876-root-cause-reproduction-impact-and-lessons-learned-410909440568?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh