Skip to content

Document TX:MSC_PCRE_ERROR in ModSecurity v2 and v3 - #4

Open
fzipi wants to merge 2 commits into
mainfrom
docs/v2-msc-pcre-error
Open

fzipi wants to merge 2 commits into
mainfrom
docs/v2-msc-pcre-error

Conversation

@fzipi

@fzipi fzipi commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

what

  • MSC_PCRE_ERROR: the entry said the flag was libModSecurity v3 only. Both engines now set TX:MSC_PCRE_ERROR, which rule 200005 (TX:/^MSC_/) catches. ModSecurity v2 sets it since 2.9.16 and libModSecurity v3 since 3.0.18. Earlier v3 releases set only the standalone variable.
  • The reserved TX names list gets an MSC_PCRE_ERROR entry next to MSC_PCRE_LIMITS_EXCEEDED.
  • @rx: a new paragraph says that on a regex error neither @rx nor !@rx matches, and that before 2.9.16 v2 matched the negated form. The v3 note mentions the TX flag.
  • The recommended base configuration explains which versions let rule 200005 see regex errors.

why

This is the docs follow-up promised in the reviews of owasp-modsecurity/ModSecurity#3709 (v2) and owasp-modsecurity/ModSecurity#3711 (v3), both for owasp-modsecurity/ModSecurity#3123.

notes

🤖 Generated with Claude Code

Since owasp-modsecurity/ModSecurity#3709 (released in 2.9.16), v2 sets
TX:MSC_PCRE_ERROR when an @rx pattern is invalid after macro expansion
or a regex execution fails, and a negated !@rx no longer matches on a
regex error. The MSC_PCRE_ERROR entry still called the flag v3-only.

Update the variable entry, the reserved TX names list, the @rx notes
and the explanation of rule 200005 in the recommended configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RiUJuqXNvvpytiGRiDFyTy
owasp-modsecurity/ModSecurity#3711 makes @rx and @rxglobal set
TX:MSC_PCRE_ERROR next to the standalone variable, including on match
limit errors, so rule 200005 sees every regex error. Replace the
statement that v3 does not set the TX flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RiUJuqXNvvpytiGRiDFyTy
@fzipi fzipi changed the title Document TX:MSC_PCRE_ERROR in ModSecurity v2 Document TX:MSC_PCRE_ERROR in ModSecurity v2 and v3 Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant