Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

Harden sign-in input bounds and private response caching

25343521418945b250da2fb29d27cffe34ee2a6e · Keenan Nemetz · 2d ago · parent b492b557

Harden sign-in input bounds and private response caching

Bound the account name in LoginBegin before it reaches the per-account rate
limiter or the ceremony store, and bound the passkey label and the credential
fields copied from an authenticator. Rate-limit keys are capped by hashing a
long value, forwarding headers used as addresses are capped, and expired limiter
entries are swept as the table grows.

Mark downloads and rendered pages private unless the repository is readable
anonymously. A private repository's artifact, archive, run artifact, raw file,
and HTML pages previously either carried a public cache directive or no
directive at all, so a shared cache could serve them to an anonymous reader.

Refs #209 (01M6S78Y7EQY596Y9TQRSNRVSE).
Refs #210 (01M6S7936QAYM9TMSCXCYP2CF9).

server/artifacts_test.go +16

@@ -161,4 +161,20 @@ func TestRunArtifactsArePrivateForPrivateRepos(t *testing.T) {
161 161 t.Fatalf("%s on a private repo = %d, want 404", path, code)
162 162 }
163 163 }
164
165 // An authorized reader may fetch the page and the bytes; a shared cache must
166 // not keep either and serve it to an anonymous reader.
167 _, cookie := f.browserSession(t, f.ownerID)
168 for _, path := range []string{
169 "/r/" + f.repo + "/runs/" + done.ID,
170 "/r/" + f.repo + "/runs/" + done.ID + "/artifacts/tool-linux",
171 } {
172 resp, _ := f.browserGet(t, path, cookie)
173 if resp.StatusCode != http.StatusOK {
174 t.Fatalf("%s = %d, want 200 for the owner", path, resp.StatusCode)
175 }
176 if cc := resp.Header.Get("Cache-Control"); strings.Contains(cc, "public") {
177 t.Fatalf("%s: Cache-Control = %q on a private repository", path, cc)
178 }
179 }
164 180 }