-
Notifications
You must be signed in to change notification settings - Fork 953
kubectl: check rule in exec command is insecurity #1745
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
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/sig cli |
/assign |
…ource and dash Fixes #131352 The current implementation doesn't properly check for arguments between the resource name and the dash separator. This can lead to unexpected behavior when using commands like 'kubectl exec -it resource asd asd asd -- bash', which should raise an error but doesn't. This fix adds a check to ensure that when a dash separator (--) is used, there are no extra arguments between the resource name and the dash. If there are extra arguments, it will raise an error with the message 'exec [POD] [COMMAND] is not supported anymore. Use exec [POD] -- [COMMAND] instead'. Added a test case to verify the fix.
/assign |
/translate kubernetes |
/triage accepted /transfer-issue kubectl |
What happened?
https://github.com/kubernetes/kubernetes/blob/b53b9fb5573323484af9a19cf3f5bfe80760abba/staging/src/k8s.io/kubectl/pkg/cmd/exec/exec.go#L208-L215
kubectl exec -it resource asd asd asd -- bash
will be likekubectl exec -it resource -- bash
but no errorThis can lead to unexpected behavior of command with
--
What did you expect to happen?
raise error
error: exec [POD] [COMMAND] is not supported anymore.
How can we reproduce it (as minimally and precisely as possible)?
kubectl exec -it resource asd asd asd -- bash
Anything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: