Skip to content
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

Rancher accepts negative values in cluster creation dialogue #13067

Open
gaktive opened this issue Jan 10, 2025 · 2 comments
Open

Rancher accepts negative values in cluster creation dialogue #13067

gaktive opened this issue Jan 10, 2025 · 2 comments

Comments

@gaktive
Copy link
Member

gaktive commented Jan 10, 2025

Internal reference: SURE-9603
Reported in 2.10.1

Issue description:
You can enter a negative value or zero in cpu/memory/disk fields of cluster creation dialogue which can lead to DOS of Rancher application. This is not possible in 2.8.x, but 2.9.x and 2.10.x are missing input validation.

Business impact:
By entering negative/zero values in cluster creation, Rancher application can become unavailable.

Troubleshooting steps:
Support reproduced with Harvester. In cluster management, create a cluster and enter values in cpu/memory/disk. If negative value is entered in machine count, the Harvester mutation webhook catches it and Rancher reports an error (see screenshots). In other cases it starts creating pods in fleet-default that error out with:

# kubectl logs -n fleet-default broken-pool1-c7qqw-n7q97-machine-provision-4r9cv
Downloading driver from https://192.168.153.1.sslip.io/assets/docker-machine-driver-harvester
Doing /etc/rancher/ssl
docker-machine-driver-harvester
docker-machine-driver-harvester: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped
Trying to access option  which does not exist
THIS ***WILL*** CAUSE UNEXPECTED BEHAVIOR
Type assertion did not go smoothly to string for key
error setting machine configuration from flags provided: must specify disk size in harvester disk info 

This goes on until Rancher is not available. Support reported also crashes of the Rancher pods

Repro steps:

  • Cluster Management > Create
  • Pick Harvester
  • Enter negative values in cpu/memory/disk

Workaround:
None

Actual behavior:
It is possible to enter zero or negative values in cluster creation fields

Expected behavior:
It is not possible to enter zero or negative values in cluster creation fields

Additional notes:
Interrupt able to reproduce this issue in both harvester and digital ocean clusters.

image-2025-01-10-14-01-00-443

@gaktive gaktive added this to the v2.11.0 milestone Jan 10, 2025
@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Jan 10, 2025
@nwmac nwmac modified the milestones: v2.11.0, v2.12.0 Feb 10, 2025
@momesgin momesgin self-assigned this Mar 12, 2025
@gaktive
Copy link
Member Author

gaktive commented Mar 12, 2025

/backport v2.11.1

@richard-cox
Copy link
Member

Linking #13333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants