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 metadata and workflow parsers

d9f5a930d9e6aa20b5dbfb00d154afd46df901ab · Keenan Nemetz · 10d ago · parent 16bf0ebf

Fuzz the metadata and workflow parsers

A push decides how much of this code runs: frontmatter becomes the object every
page renders, and workflow YAML becomes the job the runner executes. Neither was
fuzzed, and both accept bytes from anyone allowed to push.

Four targets, each asserting the property that makes the pair of reader and
writer safe rather than waiting for a panic: an accepted issue or comment must
render and re-parse identically, and a second write must not change a byte; an
accepted workflow must be one the runner can act on; an accepted image
definition must not add a line to the Dockerfile it renders.

FuzzParseComment found one asymmetry in under a second: a hand-written file
without a trailing newline is normalized on the first write. That is the format
working as designed, since every writer trims and nothing compares raw bodies, so
the property now says so and the input is committed as a seed.

The YAML bomb is pinned by a test with two assertions, because the parser refuses
it on the unknown keys before expansion is reached, and it is yaml.v3's own
aliasing limit that covers a bomb inside a field the schema knows.

Closes #97.

metadata/testdata/fuzz/FuzzParseComment/bb6303671997e95a +2

@@ -0,0 +1,2 @@
1 go test fuzz v1
2 string("---\nauthor: 0\ncreated: 0000-10-10T0:00:00Z\n---\n0")