Only the latest v1.0.x release of the ModSecurity-nginx connector is
supported. Security fixes land on master and ship in the next v1.0.x
release.
Please do not report security issues publicly (no GitHub issues, pull requests or mailing lists).
Report them privately with GitHub's Report a vulnerability button. The maintainers triage the report there, coordinate a fix with you and publish the advisory together with the fixed release. Reporters are credited in the published advisory.
If you cannot use GitHub, email modsecurity@owasp.org instead.
When reporting, include the versions of the connector, libmodsecurity and nginx you are running, and the relevant nginx and ModSecurity configuration.
This repository covers the nginx connector only. Please report issues in the related projects to them directly:
- libmodsecurity (rule engine, operators, transformations, body parsers): owasp-modsecurity/ModSecurity
- OWASP CRS (rule false negatives/bypasses): coreruleset/coreruleset
If you are not sure which component is at fault, report it here and we will route it.
modsecurity_rules_remote: always use anhttps://URL. The key is a credential for the rules server; keep the nginx configuration that holds it readable only by the users that need it.modsecurity_rules_fileand any files it includes: these are loaded by nginx and control what is blocked. Make sure only trusted users can write to them, their directories and any of their parent directories.SecDebugLog/SecAuditLog: debug and audit logs can contain full request and response data, including credentials and cookies. Write them to a directory that is not world-readable (not/tmp), make the log files themselves readable only by the users that need them, and do not leave a highSecDebugLogLevelenabled in production. The debug log and the audit log files named bySecAuditLog/SecAuditLog2are opened by the nginx master process (usually root), so neither their directory nor any of its parent directories may be writable by anyone but trusted users (root and the user nginx is started as), in particular not by the nginx worker user nor through a group or ACL; otherwise whoever can write there can replace a log file, or a directory on its path, with a symlink and have root append request data to any file. Concurrent audit logging is different: the per-transaction files inSecAuditLogStorageDirare created by the worker processes, so that directory must be writable by the worker user, but by no other untrusted user, and its parent directories only by trusted users; otherwise another user can replace the directory, or one of its parents, with a symlink.modsecurity onis an nginx-level switch only. Whether rules actually block is controlled bySecRuleEnginein the loaded rules. WithSecRuleEngine DetectionOnly, or withSecRuleEnginenot set at all, rules are evaluated but never block; onlySecRuleEngine Onenforces disruptive actions. Note that libmodsecurity'smodsecurity.conf-recommendedsetsSecRuleEngine DetectionOnly: loading it, or CRS without anySecRuleEngineline, does not block. SetSecRuleEngine Onexplicitly when you want enforcement. These describe the configured mode: a rule withctl:ruleEnginecan change it for a single transaction, either way. Whether a match is logged depends on the rules and the logging configuration (for example, rules withnologare not logged).