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
C++Apache-2.0Created 2011-02-02www.modsecurity.org
下载:v3.0.17v3.0.17 ↓3.0.172026-09-29
+0
日增长
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

Latest release

v3.0.17 v3.0.17 2026-09-29
Major 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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON