owasp-modsecurity /ModSecurity
ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analysis.
★ 9,872⑂ 1,762👁 373⑃ 1,159● 2,576▤ 42
+0
Daily
9,872
stars
1,762
forks
373
watchers
1,159
prs
2,576
issues
42
releases
README
!Quality Assurance Libmodsecurity is one component of the ModSecurity v3 project. The library codebase serves as an interface to ModSecurity Connectors taking in web traffic and applying traditional ModSecurity processing. In general, it provides the capability to load/interpret rules written in the ModSecurity SecRules format and apply them to HTTP content provided by your application via Connectors. If you are looking for ModSecurity for Apache (aka ModSecurity v2.x), it is still under maintenance and available: here. What is the difference between this project and the old ModSecurity (v2.x.x)? All Apache dependencies have been removed Higher performance New features New architecture Libmodsecurity is a complete rewrite of the ModSecurity platform. When it was first devised the ModSecurity project started as just an Apache module. Over time the project has been extended, due to popular demand, to support other platforms including (but not limited to) Nginx and IIS. In order to provide for the growing demand for additional platform support, it has became necessary to remove the Apache dependencies underlying this project, making it more platform independent. As a result of this goal we have rearchitected Libmodsecurity such that it is no longer dependent on the Apache web server (both at compilation and during runtime). One side effect of this is that across all platforms users can expect increased performance. Additionally, we have taken this opportunity to lay the groundwork for some new features that users have been long seeking. For example we are looking to natively support auditlogs in the JSON format, along with a host of other functionality in future versions. It is no longer just a module. The 'ModSecurity' branch no longer contains the traditional module logic (for Nginx, Apache, and IIS) that has traditionally been packaged all together. Instead, this branch only contains the library portion (libmodsecurity) for this project. This library is consumed by what we have termed 'Connectors' these connectors will interface with your webserver and provide the library with a common format that it understands. Each of these connectors is maintained as a separate GitHub project. For instance, the Nginx connector is supplied by the ModSecurity-nginx project (https://github.com/owasp-modsecurity/ModSecurity-nginx). Keeping these connectors separated allows each project to have different release cycles, issues and development trees. Additionally, it means that when you install ModSecurity v3 you only get exactly what you need, no extras you won't be using. Compilation Before starting the compilation process, make sure that all required dependencies are installed. See the Dependencies and Git submodules section for further information. After compilation, make sure that there are no issues on your build/platform. We strongly recommend running the unit tests and regression tests. These test utilities are located in the
Top issues
#2465SecRequestBodyAccess off skips the phase:2 rules57 comments · 2020-12-02#3300Segmentation fault in ModSecurity 2.9 for Apache50 comments · 2024-11-13#3308Drop YAJL dependency41 comments · 2024-11-26#2848Memory leaks with nginx reload (without restart)33 comments · 2022-12-21#2494Problems with blocking if response is using compression28 comments · 2021-01-06#1471Multipart: Final boundary missing.26 comments · 2017-06-26#3394ip collection does not seem to work properly with latest ModSecurity25 comments · 2025-05-29#2341PATCH method dies with mod security with nginx configured as proxy/ingress23 comments · 2020-06-16
Latest release
v3.0.17 v3.0.17 2026-09-29Major changes in v3: [fix: t:htmlEntityDecode does not decode all ASCII named HTML entities] [PR from private repo - @marcstern, @fzipi, @airween; fixed GHSA-cxqf-vgrr-xxrv] [fix: use secure value for host verification in case of remote rules download] [PR from private repo - @amitu314, @airween; fixed GHSA-2vqc-36qp-ccmw] [fix: uninitialized pointer dereference in XML request body processor] [PR from private repo - Tobias Klein (www.trapkit.de), @airween; fixed GHSA-jx3r-phvx-2jmj] [fix: response body inspection bypass with mixed case Content-Type value] [PR from