Vendir allows to use unsafe paths in configuration #353
Labels
bug
This issue describes a defect or unexpected behavior
carvel-accepted
This issue should be considered for future work and that the triage process has been completed
This issue was initially discussed in Slack.
What steps did you take:
Here is a shell script to reproduce the issue. It runs commands during
docker build
, so you can safely run it, as it doesn't change any files on the host system.What happened:
Here is the important part of the output of the script. I added comments to explain the steps.
The same can be achieved by targeting the
/usr
directory via../../../usr
path in the vendir configuration.What did you expect:
Vendir should not allow targeting directories via absolute paths or via traversing up the directory tree.
Anything else you would like to add:
There is a list of disallowed file paths in the current code:
vendir/pkg/vendir/config/directory.go
Line 25 in 9d3b17c
But it is limited to these exact values:
/
,..
,.
and ``.Environment:
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: