Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7f8a59de04 |
No files matched your search
@@ -812,9 +812,9 @@ The changes hold in front of every app, and no setting undoes them:
|
||||
a push reuses a layer, `from` names the image the layer comes from. An image
|
||||
such as `owner/python3-app` would have that push refused.
|
||||
8. On gitea's paths, some fields skip the rules that refused ordinary gitea
|
||||
requests there. They are the fields where gitea sends a search, a file name,
|
||||
a branch name or a repository's name. `internal/coreruleset/gitea.conf` lists
|
||||
each rule and the request it refused. The fields are:
|
||||
requests there. They are the fields where gitea sends a search, a file name
|
||||
or a branch name. `internal/coreruleset/gitea.conf` lists each rule and the
|
||||
request it refused. The fields are:
|
||||
- `q` on gitea's searches of code, of issues and pull requests, and of
|
||||
commits. A code search holds code, such as `<script>`,
|
||||
`SELECT * FROM users WHERE` or `../`.
|
||||
@@ -884,11 +884,6 @@ The changes hold in front of every app, and no setting undoes them:
|
||||
- to start a release from a tag;
|
||||
- to edit a branch protection rule;
|
||||
- to list a directory's last commits.
|
||||
- `id` of the admin forms that adopt or delete an unadopted repository, for
|
||||
the lists of system files and command names (930120, 932120, 932260). `id`
|
||||
holds the repository's owner and name, such as `alice/python3-app` or
|
||||
`alice/.profile`. gitea serves the forms at `/-/admin/repos/unadopted` and
|
||||
Forgejo at `/admin/repos/unadopted`.
|
||||
- The `Content-Range` header of an artifact upload from
|
||||
`actions/upload-artifact@v3` (920450).
|
||||
- The passwords in a body, for each rule that random passwords set off. The
|
||||
|
||||
@@ -2421,51 +2421,6 @@ func TestGiteaBodiesTheCoreRuleSetRefuses(t *testing.T) {
|
||||
)
|
||||
}
|
||||
|
||||
func TestGiteaFormsThatAdoptARepositoryLetItsNameThrough(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
const threshold = 5 // SWW_WAF_ANOMALY_THRESHOLD's default
|
||||
|
||||
crs := readingBodies(t)
|
||||
|
||||
// gitea's path, then Forgejo's.
|
||||
for _, path := range []string{
|
||||
"/-/admin/repos/unadopted",
|
||||
"/admin/repos/unadopted",
|
||||
} {
|
||||
r := request{http.MethodPost, path, []string{formData}}
|
||||
|
||||
for _, action := range []string{"adopt", "delete"} {
|
||||
for _, name := range []string{
|
||||
"alice%2Fpython3-app",
|
||||
"alice%2Fpowershell-scripts",
|
||||
"alice%2F.profile",
|
||||
} {
|
||||
body := "id=" + name + "&action=" + action + "&q=&page=1"
|
||||
wantBody(t, crs, r, body, coreruleset.Result{}, body)
|
||||
}
|
||||
}
|
||||
|
||||
// Attacks in id are still refused.
|
||||
for _, attack := range []string{
|
||||
sqlInjection,
|
||||
scriptInjection,
|
||||
commandInjection,
|
||||
"..%2F..%2Fetc%2Fpasswd",
|
||||
} {
|
||||
body := "id=" + attack + "&action=adopt&q=&page=1"
|
||||
if got, _ := inspectBody(t, crs, r, body); got.Score < threshold {
|
||||
t.Errorf("POST %s %s let through: %+v", path, body, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// On another path, id keeps those rules.
|
||||
r := request{http.MethodPost, "/-/admin/repos", []string{formData}}
|
||||
body := "id=alice%2Fpython3-app&action=adopt&q=&page=1"
|
||||
wantBody(t, crs, r, body, matched(932260), body)
|
||||
}
|
||||
|
||||
func TestTypesEndingInXMLOrJSONAndTextJSONAreRead(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
# The eighth change: on gitea's paths, some fields skip the rules that refused
|
||||
# ordinary gitea requests there. They are the fields where gitea sends a search,
|
||||
# a file name, a branch name or a repository's name. Each exclusion runs with
|
||||
# the request, before the rules it switches off, those of phase 1 included, so
|
||||
# this file is loaded before the Core Rule Set's rules. Each comment names a
|
||||
# request the rule refused.
|
||||
# a file name or a branch name. Each exclusion runs with the request, before the
|
||||
# rules it switches off, those of phase 1 included, so this file is loaded before
|
||||
# the Core Rule Set's rules. Each comment names a request the rule refused.
|
||||
|
||||
# gitea's searches of code, of issues and pull requests, and of commits send the
|
||||
# text searched for in q, which skips these rules there:
|
||||
@@ -323,19 +322,6 @@ SecRule REQUEST_FILENAME \
|
||||
"id:900640,phase:1,pass,nolog,\
|
||||
ctl:ruleRemoveTargetById=920450;REQUEST_HEADERS_NAMES:Content-Range"
|
||||
|
||||
# The admin forms that adopt or delete an unadopted repository send its owner
|
||||
# and name in id, as alice/python3-app. id skips these rules there:
|
||||
# 930120: alice/.profile
|
||||
# 932120: alice/powershell-scripts
|
||||
# 932260: alice/python3-app
|
||||
# gitea serves the forms at /-/admin/repos/unadopted and Forgejo at
|
||||
# /admin/repos/unadopted.
|
||||
SecRule REQUEST_FILENAME "@rx ^/(?:-/)?admin/repos/unadopted$" \
|
||||
"id:900645,phase:1,pass,nolog,\
|
||||
ctl:ruleRemoveTargetById=930120;ARGS:id,\
|
||||
ctl:ruleRemoveTargetById=932120;ARGS:id,\
|
||||
ctl:ruleRemoveTargetById=932260;ARGS:id"
|
||||
|
||||
# The passwords skip each rule that random passwords set off:
|
||||
# password: signing in, signing up, linking an account, activating an account,
|
||||
# resetting or changing the password, deleting an account, and creating or
|
||||
|
||||
Reference in new issue
Block a user