Summary
Rancher Remote Code Execution via Cluster/Node Drivers
Workarounds
If you can't upgrade to a fixed version, please make sure that:
- Drivers are only executed from trusted sources.
- The use of Admins/Restricted Admins is limited to trusted users.
References
If you have any questions or comments about this advisory:
- Reach out to the SUSE Rancher Security team for security related inquiries.
- Open an issue in the Rancher repository.
- Verify with our support matrix and product support lifecycle.
Impact
A vulnerability has been identified within Rancher where a cluster or node driver can be used to escape the chroot jail and gain root access to the Rancher container itself. In production environments, further privilege escalation is possible based on living off the land within the Rancher container itself. For the test and development environments, based on a –privileged Docker container, it is possible to escape the Docker container and gain execution access on the host system.
This happens because:
- During startup, Rancher appends the
/opt/drivers/management-state/bindirectory to thePATHenvironment variable. - In Rancher, the binaries
/usr/bin/rancher-machine,/usr/bin/helm_v3, and/usr/bin/kustomizeare assigned a UID of 1001 and a GID of 127 instead of being owned by the root user. - Rancher employs a jail mechanism to isolate the execution of node drivers from the main process. However, the drivers are executed with excessive permissions.
- During the registration of new node drivers, its binary is executed with the same user as the parent process, which could enable an attacker to gain elevated privileges by registering a malicious driver.
- Lack of validation on the driver file type, which allows symbolic links to be used.
Please consult the associated MITRE ATT&CK - Technique - Privilege Escalation and MITRE ATT&CK - Technique - Execution for further information about this category of attack.
Since they run at a privileged level, it is recommended to use trusted drivers only.
The application assigns, modifies, tracks, or checks privileges incorrectly, allowing a user to gain elevated access. Typical impact: privilege escalation beyond the intended level.
CVE-2024-22036 has a CVSS score of 9.1 (Critical). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.7.16, 2.8.9, 2.9.3); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
The fix involves some key areas with the following changes:
Fixing the PATH environment variable:
- Remove the step that appends
/opt/drivers/management-state/binto thePATHenvironment variable.
Binaries permissions:
- Correct the permission of the binaries
/usr/bin/rancher-machine,/usr/bin/helm_v3, and/usr/bin/kustomizeso that they are owned by the root user.
Improving Rancher jail security mechanism:
- A new group
jail-accessorshas been created, and the rancher user has been added to this group. - The
jail-accessorsgroup is granted read and execute permissions for the directories/var/lib/rancher,/var/lib/cattle, and/usr/local/bin. - The jail mechanism has been enhanced to execute commands using the non-root
rancheruser and thejail-accessorsgroup. Additionally, a new setting,UnprivilegedJailUser, has been introduced to manage this behavior, allowing users to opt-out if they need to run drivers in a more privileged context. - Limit the devices copied to the jail directory to a minimal set.
Fixing node driver registration:
- The
NewPlugin(driver)function in therancher/machinemodule has been updated to allow setting the UID and GID for starting the plugin server. If the environment variablesMACHINE_PLUGIN_UIDandMACHINE_PLUGIN_GIDare set, their values will be used to configure the user credentials for launching the plugin server. - Rancher now sets these environment variables with a non-root UID and GID before invoking the
NewPlugin(driver)function and then unsets them after retrieving the creation flags.
Improvements on driver package:
- The
driverpackage has been revised to verify that the downloaded driver binary is a regular file. - The
driverpackage has been revised to verify that the target file in the downloaded tar file is a regular file. - The
driverpackage now executes the downloaded driver binary within a jail, with a default timeout of 5 seconds.
Other improvements:
- The helm package has been updated to ensure appropriate permissions are set on the generated kubeconfig file.
- The
nodeConfigpackage has been updated to ensure proper permissions are applied when extracting the node configuration.
Patched versions include releases 2.7.16, 2.8.9 and 2.9.3.
Frequently Asked Questions
- What is CVE-2024-22036? CVE-2024-22036 is a critical-severity improper privilege management vulnerability in github.com/rancher/rancher (go), affecting versions >= 2.7.0, < 2.7.16. It is fixed in 2.7.16, 2.8.9, 2.9.3. The application assigns, modifies, tracks, or checks privileges incorrectly, allowing a user to gain elevated access.
- How severe is CVE-2024-22036? CVE-2024-22036 has a CVSS score of 9.1 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/rancher/rancher are affected by CVE-2024-22036? github.com/rancher/rancher (go) versions >= 2.7.0, < 2.7.16 is affected.
- Is there a fix for CVE-2024-22036? Yes. CVE-2024-22036 is fixed in 2.7.16, 2.8.9, 2.9.3. Upgrade to this version or later.
- Is CVE-2024-22036 exploitable, and should I be worried? Whether CVE-2024-22036 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-22036 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-22036?
- Upgrade
github.com/rancher/rancherto 2.7.16 or later - Upgrade
github.com/rancher/rancherto 2.8.9 or later - Upgrade
github.com/rancher/rancherto 2.9.3 or later
- Upgrade