Skip to content

Misleading XML parsing error on valid XML bodies #1441

@heaven

Description

@heaven

Description

Coraza v3.3.3

When processing valid XML (e.g., WordPress XML-RPC requests), Coraza logs a "Failed to process request body" error, suggesting a parsing failure. However, the XML parses correctly and the interruption is due to CRS rule 200002. This creates the impression of internal parser errors rather than an expected rule block.

Relevant code

tx.debugLogger.Error().Err(err).Msg("Failed to process request body")

Steps to reproduce

  1. Enable CRS on Coraza v3.3.3.
  2. Send a valid XML-RPC request to /xmlrpc.php.
  3. Observe an XML error in the log.

Here is an example (formatted for readability):

<?xml version="1.0"?>
<methodCall>
  <methodName>wp.getUsersBlogs</methodName>
  <params>
    <param><value><string>admin</string></value></param>
    <param><value><string>admin</string></value></param>
  </params>
</methodCall>

Expected result

The error should fire when there is an actual problem with the XML, an internal error, e.g., if we fed some binaly, compressed, or partial data to the parser.

Actual result

We receive an interruption along with a missleading error in the log, which possibly masks underlying problems and adds unnecessary noise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions