FIX: add validation for containerID#726
Open
kaizakin wants to merge 1 commit into
Open
Conversation
Signed-off-by: karthik balasubramanian <karthikbalasubramanian08@gmail.com>
✅ Deploy Preview for urunc canceled.
|
Contributor
Author
|
Hey @cmainas what's your opinion on this comment #714 (comment) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
containerIDvalidation following the similar approach asruncAlmost every command in urunc
delete,kill,ps,start,run, and the internal re-exec phase calls the sharedgetUnikontainer()helper function to read the container ID from the command line and load its state.by adding
validateIDinside this helper we've automatically secured all commands.only the
createcommand doesn't use the getUnikontainer() because the container state hasn't been initialized yetso i explicitly added validateId there.
How was this tested?
Manually tested by locally compiling urunc and simulating the path traversal attack vector
LLM usage
N/A
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).