Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions src/nssec/modules/waf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,24 @@
# These rules prevent false positives on the NetSapiens management UI
# and API endpoints while keeping CRS protection active for everything else.

# ---- Admin UI form submissions trigger SQL injection false positives ----
SecRuleUpdateTargetById 942100 "!REQUEST_COOKIES"
SecRuleUpdateTargetById 942200 "!REQUEST_COOKIES"

# ---- Third-party tracking cookies trigger RCE false positives ----
# Reddit (_rdt_*), Google (_ga, _gid), Facebook (_fbp) etc. use delimiters
# that match shell patterns like ~N (directory stack) or command separators.
SecRuleUpdateTargetById 932270 "!REQUEST_COOKIES"
# ---- Admin UI form submissions and third-party tracking cookies ----
# Cookies from admin UI sessions trigger SQL injection false positives (942100,
# 942200). Reddit (_rdt_*), Google (_ga, _gid), Facebook (_fbp) etc. use
# delimiters that match shell patterns like ~N (directory stack), triggering
# RCE false positives (932270).
#
# Uses runtime ctl:ruleRemoveTargetById so this works regardless of whether
# the exclusions file loads before or after the CRS rules (e.g. when the
# default Debian wildcard IncludeOptional /etc/modsecurity/*.conf picks up
# this file alphabetically before the CRS rules are loaded).
SecAction \
"id:1000009,\\
phase:1,\\
pass,\\
nolog,\\
ctl:ruleRemoveTargetById=942100;REQUEST_COOKIES,\\
ctl:ruleRemoveTargetById=942200;REQUEST_COOKIES,\\
ctl:ruleRemoveTargetById=932270;REQUEST_COOKIES"

# ---- NS API endpoints use base64 in query strings ----
SecRule REQUEST_URI "@beginsWith /ns-api/" \\
Expand Down
Loading