Skip to content
Misconfiguration Write-up Advanced

WAF bypasses via 0days

terjanq Follow

Published on terjanq.medium.com

In May, I participated in 1337up0522 from Intigriti which was about hacking OWASP ModSecurity Core Rule Set (CRS). I’ve got 13 findings accepted including 3 exceptional, 2 critical, and 8 high severity vulnerabilities.

terjanq, on terjanq.medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

Context

In May I took part in the 1337up0522 live hacking event run by Intigriti, which was aimed at OWASP ModSecurity Core Rule Set (CRS). The target was therefore not a single web application but the rule set and the recommended ModSecurity configuration that sit in front of many applications. CRS inspects request bodies, parses them according to the declared Content-Type, and raises anomalies when it sees something suspicious. Everything below is about the gap between how ModSecurity parses a request and how the backend behind it parses the same bytes.

I ended the event with 13 findings accepted: 3 exceptional, 2 critical and 8 high severity. This article covers a few of the more interesting ones.

From the original on terjanq.medium.com

Setup

The example requests target sandbox.coreruleset.org with a Juice Shop instance under /juiceshop/. The examples below use the login endpoint POST /juiceshop/rest/user/login, which is a convenient place to demonstrate SQL injection payloads reaching the backend. The relevant configuration is the recommended ModSecurity config file, ModSecurity/modsecurity.conf-recommended, which contains the request body processor rules discussed in the first section.

Finding it

Two rules in that recommended configuration decide which request body processor ModSecurity uses, based on the Content-Type header. The first is:

Text
SecRule REQUEST_HEADERS:Content-Type "(?:application(?:/soap\+|/)|text/)xml"

The second is:

Text
SecRule REQUEST_HEADERS:Content-Type "application/json"

Both are regular expressions matched against the header value, and neither is anchored to the beginning of the string. That means a header whose real media type is application/x-www-form-urlencoded can still contain the substring application/xml or application/json somewhere later, for example inside a parameter value, and ModSecurity will select the XML or JSON body processor accordingly. The backend, which parses the header properly, will keep treating the body as form-encoded. The two sides then disagree about what the body means, and that disagreement is the bypass.

Exploitation

Step 1: XML body processor confusion

Send a form-encoded content type that carries application/xml inside a quoted boundary parameter:

Text
Content-Type: application/x-www-form-urlencoded;boundary="application/xml"

ModSecurity matches the XML rule and hands the body to the XML request body processor. Because ModSecurity ignores comments in XML entirely, the payload can be hidden inside a comment:

Text
<a><!-- &email='or'1&[redacted]&'or'1 --></a>

The WAF sees an XML document whose only content is a comment, so there is nothing for the rules to flag. The backend, still parsing the body as application/x-www-form-urlencoded, sees the form data inside the comment. That is a complete WAF bypass.

Step 2: JSON body processor confusion

The same anchoring mistake exists in the JSON rule, but exploitation was trickier. The header

Text
Content-Type: application/x-www-form-urlencoded;boundary="application/json"

makes the WAF treat the body as JSON, yet most payloads were still blocked because I did not find an easy way of hiding the payload inside valid JSON. The escalation came from a different angle: a body that is valid JSON but is also meaningful as form data.

Text
"&email='or 1--

This works because of how CRS treats a request with no parameters. Even a perfectly ordinary request like the following was not blocked by the WAF:

HTTP
POST /juiceshop/rest/user/login HTTP/1.1
Host: sandbox.coreruleset.org
Content-Length: 16
Content-Type: application/json
Connection: close

"&email='or 1--

From the WAF's point of view the body is a single JSON variable holding the body contents, with no parameters at all, and that scenario was not covered by the CRS rules. So the WAF can be convinced the request is JSON while the data is smuggled through as application/x-www-form-urlencoded to the backend.

Multipart parsing 0day

