Advisory Published
Updated

REDHAT-BUG-2258856

First published: Wed Jan 17 2024(Updated: )

The MustGather.managed.openshift.io Custom Defined Resource (CRD) is intended to be used to collect information on the cluster to assist in a support case. The normal procedure for using this resource is to have a cluster administrator create such a resource, which will in turn launch a Job in the openshift-must-gather-operator namespace to perform the collection and upload. However, no permissions are defined to access the MustGather CRD, developer-privileged accounts can, by using F-02 Bypass in Managed Resources Admission Webhook, create such resources. The definition of the collection Job is created through a yaml text template evaluated using user-controlled inputs from the MustGather’s spec. Furthermore, user-controlled inputs are not sanitized or otherwise verified. This results in a template injection primitive, with the Job’s yaml definition being almost fully controlled by user inputs (truncation is also possible): * controllers/mustgather/mustgather_controller.go Template evaluation * controllers/mustgather/mustgather_controller.go Template initialization * build/templates/job.template.yaml Template Also, the MustGather CRD allows specifying the desired service account for the Job, all collection operations are therefore performed under the service account’s identity. One of the two service accounts in the openshift-must-gather-operator is a cluster administrator. Chaining the properties described above, a standard developer with no privileged permissions on the cluster can create a MustGather object with specially crafted contents (under spec) and set the most privileged service account to run the Job. When the Job runs, the crafted contents will tamper with the templated bash command in the Job’s definition to execute arbitrary commands on the Job’s Pod. Thanks to the service account supplied in the MustGather object, a token with cluster-admin privileges will be present on the Job’s Pod. Impact An attacker with a standard developer account can elevate his privileges to cluster administrator. From a cluster administrator privilege, the attacker can also read the kube-system/osdManage secret and pivot to the AWS environment with administrator privileges, see F-03 osdManagedAdmin Has Redundant and High privileges on AWS Account. Recommendations Fixing this issue will require the following: * Only allow MustGather objects to be created by users with the cluster-admin role. * Replace the Job definition template by a construction of Go structs. * Validate user inputs to build the Job definition are in the expected format. * (If possible) Remove or strip permissions to the minimal required for system:serviceaccount:openshift-must-gather-operator:must-gather-admin

Affected SoftwareAffected VersionHow to fix
Red Hat OpenShift Origin

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of REDHAT-BUG-2258856?

    The severity of REDHAT-BUG-2258856 is categorized as critical due to its impact on cluster administration.

  • How do I fix REDHAT-BUG-2258856?

    To fix REDHAT-BUG-2258856, apply the latest updates and patches provided by Red Hat for OpenShift.

  • What systems are affected by REDHAT-BUG-2258856?

    The affected system for REDHAT-BUG-2258856 is Red Hat OpenShift, particularly its MustGather Custom Resource Definition.

  • What is the purpose of the MustGather.managed.openshift.io CRD mentioned in REDHAT-BUG-2258856?

    The MustGather.managed.openshift.io CRD is used to collect diagnostic information from the OpenShift cluster for support cases.

  • Has REDHAT-BUG-2258856 been addressed in any updates?

    Yes, REDHAT-BUG-2258856 has been addressed in subsequent updates, so checking for the latest version is recommended.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203