You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "Matrix89 (via GitHub)" <gi...@apache.org> on 2026/03/31 09:18:19 UTC
[I] SSH key pairs are very buggy [cloudstack]
Matrix89 opened a new issue, #12925:
URL: https://github.com/apache/cloudstack/issues/12925
### problem
Having the ssh key pairs being identified by their name leads to a lot of weird issues.
1. The key pair validator allows commas(and other special characters like an ampersand) in the key pair name.
2. The `deployVirtualMachine` command `keypairs` parameter isn't escaped, this breaks on key pairs containing commas.
4. The `deployVirtualMachine` command `keypair` works with commas
5. The UI breaks when a key pair contains commas, below is a single key containing a bunch of commas <img width="480" height="322" alt="Image" src="https://github.com/user-attachments/assets/4efda769-376e-4464-856b-d8818cf6c785" />
6. If the API consumer assumes the key pair name is safe and validated by cloudstack it *cloud* lead to a command injection(but it requires a lot of wrong assumptions)
### versions
CloudStack 4.22.0.0
### The steps to reproduce the bug
You can use the UI to observe most of the issues:
1. Create a new key pair with a comma in the name eg. `test, test`
2. Try creating a new instance with said key
### What to do about it?
1. Add a new `keypairId` array parameter to all the endpoint which access key pair name.
2. Mark the `keypair` and `keypairs` parameters deprecated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] SSH key pairs are very buggy [cloudstack]
Posted by "kiranchavala (via GitHub)" <gi...@apache.org>.
kiranchavala commented on issue #12925:
URL: https://github.com/apache/cloudstack/issues/12925#issuecomment-4168335863
Thanks @Matrix89 was able to reproduce the issue
We need to add a validation for the following api call
https://cloudstack.apache.org/api/apidocs-4.22/apis/createSSHKeyPair.html
https://cloudstack.apache.org/api/apidocs-4.22/apis/registerSSHKeyPair.html
1. Created a sshkeypair with name "test,test"
2. Exception when trying to launch a vm from the ui
<img width="1581" height="187" alt="Image" src="https://github.com/user-attachments/assets/46147bd3-ad0d-4dba-b3a2-68f630174d85" />
<img width="1605" height="492" alt="Image" src="https://github.com/user-attachments/assets/73439e17-9356-4578-89be-e11e92ba42a1" />
3. Depploy a vm from the api call
```
deploy virtualmachine templateid=51f036c4-2137-11f1-b16a-1e00190002a8 serviceofferingid=327f7a0e-6080-4db3-a861-8ad8de72c6f3 networkids=d67ca7ca-1022-4653-a15c-3f009bca48af keypair=test,test zoneid=b8f183d0-a866-4619-a3e2-dc0ea05c665f
```
4. Check the ui
<img width="1628" height="454" alt="Image" src="https://github.com/user-attachments/assets/a3e31cc6-5018-490e-bbef-ed7efef3c5de" />
<img width="1628" height="550" alt="Image" src="https://github.com/user-attachments/assets/2fd87125-e0d4-4667-8df4-274410aa577c" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] SSH key pairs are very buggy [cloudstack]
Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on issue #12925:
URL: https://github.com/apache/cloudstack/issues/12925#issuecomment-4161141439
Thanks for opening your first issue here! Be sure to follow the issue template!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] SSH key pairs are very buggy [cloudstack]
Posted by "github-actions[bot] (via GitHub) via commits" <co...@cloudstack.apache.org>.
github-actions[bot] commented on issue #12925:
URL: https://github.com/apache/cloudstack/issues/12925#issuecomment-6996915521
This issue is stale because it has been open for 120 days with no activity. It may be removed by administrators of this project at any time. Remove the stale label or comment to request for removal of it to prevent this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org