RepoSpec
path can exit repo directory
#4850
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
Describe the bug
RepoSpec
doesn't currently audit itsPath
, or the path to the root within the repo. This, in combination with fileLoader not checking the root, can lead to remote roots that traverse the user's local file system.Specifically, urls of the form
https://github.com/org/repo//../../../..
, where thePath
is "../../../..", can be used to escape the repo to access the user's local directories.Files that can reproduce the issue
Test here: 6e60afe#diff-5bce8892c5c28e9ea5ca5ee37a1f2a74e63b9499656c9616df78d8b7ea23e5f1R505
Expected output
As in test, an error should be thrown stating that the loader cannot traverse outside of the repo directory.
Actual output
The Run() method currently executes without error. The loader exits the repo directory and loads the local root.
Kustomize version
Commit on master branch: 997e6fc
Additional context
#4797, #4848
After discussion, @KnVerey, @natasha41575 agreed that this issue has contained severity because local roots accessed need to contain a
kustomization.yaml
file.The text was updated successfully, but these errors were encountered: