Skip to content

Boxfile: a YAML library panic is a parse error, not a crash - #25

Merged
chxmxii merged 1 commit into
chxperiments:mainfrom
KoLDXr00T:fix/boxfile-yaml-panic
Oct 11, 2026
Merged

chxmxii merged 1 commit into
chxperiments:mainfrom
KoLDXr00T:fix/boxfile-yaml-panic

Conversation

@KoLDXr00T

Copy link
Copy Markdown
Contributor

Fixes the fuzz (FuzzParse) failure on main after #17.

The fuzzer found that goccy/go-yaml v1.19.2 (the latest release) panics with a nil dereference when a bare ! tag stands where a list is expected. A Boxfile of just

packages: !

crashed box. Parse now recovers a panic from the decoder and returns it as a parse error.

  • The CI crasher is committed under internal/boxfile/testdata/fuzz/FuzzParse/, so it runs as a seed with every go test.
  • TestParseSurvivesYAMLPanic covers the minimal inputs.
  • Checked: go test -race ./...; FuzzParse for 3 minutes (~970k execs) with no further crashers.

goccy/go-yaml v1.19.2, the latest release, dereferences nil when a bare
"!" tag stands where a list is expected: a Boxfile of "packages: !" took
box down. Parse now recovers a panic from the decoder and reports it as an
error. Found by FuzzParse on main after chxperiments#17 merged; the input is kept in
testdata/fuzz as a seed.
@chxmxii
chxmxii merged commit b98cb5d into chxperiments:main Oct 11, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants