-
Notifications
You must be signed in to change notification settings - Fork 8
Updated x-http-method-override rules for rest-api usage: #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joostdekeijzer
wants to merge
4
commits into
coreruleset:master
Choose a base branch
from
joostdekeijzer:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
110 changes: 110 additions & 0 deletions
110
tests/regression/wordpress-rule-exclusions-plugin/9507146.yaml
This file contains hidden or 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,110 @@ | ||
| --- | ||
| meta: | ||
| author: "Joost de Keijzer" | ||
| description: "Wordpress Rule Exclusions Plugin" | ||
| rule_id: 9507146 | ||
| tests: | ||
| - test_id: 1 | ||
| desc: Editing template part of a website i.e header or footer | ||
| stages: | ||
| - input: | ||
| dest_addr: 127.0.0.1 | ||
| headers: | ||
| Host: localhost | ||
| User-Agent: OWASP CRS test agent | ||
| Accept: application/json, */*;q=0.1 | ||
| Content-Type: application/json | ||
| x-http-method-override: PUT | ||
| port: 80 | ||
| method: POST | ||
| version: "HTTP/1.1" | ||
| # URI is actually sent with double slashes | ||
| uri: /index.php?rest_route=/wp/v2/template-parts/twentytwentyfour//header&_locale=user | ||
| # Data is sent with some special characters escaped | ||
| data: >- | ||
| {"id":"twentytwentyfour//header","content":"<!-- wp:group {\"align\":\"wide\",\"style\":{\"spacing\":{\"padding\":{\"top\":\"20px\",\"bottom\":\"20px\"}}},\"backgroundColor\":\"base\",\"layout\":{\"type\":\"constrained\"}} -->\n<div class=\"wp-block-group alignwide has-base-background-color has-background\" style=\"padding-top:20px;padding-bottom:20px\"><!-- wp:group {\"align\":\"wide\",\"layout\":{\"type\":\"flex\",\"justifyContent\":\"space-between\",\"flexWrap\":\"wrap\"}} -->\n<div class=\"wp-block-group alignwide\"><!-- wp:group {\"style\":{\"spacing\":{\"blockGap\":\"var:preset|spacing|20\"},\"layout\":{\"selfStretch\":\"fit\",\"flexSize\":null}},\"layout\":{\"type\":\"flex\"}} -->\n<div class=\"wp-block-group\"><!-- wp:site-logo {\"width\":60} /-->\n\n<!-- wp:group {\"style\":{\"spacing\":{\"blockGap\":\"0px\"}}} -->\n<div class=\"wp-block-group\"> | ||
| <!-- wp:site-title {\"level\":0} /--></div>\n<!-- /wp:group --></div>\n<!-- /wp:group -->\n\n<!-- wp:paragraph -->\n<p>testing</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:group {\"layout\":{\"type\":\"flex\",\"flexWrap\":\"wrap\",\"justifyContent\":\"left\"}} -->\n<div class=\"wp-block-group\"><!-- wp:navigation {\"ref\":21,\"style\":{\"spacing\":{\"margin\":{\"top\":\"0\"},\"blockGap\":\"var:preset|spacing|20\"},\"layout\":{\"selfStretch\":\"fit\",\"flexSize\":null}},\"layout\":{\"type\":\"flex\",\"justifyContent\":\"right\",\"orientation\":\"horizontal\"}} /--></div>\n<!-- /wp:group --></div>\n<!-- /wp:group --></div>\n<!-- /wp:group -->"} | ||
| output: | ||
| log: | ||
| no_expect_ids: [920450] | ||
| - test_id: 2 | ||
| desc: Editing global styles for a theme | ||
| stages: | ||
| - input: | ||
| dest_addr: 127.0.0.1 | ||
| headers: | ||
| Host: localhost | ||
| User-Agent: OWASP CRS test agent | ||
| Accept: application/json, */*;q=0.1 | ||
| Content-Type: application/json | ||
| x-http-method-override: PUT | ||
| port: 80 | ||
| method: POST | ||
| version: "HTTP/1.1" | ||
| uri: /index.php?rest_route=/wp/v2/global-styles/26&_locale=user | ||
| data: >- | ||
| {"id":26,"settings":{"color":{"duotone":{"theme":[{"colors":["#272727","#f9f9f9"],"slug":"duotone-1","name":"Donkergrijs en wit"},{"colors":["#272727","#5F584F"],"slug":"duotone-2","name":"Donkergrijs en walnoot"},{"colors":["#272727","#973C20"],"slug":"duotone-3","name":"Donkergrijs en kaneel"},{"colors":["#272727","#4D5B48"],"slug":"duotone-4","name":"Donkergrijs en olijfgroen"},{"colors":["#272727","#4F5959"],"slug":"duotone-5","name":"Donkergrijs en staal"}]},"gradients":{"theme":[{"slug":"gradient-1","gradient":"linear-gradient(to bottom, #5F584F 0%, #272727 100%)","name":"Verticaal zacht drijfhout naar donkergrijs"},{"slug":"gradient-2","gradient":"linear-gradient(to bottom, #6D533C 0%, #272727 100%)","name":"Verticaal zacht walnoot naar donkergrijs"}, | ||
| {"slug":"gradient-3","gradient":"linear-gradient(to bottom, #973C20 0%, #272727 100%)","name":"Verticaal zacht kaneel naar donkergrijs"},{"slug":"gradient-4","gradient":"linear-gradient(to bottom, #4D5B48 0%, #272727 100%)","name":"Verticaal zacht olijf naar donkergrijs"},{"slug":"gradient-5","gradient":"linear-gradient(to bottom, #4F5959 0%, #272727 100%)","name":"Verticaal zacht staal naar donkergrijs"},{"slug":"gradient-6","gradient":"linear-gradient(to bottom, #909090 0%, #272727 100%)","name":"Verticaal zacht tin naar donkergrijs"},{"slug":"gradient-7","gradient":"linear-gradient(to bottom, #5F584F 50%, #272727 50%)","name":"Verticaal hard beige naar donkergrijs"},{"slug":"gradient-8","gradient":"linear-gradient(to bottom, #6D533C 50%, #272727 50%)","name":"Verticaal hard walnoot naar donkergrijs"}, | ||
| {"slug":"gradient-9","gradient":"linear-gradient(to bottom, #973C20 50%, #272727 50%)","name":"Verticaal hard kaneel naar donkergrijs"},{"slug":"gradient-10","gradient":"linear-gradient(to bottom, #4D5B48 50%, #272727 50%)","name":"Verticaal hard olijf naar donkergrijs"},{"slug":"gradient-11","gradient":"linear-gradient(to bottom, #4F5959 50%, #272727 50%)","name":"Verticaal hard staal naar donkergrijs"},{"slug":"gradient-12","gradient":"linear-gradient(to bottom, #A4A4A4 50%, #272727 50%)","name":"Verticaal hard tin naar donkergrijs"}]},"palette":{"theme":[{"color":"#272727","name":"Basis","slug":"base"},{"color":"#303030","name":"Basis / Twee","slug":"base-2"},{"color":"#f9f9f9","name":"Contrast","slug":"contrast"},{"color":"#B7B7B7","name":"Contrast / Twee","slug":"contrast-2"}, | ||
| {"color":"#909090","name":"Contrast / Drie","slug":"contrast-3"},{"color":"#5F584F","name":"Accent","slug":"accent"},{"color":"#6D533C","name":"Accent / Twee","slug":"accent-2"},{"color":"#973C20","name":"Accent / Drie","slug":"accent-3"},{"color":"#4D5B48","name":"Accent / Vier","slug":"accent-4"},{"color":"#4F5959","name":"Accent / Vijf","slug":"accent-5"}]}}}} | ||
| output: | ||
| log: | ||
| no_expect_ids: [920450] | ||
| - test_id: 3 | ||
| desc: Editing widgets | ||
| stages: | ||
| - input: | ||
| dest_addr: 127.0.0.1 | ||
| headers: | ||
| Host: localhost | ||
| User-Agent: "OWASP CRS test agent" | ||
| Accept: application/json, */*;q=0.1 | ||
| Content-Type: application/json | ||
| x-http-method-override: PUT | ||
| port: 80 | ||
| method: POST | ||
| version: "HTTP/1.1" | ||
| uri: /index.php?rest_route=/wp/v2/sidebars/sidebar-1&_locale=user | ||
| data: |- | ||
| {"id":"sidebar-1","widgets":["search-2","recent-posts-2","recent-comments-2","archives-2","categories-2","meta-2","block-2","block-3"]} | ||
| output: | ||
| log: | ||
| no_expect_ids: [920450] | ||
| - test_id: 4 | ||
| desc: Save post | ||
| stages: | ||
| - input: | ||
| dest_addr: 127.0.0.1 | ||
| headers: | ||
| Host: localhost | ||
| User-Agent: "OWASP CRS test agent" | ||
| Accept: application/json, */*;q=0.1 | ||
| Content-Type: application/json | ||
| x-http-method-override: PUT | ||
| port: 80 | ||
| method: POST | ||
| version: "HTTP/1.1" | ||
| uri: /index.php?rest_route=/wp/v2/posts/1&_locale=user | ||
| data: |- | ||
| {"id":1,"content":"<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>\n\n<!-- wp:paragraph -->\n<p>dddd</p>\n<!-- /wp:paragraph -->"} | ||
| output: | ||
| log: | ||
| no_expect_ids: [920450] | ||
| - test_id: 5 | ||
| desc: Delete post | ||
| stages: | ||
| - input: | ||
| dest_addr: 127.0.0.1 | ||
| headers: | ||
| Host: localhost | ||
| User-Agent: "OWASP CRS test agent" | ||
| Accept: application/json, */*;q=0.1 | ||
| Content-Type: application/json | ||
| x-http-method-override: DELETE | ||
| port: 80 | ||
| method: POST | ||
| version: "HTTP/1.1" | ||
| uri: /index.php?rest_route=/wp/v2/posts/1&_locale=user | ||
| output: | ||
| log: | ||
| no_expect_ids: [920450] | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.