I knew about multipart/form-data but had never studied the format in detail. The live hacking event was enough motivation to dig into it, and it turned out to be much simpler than I expected. The convention is:

  1. Define the boundary in the content type, e.g. Content-Type: multipart/form-data; boundary=xx.
  2. Use \r\n as the line terminator.
  3. Start each part with the boundary prefixed with --, followed by the line terminator.
  4. Put headers such as Content-disposition on consecutive lines separated by the line terminator.
  5. Separate headers and body with a line terminator.
  6. End the part with either a new part or the end of the request, which is the boundary prefixed and suffixed with --.

A simple multipart request looks like this:

HTTP
POST /juiceshop/rest/user/login HTTP/1.1
Host: sandbox.coreruleset.org
Content-Length: 130
Content-Type: multipart/form-data; boundary=xx
Connection: close

--xx
Content-disposition: form-data; name="username"

terjanq
--xx
Content-disposition: form-data; name="password"

password
--xx--

Step 3: A part with an empty body

Immediately after learning the format I spotted an imperfection in the parsing algorithm: what happens when a part has no body at all?

Text
--xx
Content-disposition: form-data; name="username"
--xx
Content-disposition: form-data; name="jj"; filename="ccc"

'or'1
--xx
Content-disposition: form-data; name="password"

test123
--xx--

The first part has no body. Depending on the parser, --xx might be taken as that part's body, or the parser might recognise that a new part has started and treat the first part as empty. ModSecurity took the second interpretation and produced three variables:

  • username=
  • FILE: jj='or'1
  • `[redacted]

Because CRS ignores files, it finds nothing suspicious in the request. Some backends disagree with ModSecurity and read the same bytes as:

  • username=--xx\r\nContent-disposition: form-data; name="jj"; filename="ccc"\r\n'or'1
  • `[redacted]

In that reading the SQL injection payload sits inside the username parameter, which the WAF never inspected as a parameter. This made all PHP backends bypassable.

Step 4: A body terminated with a new line

The second multipart issue is specific to ModSecurity. It incorrectly treated a single \n as \r\n after a body. Given this body:

Text
--boundary\r\nContent-disposition: form-data; name="parameter"\r\n\r\nbody\n--boundary\r\nContent-disposition: form-data; name="parameter2"\r\n\r\nnon-empty value--boundary--

ModSecurity produced two variables:

  • parameter=body
  • parameter2=non-empty value

Almost all backends instead understand it as:

Text
parameter=body\n--boundary\r\nContent-disposition: form-data; name="parameter2"\r\n\r\nnon-empty value

Exploitation is almost the same as in the empty-body case, with the slight advantage that the attacker fully controls the prefix of the request.

Charset confusion (CVE-2022-39955)

This one was rated high severity even though it allows a complete rule bypass whenever the backend understands utf-7. CRS only looks at the first charset= in the content type and blocks it if it is not utf-8. With

Text
Content-Type: application/json;charset=utf-8;charset=utf-7

the rule was bypassed and an express application decoded the request as utf-7. UTF-7 lets you encode any characters as base64, so the body

Text
+ACcAbwByACcAMQAnAC0ALQ-

is understood by the backend as 'or'1' --, while the WAF finds nothing suspicious in the request.

Root cause

All of these are parser differentials. In the content-type cases, the regular expressions in the recommended configuration are unanchored, so a substring match anywhere in the header selects a body processor that the backend will not use. In the multipart cases, ModSecurity's parser resolves ambiguous input (a part with no body, a bare \n terminator) differently from the backend, so the WAF and the application disagree about which bytes belong to which parameter. In the charset case, CRS validates only the first charset= parameter while the backend honours a later one. In every case the WAF inspects a different interpretation of the request from the one the application acts on, and the payload only exists in the application's interpretation.

Impact

An attacker can send requests that CRS sees as harmless while the backend processes them as form parameters containing SQL injection or similar payloads. The content-type confusion arises from the recommended ModSecurity configuration. The multipart empty-body issue affected all PHP backends; the newline issue is specific to ModSecurity's parser. The charset issue requires a backend that understands utf-7, such as the express application in the example. In each case the result is a full bypass of the rules for that request.

