Skip to content

Commit

Permalink
internal/helm: check size of meta files in package
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hello@hidde.co>
  • Loading branch information
hiddeco committed Nov 23, 2021
1 parent fa13dd7 commit 9233939
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/helm/chart/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ func LoadChartMetadataFromArchive(archive string) (*helmchart.Metadata, error) {

switch parts[1] {
case chartutil.ChartfileName, "requirements.yaml":
if hd.Size > helm.MaxChartFileSize {
return nil, fmt.Errorf("size of '%s' exceeds '%d' bytes limit", hd.Name, helm.MaxChartFileSize)
}
b, err := io.ReadAll(tr)
if err != nil {
return nil, err
Expand Down

0 comments on commit 9233939

Please sign in to comment.