owasp-modsecurity / owasp-modsecurity/ModSecurity

SecRuleScript actions always considered disruptive

Open
#3,108 1 comment 1 reaction 3 assignees View on GitHub

@fzipi is already working on this.

Since Sep 14, 2026.

  • #3627 by @copilot-swe-agent — open
3.x bug
Dominant language
C++
Stars
9.8k
Forks
1.8k
Avg merge
2h 46m
Merged PRs (30d)
1

Description

The following block triggers an error in v3 (nginx):

SecRule REQUEST_FILENAME "@unconditionalMatch" \
  "id:888888,\
  phase:1\
  chain"
  SecRuleScript test.lua "nolog"

The error is:

nginx: [emerg] "modsecurity_rules_file" directive Disruptive actions can only be specified by chain starter rules. in /usr/local/nginx/conf/conf.d/npm.conf:13
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed

To Reproduce

  1. Lua must be enabled for ModSecurity
  2. Use the rule block above
  3. Create a Lua script file like the following, named "test.lua":
function main()
    return nil;
end
  1. Put the Lua script into the same directory as the rule file
  2. Start / reload nginx

Expected behavior

nolog is not a disruptive action in the source code and should not trigger the error. The reason we even noticed this behaviour is, that the documentation says that actions are optional for SecRuleScript but the parser cannot cope with such a rule and will throw an error while parsing the next rule, because it thinks that the end of the last rule wasn't reached.

Full discussion: https://github.com/coreruleset/body-decompress-plugin/issues/4.

Server

  • ModSecurity version (and connector): v3.0.12; connector v1.0.3
  • WebServer: nginx 1.25.3
  • OS (and distro): Debian Linux

** Additional context**

The actions list of SecRuleScript is currently mandatory, even though the documentation says it isn't. However, the parser throws an error while parsing the next rule, instead of complaining about the missing actions list. This is very confusing to users.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.