Fix

All of the bugs are patched in the newest releases of ModSecurity and CRS. All bugs are patched in the newest releases of both projects.

Variants to test

  • Unanchored body-processor rules. Send Content-Type: application/x-www-form-urlencoded;boundary="application/xml" (or application/json) with a payload hidden in an XML comment or shaped as a JSON string. A positive result is the WAF accepting the request while the backend parses the payload as form parameters.
  • JSON bodies with no parameters. Send a JSON content type with a body such as "&email='or 1-- and check whether CRS flags it. If it passes and the backend treats it as form data, the same gap exists.
  • Multipart parts with empty bodies. Put a Content-disposition header for one part immediately followed by the next boundary, with the payload in a later part's filename or value. A positive result is the WAF reporting an empty variable while the backend folds the following bytes into the previous parameter.
  • Bare \n after a multipart body. Terminate a part body with \n instead of \r\n and follow it with a new boundary. If the WAF reports the part as complete but the backend includes the following headers in the value, the parser differential is present.
  • Duplicate charset parameters. Send Content-Type: application/json;charset=utf-8;charset=utf-7 with a UTF-7 encoded payload such as +ACcAbwByACcAMQAnAC0ALQ-. A positive result is the WAF accepting the request and the backend decoding the payload as 'or'1' --.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 18 min read.

What happened, in plain words

Imagine a nightclub with a bouncer at the door. The bouncer checks every guest against a list of troublemakers. If your name is not on the list, you walk in. Now imagine that the bouncer and the club staff read the guest list in different ways: the bouncer reads your name one way and lets you through, but the staff inside read the same name another way and treat you as someone else entirely. That gap between two readings of the same thing is the heart of this article.

In May I took part in a live hacking event called 1337up0522, run by Intigriti. A live hacking event is a short, intense period where many researchers attack the same target at the same time. The target here was not one website. It was the OWASP ModSecurity Core Rule Set, usually shortened to CRS.

So what is that? A web application firewall, or WAF, is a piece of software that sits between the internet and a website. Every request that a browser sends to the site passes through the WAF first. The WAF reads the request, looks for patterns that suggest an attack, and either lets it through or blocks it. ModSecurity is one of the best-known open-source WAFs. CRS is a large collection of ready-made rules that tell ModSecurity what to look for. Many companies install ModSecurity with CRS in front of their sites and rely on it as a first line of defence.

A request is the message your browser sends to a server when you do something on a website: load a page, submit a login form, click a button. It has a few parts. The body is the actual data being sent, for example the username and password you typed. The headers are small labelled lines that describe the body, for example what format it is in. One important header is Content-Type, which tells the server how to read the body. If the body is a form, the header says so. If the body is JSON, a common text format used by web APIs, the header says that instead.

An API is the part of a website that programs talk to, rather than people clicking pages. When a login form on a modern site submits, it often sends a request to an API endpoint, which is just a specific address on the server that handles one kind of action, such as logging in.

