-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: exclude json.styles from SQL injection detection (#18)
* fix: exclude json.styles from SQL injection detection The full site editor (Gutenberg) sends style information in a JSON document. CSS style switches are detected by libinjection as SQL comments. This commit creates a new rule (and associated test) that removes the `json.styles` argument from detection by rule 942100. Fixes #16
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
tests/regression/wordpress-rule-exclusions-plugin/9507145.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
meta: | ||
author: "Max Leske" | ||
description: "Wordpress Rule Exclusions Plugin" | ||
enabled: true | ||
name: 9507145.yaml | ||
tests: | ||
- test_title: 9507145-1 | ||
desc: Disable SQL injection checks for full site editor | ||
stages: | ||
- stage: | ||
input: | ||
dest_addr: 127.0.0.1 | ||
headers: | ||
Host: localhost | ||
User-Agent: OWASP ModSecurity Core Rule Set | ||
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | ||
Content-Type: application/json | ||
port: 80 | ||
method: POST | ||
uri: /index.php?rest_route=%2Fwp%2Fv2%2Fglobal-styles%2F50&_locale=user | ||
# stripped down version of the full payload | ||
data: | | ||
{"id":50,"styles":{"blocks":{"core/comment-author-name":{"elements":{"link":{":active":{"color":{"text":"var(--wp--preset--color--tertiary)"}}}}}},"color":{"gradient":"var(--wp--preset--gradient--dots)"},"elements":{"button":{":active":{"color":{"background":"var(--wp--preset--color--secondary)","gradient":"none"}},":focus":{"color":{"gradient":"var(--wp--preset--gradient--secondary-primary)"}},":hover":{"color":{"gradient":"var(--wp--preset--gradient--secondary-primary)"}},":visited":{"color":{"text":"var(--wp--preset--color--base)"}},"border":{"radius":"5px"},"color":{"gradient":"var(--wp--preset--gradient--primary-secondary)","text":"var(--wp--preset--color--base)"}}}},"settings":{"color":{"duotone":{"theme":[{"colors":["#222828","#9EF9FD"],"slug":"default-filter","name":"Default filter"}]}}}} | ||
output: | ||
no_log_contains: id "942100" |