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.

Fuzz the path validators and the Markdown sanitizer

5fce878d41da32448803f3a4f4d42c7841fba331 · Keenan Nemetz · 10d ago · parent d9f5a930

Fuzz the path validators and the Markdown sanitizer

Two pieces of untrusted text decide where a file is written and what a browser
runs: the validators that turn a request path, an artifact glob, or a site
directory into a place under a root, and the markdown boundary where goldmark and
bluemonday turn a pushed body into HTML a page trusts.

The sanitizer assertions parse the output with an HTML parser rather than
searching the string, because the difference is the whole question: a script tag
rendered as text is a text node, and hand-written <script> looks the same to a
substring search. The test asks what the browser will do: no script-shaped
element, no on* attribute, and no scheme outside http, https, mailto.

The path targets state the guarantee the way the caller uses it -- joined to a
root, the result stays under that root -- and pin that cleaning is idempotent, so
one page cannot become two cache keys.

cleanPath's comment claimed dot segments were refused; they are resolved, and the
comment now says so, which is what the property pins.

Closes #98.

CONTRIBUTING.md +4−3

@@ -161,9 +161,10 @@ commands with the same flags the image sets
161 161 `CGO_ENABLED=1 go test -tags libsqlite3 -race ./...`) and say which check you
162 162 could not run.
163 163
164 Fuzz targets live beside the parsers they drive — `server/ssh`, `server/githttp`,
165 `core/lfs`, `metadata`, and `ci` — and every one of them runs its seed corpus under
166 `go test ./...`, so a normal push covers everything already found. To spend longer on one, name it
164 Fuzz targets live beside the parsers and validators they drive — `server/ssh`,
165 `server/githttp`, `server/pages`, `server/web`, `core/lfs`, `metadata`, and `ci` —
166 and every one of them runs its seed corpus under `go test ./...`, so a normal push
167 covers everything already found. To spend longer on one, name it
167 168 and give it a budget:
168 169
169 170 ```sh