-
Notifications
You must be signed in to change notification settings - Fork 272
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
Remote arbitrary code execution (shell incjection) #82
Comments
I would prefer to use a whitelist approach using a regex during the command constructions. If we can construct a regex so that it matches and allows strings starting with |
List of plugins for each versions of rabbitmq is not documented fully. For example, the documentation on core plugins from rabbitmq.com is incomplete and does not include The main purpose is to prevent shell injection. I think it makes sense to match each of the plugins as Option 2, using regex is the most straightforward way to solve this IMHO. Thoughts? |
I think that's the right call. I don't want us to be in the business of updating a list of known plugins. A regexp should be good enough. |
Context: I am looking into CRD structure schema for this regex check. I believe this check belongs in the validation stage, and will be a better user experience if we can fail early. |
additionalPlugins
property allows arbitrary code execution through shell injection. The command to enable plugins is constructed by string concatenation, including user input (the value ofadditionalPlugins
). This means that a user who can createRabbitmqCluster
resource can also execute any command inside a RabbitMQ pod, even though that should be controlled throughpods/exec
privilege.To Reproduce
foo
kubectl edit rabbitmqcluster foo
Expected behavior
TBD how exactly this should be handled. Options include:
additionalPlugins
list that is not one of them (the list would include all plugins shipped as part of RabbitMQ at the time a given operator version was released, unfortunately we would have to make sure we keep it up to date when new plugins are added)The text was updated successfully, but these errors were encountered: