Skip to content

Information disclosure - statuscode response containing WAF type #1975

Open

Description

@erikvdijk

The response status code of a blocked request contains the text: "ModSecurity Action"
This way an attacker could find for specific security holes in this product.

It would be great if this text could be changed by parameter, or not send at all.

Code:
https://github.com/SpiderLabs/ModSecurity/blob/v2/master/iis/mymodule.cpp#L670

(this is my first bug report, sorry for any possible missing information)

Activity

  1. added
    2.x
    on Dec 10, 2018
  2. zimmerle commented on Dec 10, 2018

    @zimmerle
    Contributor

    Hi @erikvdijk,

    Thank you for the report. This issue was placed in triage.

  3. gstanchev commented on Nov 19, 2020

    @gstanchev

    Hi, any news on resolution?

  4. zimmerle commented on Nov 20, 2020

    @zimmerle
    Contributor

    Hi @gstanchev,

    Not really. Latests release for IIS was - v2.9.3

  5. martinhsv commented on Sep 16, 2022

    @martinhsv
    Contributor

    This is not ideal behaviour. As the OP notes, intentionally giving away which WAF is protecting a site can give a malicious actor an advantage.

    The two most obvious approaches here are:

    1. Make the reason-phrase on the status line empty.

    The relevant RFC (https://www.rfc-editor.org/rfc/rfc7230#section-3.1.2) notes that it can be empty ("a possibly empty textual phrase describing the status code"). This is probably better than the status quo.

    On the other hand it might not be that much better than the status quo. Since IIS appears to normally populate the reason-phrase, leaving it empty could be enough to give a malicious actor a clue.

    1. Populate the reason-phrase on the status-line with the standard text(s)

    This is reasonable, but I'd prefer to be able to set these using the Native API. Unfortunately, I cannot find anything in the documentation that would allow retrieval of IIS's normal status-phrase using the 3-digit status. If anyone knows how to do this and would like to share, it would be appreciated.

    The alternative is to duplicate those phrases directly in ModSecurity's IIS code. If we only had to concern ourselves with 400 and 403 that might be reasonable. But since we support more flexibility than that, this approach becomes increasingly unappetizing.

  6. fzipi commented on Oct 12, 2026

    @fzipi
    Collaborator

    Revisiting this one. Still the case: iis/mymodule.cpp sets the status line reason phrase to "ModSecurity Action" in two places. Of @martinhsv's options, an empty reason phrase is the smallest change and RFC 7230 explicitly allows it. The open IIS PRs (#3613, #3618, #3620) do not touch this. 2.x IIS only; whether it is worth a PR depends on whether IIS builds are still maintained.

    Needs a maintainer decision.

  7. added
    needs decision
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.xPlatform - IISneeds decisionwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions