Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading large files can crash flux with an out-of-memory bug #470

Closed
dholbach opened this issue Oct 27, 2021 · 0 comments · Fixed by #485
Closed

Reading large files can crash flux with an out-of-memory bug #470

dholbach opened this issue Oct 27, 2021 · 0 comments · Fixed by #485

Comments

@dholbach
Copy link
Member

From Ada Logics

There are two places where the code uses io.ReadAll to read Helm charts. This function needs to be used with care as it can be used to crash the application due to memory issues in case the files being read are large.

The areas we consider:

https://github.com/fluxcd/source-controller/blob/main/controllers/helmchart_controller.go#L329-L333

And

res, err := r.Client.Get(u.String(), r.Options...)
if err != nil {
return err
}
b, err := io.ReadAll(res)

If an attacker can taint a HELM chart to be large in size, then a denial-of-service attack can occur.

Recommendation

Validate size of input before reading data with io.ReadAll

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 a pull request may close this issue.

1 participant