CRS reads the Content-Type header, picks a parser for the body, and then checks the parsed result against its rules. A parser is a program that takes raw text and turns it into meaningful pieces, for example turning `username=alice&[redacted] into two named values. The backend, meaning the actual application behind the WAF, also parses the same body. If the two sides parse it differently, the WAF can inspect one interpretation while the application acts on another. Everything below is about that gap.

I ended the event with 13 findings accepted: 3 exceptional, 2 critical and 8 high severity. Those are severity labels used by bug bounty platforms to rank how serious a finding is. This article covers a few of the more interesting ones.

From the original on terjanq.medium.com

Setup

The example requests target the CRS sandbox, sandbox.coreruleset.org. A sandbox is a test environment set up specifically so researchers can try attacks without touching real customer data. On that sandbox, a Juice Shop instance was mounted under /juiceshop/. Juice Shop is a deliberately insecure demo shop used for training, so it is a safe place to demonstrate attacks.

The examples below use the login endpoint POST /juiceshop/rest/user/login. POST is the HTTP method used when you send data to a server, as opposed to GET, which is used when you just ask for a page. The endpoint is the address that handles logins. It is a convenient place to show SQL injection payloads reaching the backend. SQL injection is an attack where the attacker slips database commands into a form field, hoping the application will run them as part of a database query. A payload is simply the piece of text an attacker sends to try to trigger a bug.

The relevant configuration is the recommended ModSecurity config file, ModSecurity/modsecurity.conf-recommended. A config file is a text file of settings. This one is the file the ModSecurity project itself recommends people start from, so problems in it affect a lot of installations. It contains the request body processor rules discussed in the first section. A request body processor is the part of ModSecurity that decides how to parse the body.

Finding it

Two rules in that recommended configuration decide which request body processor ModSecurity uses, based on the Content-Type header. The first is:

Text
SecRule REQUEST_HEADERS:Content-Type "(?:application(?:/soap\+|/)|text/)xml"

This is a rule written in ModSecurity's own rule language. SecRule starts a rule. REQUEST_HEADERS:Content-Type says which part of the request to look at: the Content-Type header. The quoted part is a regular expression, which is a pattern-matching language for text. This particular pattern matches headers that contain application/xml, application/soap+xml or text/xml, which are the usual ways of saying the body is XML. XML is a text format for structured data, built from tags in angle brackets. When the rule matches, ModSecurity switches to its XML body processor.

The second is:

Text
SecRule REQUEST_HEADERS:Content-Type "application/json"

Same idea, but this one matches when the header contains application/json, and switches to the JSON body processor.

Both are regular expressions matched against the header value, and neither is anchored to the beginning of the string. Anchoring is a regular-expression concept: an anchored pattern must match starting at the first character, while an unanchored one can match anywhere inside the text. That means a header whose real media type is application/x-www-form-urlencoded can still contain the substring application/xml or application/json somewhere later, for example inside a parameter value, and ModSecurity will select the XML or JSON body processor accordingly. The backend, which parses the header properly, will keep treating the body as form-encoded. The two sides then disagree about what the body means, and that disagreement is the bypass. A bypass here means getting an attack through the WAF without being blocked.

Exploitation

Step 1: XML body processor confusion

Send a form-encoded content type that carries application/xml inside a quoted boundary parameter:

Text
Content-Type: application/x-www-form-urlencoded;boundary="application/xml"

Line by line: Content-Type is the header name. application/x-www-form-urlencoded is the real format of the body, the classic key=value&key=value form encoding. The semicolon starts an extra parameter attached to the header. boundary="application/xml" is that parameter, and its value happens to contain the text application/xml. A boundary is normally used with multipart bodies to mark where one part ends and the next begins; here it is just a place to hide a string. The backend reads the header correctly and sees form encoding. ModSecurity's unanchored rule sees the substring application/xml and switches to XML parsing. That is the confusion.

ModSecurity matches the XML rule and hands the body to the XML request body processor. Because ModSecurity ignores comments in XML entirely, the payload can be hidden inside a comment:

Text
<a><!-- &email='or'1&[redacted]&'or'1 --></a>

Line by line: <a> opens an XML element named a. <!-- starts an XML comment, and --> ends it. Everything between them is a comment, which XML parsers are supposed to skip. Inside the comment sits &email='or'1&[redacted]&'or'1, which is form-encoded data: an email field and a password field, with SQL injection fragments in their values. </a> closes the element.

The WAF sees an XML document whose only content is a comment, so there is nothing for the rules to flag. The backend, still parsing the body as application/x-www-form-urlencoded, sees the form data inside the comment. That is a complete WAF bypass.

Step 2: JSON body processor confusion

The same anchoring mistake exists in the JSON rule, but exploitation was trickier. The header

Text
Content-Type: application/x-www-form-urlencoded;boundary="application/json"

works the same way as the XML one: the real format is form encoding, but the quoted boundary value contains application/json, so the unanchored rule matches and the WAF switches to JSON parsing. This makes the WAF treat the body as JSON, yet most payloads were still blocked because I did not find an easy way of hiding the payload inside valid JSON. JSON is strict about its syntax, so random attack text usually breaks it and gets rejected or flagged. The escalation came from a different angle: a body that is valid JSON but is also meaningful as form data.

Text
"&email='or 1--

Line by line: the leading double quote makes the whole thing a valid JSON string, because a JSON string is just text wrapped in quotes. The rest, &email='or 1--, is form-encoded data: an email field whose value is 'or 1--, a classic SQL injection fragment. The two trailing dashes start a comment in SQL, which is often used to cut off the rest of a query. So the same bytes are a harmless JSON string to one parser and a dangerous form field to the other.

This works because of how CRS treats a request with no parameters. Even a perfectly ordinary request like the following was not blocked by the WAF:

HTTP
POST /juiceshop/rest/user/login HTTP/1.1
Host: sandbox.coreruleset.org
Content-Length: 16
Content-Type: application/json
Connection: close

"&email='or 1--

Line by line: POST /juiceshop/rest/user/login HTTP/1.1 is the request line: the method, the path and the HTTP version. Host: sandbox.coreruleset.org says which server the request is for. Content-Length: 16 says the body is 16 bytes long. Content-Type: application/json declares the body as JSON. Connection: close asks the server to close the connection after replying. The blank line separates headers from the body. The body is the JSON string shown above.

From the WAF's point of view the body is a single JSON variable holding the body contents, with no parameters at all, and that scenario was not covered by the CRS rules. So the WAF can be convinced the request is JSON while the data is smuggled through as application/x-www-form-urlencoded to the backend. Smuggling here means hiding data in a place the WAF does not inspect as data.

Multipart parsing 0day

A 0day, pronounced zero-day, is a bug that was not publicly known before it was found, so no fix existed at the time. I knew about multipart/form-data but had never studied the format in detail. It is the format browsers use when a form includes a file upload, and it can carry several fields at once. The live hacking event was enough motivation to dig into it, and it turned out to be much simpler than I expected. The convention is:

  1. Define the boundary in the content type, e.g. Content-Type: multipart/form-data; boundary=xx.
  2. Use \r\n as the line terminator.
  3. Start each part with the boundary prefixed with --, followed by the line terminator.
  4. Put headers such as Content-disposition on consecutive lines separated by the line terminator.
  5. Separate headers and body with a line terminator.
  6. End the part with either a new part or the end of the request, which is the boundary prefixed and suffixed with --.

A few words on the pieces. A boundary is a short marker string chosen by the sender, used to separate the parts of the body. \r\n means carriage return followed by line feed, the standard way to end a line in HTTP. Content-disposition is the header that names each part, for example name="username" for a normal field or filename="ccc" for a file upload. The final boundary with -- on both sides marks the end of the whole body.

A simple multipart request looks like this:

HTTP
POST /juiceshop/rest/user/login HTTP/1.1
Host: sandbox.coreruleset.org
Content-Length: 130
Content-Type: multipart/form-data; boundary=xx
Connection: close

--xx
Content-disposition: form-data; name="username"

terjanq
--xx
Content-disposition: form-data; name="password"

password
--xx--

Line by line: the request line and headers are as before, except Content-Type: multipart/form-data; boundary=xx declares a multipart body and picks xx as the boundary. After the blank line, --xx starts the first part. Content-disposition: form-data; name="username" names that part username. A blank line separates the part's headers from its body. terjanq is the value of the username field. --xx starts the second part, named password, with value password. --xx-- is the closing boundary, meaning the body is finished.

Step 3: A part with an empty body

Immediately after learning the format I spotted an imperfection in the parsing algorithm: what happens when a part has no body at all?

Text
--xx
Content-disposition: form-data; name="username"
--xx
Content-disposition: form-data; name="jj"; filename="ccc"

'or'1
--xx
Content-disposition: form-data; name="password"

test123
--xx--

Line by line: the first part is named username, but the very next line is --xx, a new boundary, so the first part has no body. The second part is named jj and has filename="ccc", which marks it as a file upload rather than a normal field. Its body is 'or'1, a SQL injection fragment. The third part is password with value test123. The closing --xx-- ends the body.

The first part has no body. Depending on the parser, --xx might be taken as that part's body, or the parser might recognise that a new part has started and treat the first part as empty. ModSecurity took the second interpretation and produced three variables:

  • username=
  • FILE: jj='or'1
  • `[redacted]

