Skip to content

[SECURITY] Helm charts loaded without integrity verification #2115

Description

@dgn

LoadChart walks a filesystem directory and passes files directly to chartv2loader.LoadFiles() with no checksum, signature, or integrity verification. If the chart directory on the operator's filesystem is tampered with (e.g. via a compromised init container or volume mount), the operator deploys arbitrary manifests.

func LoadChart(resourceFS fs.FS, chartPath string) (*chartv2.Chart, error) {
var files []*archive.BufferedFile
err := fs.WalkDir(resourceFS, chartPath, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
// Skip directories
if d.IsDir() {
return nil
}
data, err := fs.ReadFile(resourceFS, path)
if err != nil {
return fmt.Errorf("failed to read file %s: %w", path, err)
}
// Make path relative to chart root
// e.g., "v1.28.2/charts/istiod/Chart.yaml" -> "Chart.yaml"
relPath := strings.TrimPrefix(path, chartPath)
relPath = strings.TrimPrefix(relPath, "/")
files = append(files, &archive.BufferedFile{
Name: relPath,
Data: data,
})
return nil
})
if err != nil {
return nil, fmt.Errorf("failed to walk chart directory %s: %w", chartPath, err)
}
if len(files) == 0 {
return nil, fmt.Errorf("no files found in chart directory %s", chartPath)
}
loadedChart, err := chartv2loader.LoadFiles(files)
if err != nil {
return nil, fmt.Errorf("failed to load chart from files: %w", err)
}
return loadedChart, nil

Suggested Fix

Embed expected chart checksums and verify before loading, or use signed chart archives.


From code inspection (2026-07-05, main @ 86fac7a). Severity: 🟠 Medium

Activity

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

    ai-generatedIssue generated by AI analysisbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions