Transformations
A condition's transformations run in order on a copy of each field's value. Results are cached per field and step prefix, so rules that share leading steps share the work. The descriptions below state each transformation’s behavior; compatibility fixtures cover the supported ModSecurity cases.
| Transformation | Since | Description |
|---|---|---|
UriDecode |
1.0.0-alpha9 | Decodes percent-encoded bytes, %u escapes and plus signs using the URL decoding compatibility rules, keeping each byte that is not valid UTF-8 as its Latin-1 character. |
HtmlEntityDecode |
1.0.0-alpha9 | Decodes named and numeric HTML entities, including entities without a trailing semicolon and the HTML5 names for ASCII punctuation and whitespace such as : and 	. |
Lowercase |
1.0.0-alpha9 | Converts the value to lowercase using invariant rules. |
NormalizeUnicode |
1.0.0-alpha9 | Applies Unicode NFKC normalisation. |
RemoveNulls |
1.0.0-alpha9 | Removes NUL characters. |
CompressWhitespace |
1.0.0-alpha9 | Collapses every run of whitespace, line breaks included, into one space. |
NormalizePath |
1.0.0-alpha9 | Converts backslashes to slashes and resolves dot segments and repeated slashes in a path. |
Base64Decode |
1.0.0-alpha9 | Decodes a base64 prefix, ignoring ASCII whitespace and stopping at padding or an invalid character, within the decoded-size limit. |
JavaScriptDecode |
1.0.0-alpha9 | Decodes JavaScript hexadecimal, Unicode (including \u{...} code points), octal and simple escapes using the compatibility decoder. |
CssDecode |
1.0.0-alpha9 | Decodes CSS hexadecimal and character escapes using the compatibility decoder. |
EscapeSequenceDecode |
1.0.0-alpha9 | Decodes ANSI C hexadecimal, octal and simple escape sequences. |
HexDecode |
1.0.0-alpha9 | Decodes pairs as bytes and reads the result as UTF-8, ignoring an unmatched final character. |
EncodeNonAsciiAsPercentU |
1.0.0-alpha9 | Rewrites each non-ASCII Unicode scalar as a %u escape with at least four hexadecimal digits. |
NormalizeCommandLine |
1.0.0-alpha9 | Normalises command lines: removes backslashes, quotes and carets, turns commas and semicolons into spaces, collapses whitespace, removes spaces before slashes and parentheses, and lowercases. |
RemoveWhitespace |
1.0.0-alpha9 | Removes all whitespace. |
ReplaceComments |
1.0.0-alpha9 | Replaces each C-style comment with a single space. |
RemoveCommentCharacters |
1.0.0-alpha9 | Removes comment markers: /*, */, -- and #. |
Base64UrlDecode |
1.0.0-alpha9 | Decodes a base64url prefix with optional padding, ignoring ASCII whitespace, within the decoded-size limit. |
Base64AutoDecode |
1.0.0-alpha9 | Decodes sufficiently long base64 or base64url runs, reading a single space inside a standard-alphabet run as a plus sign, when the decoded bytes are valid UTF-8 or at least three quarters printable ASCII; other bytes are kept as Latin-1 characters. |
Decompress |
1.0.0-alpha9 | Detects gzip or zlib-wrapped deflate by its header, otherwise tries Brotli, and exceeds the inspection budget when the output passes the decompression settings. |
ExpandUtf8Bytes |
1.0.0-alpha9 | Produces a byte view in which each UTF-8 byte becomes one character. |
TruncateToLowByte |
1.0.0-alpha9 | Keeps each character's low byte, which reveals CRLF smuggled as U+560A or U+560D. |
EvaluateLookups |
1.0.0-alpha9 | Folds Log4j and expression-language lookups such as $, $ and $, exceeding the inspection budget beyond the depth or decoded-size caps. |
FoldExpressionStrings |
1.0.0-alpha9 | Folds string concatenation and escapes inside quotes, such as 'a'+'b' and \x5f. |
ExtractSerializedTypeNames |
1.0.0-alpha9 | Outputs the type names found in Java serialization, .NET NRBF, Python pickle, YAML tags and PHP serialized objects; nothing is deserialized. |
ExtractUriScheme |
1.0.0-alpha9 | Returns the scheme from the engine's WHATWG-style URL parser, or an empty value if parsing fails. |
ExtractUriHost |
1.0.0-alpha9 | Returns the host from the engine's WHATWG-style URL parser, or an empty value if parsing fails. |