Skip to content

Helm: a YAML merge key (<<) in Chart.yaml gives Helm another name and version than Forge reads (follow-up to #232, #422) #428

Closed as not planned

Description

@schmitch

What

Forge reads Chart.yaml with yaml-rust2 (parse_chart_yaml in plugins/helm/src/chart.rs). yaml-rust2 does not implement YAML merge keys: a top-level << is an ordinary key, and Forge ignores it.

Helm parses Chart.yaml with sigs.k8s.io/yaml, which is based on a fork of go-yaml v2. go-yaml v2 does merge: the mapping (or each mapping of a sequence) under << is decoded into the surrounding mapping where the << stands. Its keys overwrite the keys written before it.

Found while fixing #422 (#427). Checked with a throwaway Go harness that runs Helm 3.17.0's loader.LoadFiles on a Chart.yaml:

Chart.yaml (after apiVersion: v2) Helm reads Forge reads
name: good, version: 1.0.0, <<: {version: 6.6.6} good 6.6.6 good 1.0.0
name: good, version: 1.0.0, <<: [{name: evil}] evil 1.0.0 good 1.0.0
name: good, version: 1.0.0, !!merge <<: {version: 6.6.6} good 6.6.6 good 1.0.0
<<: {version: 6.6.6, name: evil}, name: good, version: 1.0.0 good 1.0.0 good 1.0.0
name: good, version: 1.0.0, "<<": {version: 6.6.6} (quoted) good 1.0.0 good 1.0.0
name: good, version: 1.0.0, ? !!str << / : {version: 6.6.6} good 1.0.0 good 1.0.0

Unlike #422, this can change the chart's name, which is the class of #232: a publisher whose package selector allows only good publishes a chart that helm install loads as evil. A merged mapping can also bring in a key that #427's folding check never sees, such as <<: {verſion: 6.6.6}.

Failure scenario

Already safe:

  • requirements.yaml accepts only the exact key dependencies, so a << there is refused.
  • An index entry carries only the exact METADATA_KEYS.

Suggested fix

In parse_chart_yaml, refuse a Chart.yaml whose top-level mapping has a << key (400 on a push, a rejection on a proxy download). A chart has no use for one.

  • After loading, yaml-rust2 cannot tell a plain << from a quoted or !!str-tagged one. Refusing every top-level << is the simple, safe rule; Helm ignores the quoted forms anyway.
  • Add tests for each row of the table, including an alias (base: &b {name: evil} … <<: *b).

🤖 Generated with Claude Code

Activity

  1. added this to the 2.0.0 milestone on Oct 23, 2026
  2. added theissue type on Oct 23, 2026
  3. schmitch commented on Oct 24, 2026

    @schmitch
    MemberAuthor

    Closing as not planned: the code this is about is gone.

    Helm charts are now served only through the OCI registry. There a chart's identity is its image path and tag: content selectors match the path, and helm install oci://… resolves only that path. No access or serving decision reads the name from Chart.yaml, so this class of mismatch doesn't apply.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions