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

Fix command injection vulnerability in HelmInstallService #539

Merged

Conversation

nicolst
Copy link
Contributor

@nicolst nicolst commented Dec 18, 2024

No description provided.

@nicolst nicolst force-pushed the fix/command-injection-vulnerability branch from dfe4634 to 519ccfb Compare December 18, 2024 12:36
@nicolst
Copy link
Contributor Author

nicolst commented Dec 18, 2024

This uses the official recommended regex for Semver 2 versions, but it is quite long

@nicolst
Copy link
Contributor Author

nicolst commented Dec 18, 2024

Tested in our dev environment and the API now returns a 404 when given an invalid and/or non-existent version instead of passing it on to the command executor.

I have looked a bit more at the code and I can't see any other immediate candidates for this vulnerability. The env and timeout arguments to installService could have had the same vulnerability, but env is never used outside of suspend/resume where it is hardcoded and timeout is retrieved from the catalog config.

A lot of these kinds of problems would probably have been avoided if the API were written in Go using Helm's official SDK, but rewriting is of course quite a large job and maybe not realistic at this point.

@fcomte fcomte merged commit f5186ec into InseeFrLab:main Dec 18, 2024
6 checks passed
@nicolst nicolst deleted the fix/command-injection-vulnerability branch December 18, 2024 13:18
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 this pull request may close these issues.

2 participants