Repository navigation
Move remaining YAML parsing to go.yaml.in/yaml/v3 - #6920
Merged
Merged
Conversation
gopkg.in/yaml.v3 is unmaintained and panics with "hash of unhashable type" when a mapping combines a << merge key with a mapping-valued key (OSS-Fuzz 4870994700075008). The maintained fork returns an error instead. Switch every remaining importer, including tests, so types with custom UnmarshalYAML(*yaml.Node) methods (pkg/json.Data) are decoded by the same library that defines their node type. Add a ValidateEndpoint test that feeds the crash input through the registry /openapi.yaml path, which parses remote responses. pkg/skills is handled in a separate change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rdimitrov
requested review from
ChrisJBurns,
JAORMX,
amirejaz,
aponcedeleonch,
blkt,
jerm-dro,
jhrozek,
reyortiz3 and
tgrunnagle
as code owners
October 22, 2026 13:07
aponcedeleonch
approved these changes
Oct 22, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6920 +/- ##
==========================================
+ Coverage 79.79% 79.83% +0.03%
==========================================
Files 828 828
Lines 84632 84632
==========================================
+ Hits 67531 67564 +33
+ Misses 17096 17063 -33
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ChrisJBurns
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gopkg.in/yaml.v3is no longer maintained, and it panics withhash of unhashable type map[string]interface {}when a mapping has a<<merge key next to a key that is itself a mapping (OSS-Fuzz testcase 4870994700075008). One of the inputs that can trigger this comes from the network: the registry/openapi.yamlcheck parses whatever a remote registry sends back. The maintained forkgo.yaml.in/yaml/v3(v3.0.5) returns an error for the same input instead of panicking.gopkg.in/yaml.v3now importsgo.yaml.in/yaml/v3, test files included.go.yaml.in/yaml/v3becomes a direct dependency.UnmarshalYAML(*yaml.Node)move together. Today that ispkg/json.Data, decoded by the vmcp loader, vmcpserve/init, and the operator vmcpconfig controller. This matters because the custom unmarshaler only fires when the decoder comes from the same library as theyaml.Nodetype.TestClient_ValidateEndpointinpkg/registry/api, which includes the crash input? {a: b}\n: c\n<<: {name: x}\nand expects an error.This pairs with #6919, which moves
pkg/skills. Once both are merged,gopkg.in/yaml.v3is no longer a direct dependency and can be dropped from the direct requirements ingo.mod.Type of change
Test plan
task test)task lint-fix)Lint ran with the CI-pinned golangci-lint v2.15.0 via
go runon the touched packages, because localtask lint-fixis broken on Go 1.27. I also checked by hand that the crash input panicsgopkg.in/yaml.v3and returns an error fromgo.yaml.in/yaml/v3, both formap[string]interface{}and forinterface{}targets.Does this introduce a user-facing change?
Before: a YAML document (a config file, vmcp config, client config, or a registry's
/openapi.yaml) that combined a merge key with a mapping-valued key crashedthv,vmcp, or the operator with a panic. After: the same input is rejected with a parse error.Special notes for reviewers
go.mod, about 40 changed lines. Each change is the same mechanical import-path swap, and keeping them in one PR was approved deliberately. Splitting along package lines would have to keep thepkg/json+ vmcp group together anyway, for theyaml.Nodereason above.pkg/skills/{parser,types,parser_test}.gostill importgopkg.in/yaml.v3on purpose. Parse SKILL.md with maintained YAML fork #6919 covers them.yaml: runtime error: ...error, so the new test only asserts that an error comes back.🤖 Generated with Claude Code