GHSA-f9xf-jq4j-vqw4 CVE-2021-25318 GO-2024-2768
Rancher does not properly specify ApiGroup when creating Kubernetes RBAC resources
- Severity
- 0.0 / 10
- High · CVSS 4.0
- Exploit chance (EPSS)
- 1.05%
- Chance of exploitation in the next 30 days. Higher than 64.30% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-732 Incorrect Permission Assignment for Critical Resource
- Fix
2.4.16- Upgrade github.com/rancher/rancher to this version or later
Description
A vulnerability was discovered in Rancher versions 2.0 through the aforementioned fixed versions, where users were granted access to resources regardless of the resource's API group. For example Rancher should have allowed users access to apps.catalog.cattle.io, but instead incorrectly gave access to apps.*. Resource affected include:
Downstream clusters: apiservices clusters clusterrepos persistentvolumes storageclasses
Rancher management cluster apprevisions apps catalogtemplates catalogtemplateversions clusteralertgroups clusteralertrules clustercatalogs clusterloggings clustermonitorgraphs clusterregistrationtokens clusterroletemplatebindings clusterscans etcdbackups nodepools nodes notifiers pipelineexecutions pipelines pipelinesettings podsecuritypolicytemplateprojectbindings projectalertgroups projectalertrules projectcatalogs projectloggings projectmonitorgraphs projectroletemplatebindings projects secrets sourcecodeproviderconfigs
There is not a direct mitigation besides upgrading to the patched Rancher versions.
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/rancher/rancher | >= 2.0.0, < 2.4.16 |
2.4.16 |
| github.com/rancher/rancher | >= 2.5.0, < 2.5.9 |
2.5.9 |
| github.com/rancher/rancher | >= 2.0.0+incompatible |
No fix yet |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
github.com/rancher/rancher Go → 2.4.16
- go
go get github.com/rancher/rancher@v2.4.16 && go mod tidy
Severity breakdown
CVSS 4.0 0.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- Low
- User interaction
- None
- Confidentiality (vulnerable system)
- High
- Integrity (vulnerable system)
- High
- Availability (vulnerable system)
- High
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
CVSS 3.1 8.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Weakness
CWE-732: Incorrect Permission Assignment for Critical Resource
The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.
How to prevent it
- Implementation: When using a critical resource such as a configuration file, check to see if the resource has insecure permissions (such as being modifiable by any regular user) [REF-62], and generate an error or even exit the software if there is a possibility that the resource could have been modified by an unauthorized party.
- Architecture and Design: Divide the software into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully defining distinct user groups, privileges, and/or roles. Map these against data, functionality, and the related resources. Then set the permissions accordingly. This will allow you to maintain more fine-grained control over your resources. [REF-207]
- Architecture and Design, Operation: Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
- Implementation, Installation: During program startup, explicitly set the default permissions or umask to the most restrictive setting possible. Also set the appropriate permissions during program installation. This will prevent you from inheriting insecure permissions from any user who installs or runs the program.
- System Configuration: For all configuration files, executables, and libraries, make sure that they are only readable and writable by the software's administrator.
- Documentation: Do not suggest insecure configuration changes in documentation, especially if those configurations can extend to resources and other programs that are outside the scope of the application.
- Installation: Do not assume that a system administrator will manually change the configuration to the settings that are recommended in the software's manual.
- Operation, System Configuration: Ensure that the software runs properly under the United States Government Configuration Baseline (USGCB) [REF-199] or an equivalent hardening configuration guide, which many organizations use to limit the attack surface and potential risk of deployed software.
- Implementation, System Configuration, Operation: When storing data in the cloud (e.g., S3 buckets, Azure blobs, Google Cloud Storage, etc.), use the provider's controls to disable public access.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-4j6x-2764-m8gh Rancher has over-inclusive team membership expansion in GitHub App authentication provider | High | Also affects github.com/rancher/rancher |
| GHSA-vx8h-4prv-g744 Rancher has Privilege Escalation from Project Owner to Host | High | Also affects github.com/rancher/rancher |
| GHSA-mhc6-2gfq-xx62 Rancher vulnerable to command injection through unsanitized YAML parameter | Critical | Also affects github.com/rancher/rancher |
| GHSA-5v3h-x4wf-5c35 Rancher Extensions have arbitrary file access via path traversal | High | Also affects github.com/rancher/rancher |
| GHSA-gqf8-rvrh-g7w6 Rancher cloud credentials can be used through proxy API by users without access | Critical | Also affects github.com/rancher/rancher |
| GHSA-hwm2-4ph6-w6m5 Rancher's restricted PodSecurityPolicy does not prevent containers from running as a privileged user | High | Also affects github.com/rancher/rancher |
| GHSA-mc24-7m59-4q5p Rancher CLI skips TLS verification on Rancher CLI login command | Medium | Also affects github.com/rancher/rancher |
| GHSA-mw39-9qc2-f7mg Rancher exposes sensitive information through audit logs | Medium | Also affects github.com/rancher/rancher |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor