Compare commits
1
Commits
7f1b0a14b4
...
1e0bfa92da
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e0bfa92da |
No files matched your search
@@ -692,6 +692,17 @@ func TestOrdinaryGiteaRequestsPassAndAttacksAreRefused(t *testing.T) {
|
|||||||
t.Errorf("%s let through: %+v", target, got)
|
t.Errorf("%s let through: %+v", target, got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Nor is a page opened from them.
|
||||||
|
for _, attack := range []string{
|
||||||
|
"<script>alert(1)</script>",
|
||||||
|
"1' OR '1'='1",
|
||||||
|
} {
|
||||||
|
referer := "Referer: https://example.com" + path + "?q=" + attack
|
||||||
|
if got := inspect(t, crs, get("/", referer)); got.Score < threshold {
|
||||||
|
t.Errorf("%s let through: %+v", referer, got)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,13 +83,16 @@ SecRule REQUEST_FILENAME "@rx ^/(?:explore/code|issues(?:/search)?|pulls|\
|
|||||||
# 941160: <img src=
|
# 941160: <img src=
|
||||||
# 942100: LIKE '%foo%'
|
# 942100: LIKE '%foo%'
|
||||||
# 944100: java.lang.Runtime
|
# 944100: java.lang.Runtime
|
||||||
|
# A repository with the owner api is left out here too.
|
||||||
SecRule REQUEST_HEADERS:Referer "@rx ^https?://[^/]+/(?:explore/code|\
|
SecRule REQUEST_HEADERS:Referer "@rx ^https?://[^/]+/(?:explore/code|\
|
||||||
issues(?:/search)?|pulls|[^/]+/-/code|\
|
issues(?:/search)?|pulls|[^/]+/-/code|\
|
||||||
[^/]+/[^/]+/(?:search|issues(?:/search)?|pulls|\
|
[^/]+/[^/]+/(?:search|issues(?:/search)?|pulls|\
|
||||||
commits/(?:branch|tag|commit)/.+/search)|\
|
commits/(?:branch|tag|commit)/.+/search)|\
|
||||||
api/v1/repos/(?:issues/search|[^/]+/[^/]+/issues))\?" \
|
api/v1/repos/(?:issues/search|[^/]+/[^/]+/issues))\?" \
|
||||||
"id:900601,phase:1,pass,nolog,\
|
"id:900601,phase:1,pass,nolog,chain"
|
||||||
ctl:ruleRemoveTargetById=941110;REQUEST_HEADERS:Referer,\
|
SecRule REQUEST_HEADERS:Referer "!@rx ^https?://[^/]+/api/[^/]+/(?:search|\
|
||||||
|
issues(?:/search)?|pulls|commits/(?:branch|tag|commit)/.+/search)\?" \
|
||||||
|
"ctl:ruleRemoveTargetById=941110;REQUEST_HEADERS:Referer,\
|
||||||
ctl:ruleRemoveTargetById=941120;REQUEST_HEADERS:Referer,\
|
ctl:ruleRemoveTargetById=941120;REQUEST_HEADERS:Referer,\
|
||||||
ctl:ruleRemoveTargetById=941160;REQUEST_HEADERS:Referer,\
|
ctl:ruleRemoveTargetById=941160;REQUEST_HEADERS:Referer,\
|
||||||
ctl:ruleRemoveTargetById=942100;REQUEST_HEADERS:Referer,\
|
ctl:ruleRemoveTargetById=942100;REQUEST_HEADERS:Referer,\
|
||||||
|
|||||||
Reference in new issue
Block a user