A variable here just means a named value that the WAF extracted from the body. FILE: marks a value that came from a file upload rather than a normal field. Because CRS ignores files, it finds nothing suspicious in the request. Some backends disagree with ModSecurity and read the same bytes as:

  • username=--xx\r\nContent-disposition: form-data; name="jj"; filename="ccc"\r\n'or'1
  • `[redacted]

In that reading the SQL injection payload sits inside the username parameter, which the WAF never inspected as a parameter. This made all PHP backends bypassable. PHP is a widely used programming language for websites, and its multipart parser reads the ambiguous input the second way.

Step 4: A body terminated with a new line

The second multipart issue is specific to ModSecurity. It incorrectly treated a single \n as \r\n after a body. Given this body:

Text
--boundary\r\nContent-disposition: form-data; name="parameter"\r\n\r\nbody\n--boundary\r\nContent-disposition: form-data; name="parameter2"\r\n\r\nnon-empty value--boundary--

Line by line: --boundary starts the first part. Content-disposition: form-data; name="parameter" names it parameter. \r\n\r\n ends the headers and starts the body. body is the value. Then comes a single \n, not the usual \r\n, followed by --boundary, which starts the second part. That part is named parameter2 and has the value non-empty value. --boundary-- closes the body.

ModSecurity produced two variables:

  • parameter=body
  • parameter2=non-empty value

Almost all backends instead understand it as:

Text
parameter=body\n--boundary\r\nContent-disposition: form-data; name="parameter2"\r\n\r\nnon-empty value

In that reading, the single \n does not end the first part, so everything after it, including the next boundary line and the next part's headers, becomes part of the parameter value. Exploitation is almost the same as in the empty-body case, with the slight advantage that the attacker fully controls the prefix of the request.

Charset confusion (CVE-2022-39955)

A CVE is a public identifier for a known security vulnerability, so people can refer to the same bug unambiguously. This one was rated high severity even though it allows a complete rule bypass whenever the backend understands utf-7. A charset is the rule set that maps bytes to characters. UTF-8 is the standard encoding for most of the web. UTF-7 is an older encoding that can represent any character using plain ASCII text, which makes it useful for hiding payloads from filters that only expect ASCII.

CRS only looks at the first charset= in the content type and blocks it if it is not utf-8. With

Text
Content-Type: application/json;charset=utf-8;charset=utf-7

the rule was bypassed and an express application decoded the request as utf-7. Express is a popular web framework for Node.js, a JavaScript runtime. The header lists two charsets: the first says utf-8, which satisfies the rule, and the second says utf-7, which the backend honours. UTF-7 lets you encode any characters as base64, so the body

Text
+ACcAbwByACcAMQAnAC0ALQ-

is understood by the backend as 'or'1' --, while the WAF finds nothing suspicious in the request. Base64 is a way of writing arbitrary bytes using only letters, digits and a few symbols. In UTF-7, a plus sign starts a base64 run and a minus sign ends it, so the whole string above is one encoded chunk that decodes to the SQL injection fragment.

Root cause

All of these are parser differentials. A parser differential is when two programs parse the same input differently. In the content-type cases, the regular expressions in the recommended configuration are unanchored, so a substring match anywhere in the header selects a body processor that the backend will not use. In the multipart cases, ModSecurity's parser resolves ambiguous input (a part with no body, a bare \n terminator) differently from the backend, so the WAF and the application disagree about which bytes belong to which parameter. In the charset case, CRS validates only the first charset= parameter while the backend honours a later one. In every case the WAF inspects a different interpretation of the request from the one the application acts on, and the payload only exists in the application's interpretation.

Impact

An attacker can send requests that CRS sees as harmless while the backend processes them as form parameters containing SQL injection or similar payloads. The content-type confusion arises from the recommended ModSecurity configuration. The multipart empty-body issue affected all PHP backends; the newline issue is specific to ModSecurity's parser. The charset issue requires a backend that understands utf-7, such as the express application in the example. In each case the result is a full bypass of the rules for that request.

Fix

All of the bugs are patched in the newest releases of ModSecurity and CRS. All bugs are patched in the newest releases of both projects.

Variants to test

  • Unanchored body-processor rules. Send Content-Type: application/x-www-form-urlencoded;boundary="application/xml" (or application/json) with a payload hidden in an XML comment or shaped as a JSON string. A positive result is the WAF accepting the request while the backend parses the payload as form parameters.
  • JSON bodies with no parameters. Send a JSON content type with a body such as "&email='or 1-- and check whether CRS flags it. If it passes and the backend treats it as form data, the same gap exists.
  • Multipart parts with empty bodies. Put a Content-disposition header for one part immediately followed by the next boundary, with the payload in a later part's filename or value. A positive result is the WAF reporting an empty variable while the backend folds the following bytes into the previous parameter.
  • Bare \n after a multipart body. Terminate a part body with \n instead of \r\n and follow it with a new boundary. If the WAF reports the part as complete but the backend includes the following headers in the value, the parser differential is present.
  • Duplicate charset parameters. Send Content-Type: application/json;charset=utf-8;charset=utf-7 with a UTF-7 encoded payload such as +ACcAbwByACcAMQAnAC0ALQ-. A positive result is the WAF accepting the request and the backend decoding the payload as 'or'1' --.

Glossary

  • 0day: a vulnerability that was not publicly known before it was found, so no fix existed at the time.
  • API: the part of a website that programs talk to, rather than people clicking pages.
  • Backend: the actual application behind the WAF that processes requests.
  • Base64: a way of writing arbitrary bytes using only letters, digits and a few symbols.
  • Boundary: a short marker string used in multipart bodies to separate the parts.
  • Bypass: getting an attack through a security control without being blocked.
  • Charset: the rule set that maps bytes to characters, such as UTF-8 or UTF-7.
  • Config file: a text file of settings that a program reads at startup.
  • Content-Type: the HTTP header that declares the format of a request body.
  • CRS: the OWASP ModSecurity Core Rule Set, a large collection of ready-made WAF rules.
  • CVE: a public identifier for a known security vulnerability.
  • Endpoint: a specific address on a server that handles one kind of action.
  • Express: a popular web framework for Node.js.
  • Header: a small labelled line in a request that describes the request or its body.
  • JSON: a common text format for structured data used by web APIs.
  • Live hacking event: a short, intense period where many researchers attack the same target at once.
  • ModSecurity: a well-known open-source web application firewall.
  • Multipart/form-data: the format browsers use for forms that include file uploads or several fields.
  • Parser: a program that turns raw text into meaningful pieces.
  • Parser differential: a situation where two programs parse the same input differently.
  • Payload: the piece of text an attacker sends to try to trigger a bug.
  • PHP: a widely used programming language for websites.
  • POST: the HTTP method used when sending data to a server.
  • Regular expression: a pattern-matching language for text.
  • Request: the message a browser sends to a server when you do something on a website.
  • Request body processor: the part of a WAF that decides how to parse a request body.
  • Sandbox: a test environment set up so researchers can try attacks safely.
  • SQL injection: an attack where database commands are slipped into a form field.
  • UTF-7: an older character encoding that can represent any character using plain ASCII text.
  • UTF-8: the standard character encoding for most of the web.
  • Variable: a named value that a WAF extracts from a request body.
  • WAF: web application firewall, software that sits between the internet and a website and filters requests.
  • XML: a text format for structured data built from tags in angle brackets.

More by terjanq

View all

4 more disclosed reports, best first.

More from ModSecurity

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.