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/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software: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 · 3d 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/web/releases.go +2−2

@@ -195,7 +195,7 @@ func (w *Web) ReleaseArtifact(rw http.ResponseWriter, r *http.Request) {
195 195 rw.Header().Set("X-Content-Type-Options", "nosniff")
196 196 rw.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=%q",
197 197 releaseSafe(name)))
198 rw.Header().Set("Cache-Control", "public, max-age=300")
198 rw.Header().Set("Cache-Control", w.downloadCacheControl(m))
199 199 // ServeContent handles Range and the conditional request against the ETag
200 200 // above, which is what makes a 100 MiB artifact resumable.
201 201 http.ServeContent(rw, r, releaseSafe(name), time.Time{}, f)
@@ -253,7 +253,7 @@ func (w *Web) releaseArchive(rw http.ResponseWriter, r *http.Request, format str
253 253 // else can change the bytes.
254 254 etag := `"` + releaseSafe(t.OID) + "-" + strings.ReplaceAll(format, ".", "") + `"`
255 255 rw.Header().Set("ETag", etag)
256 rw.Header().Set("Cache-Control", "public, max-age=300")
256 rw.Header().Set("Cache-Control", w.downloadCacheControl(m))
257 257 rw.Header().Set("Content-Type", contentType)
258 258 // Always an attachment: an archive is not a document, and serving one that a
259 259 // browser might render would put other people's bytes on this origin.