apache / apache/cloudstack

SSH key pairs are very buggy

未關閉
#12,925 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
component:UI
主要語言
Java
星號
3.1k
分支
1.4k
平均合併
6 天 19 小時
30 天內合併 PR
32

描述

### 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 Image
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.

貢獻指南

開啟貢獻指南

研究方向

首先追蹤接受或存取金鑰對名稱的 API 端點,然後透過 UI 和 deployVirtualMachine 命令重現包含逗號的金鑰對。識別所有受影響的端點及其現有的 keypair/keypairs 參數。完成的標準是:所需的 keypairId 陣列參數可用,且基於名稱的參數被標記為 deprecated,同時不破壞文件中描述的工作流程。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
api, backend-api-design
Issue 類型
缺陷
難度
5/5
預估耗時
一週以上
活躍度
冷清
描述清晰度
基本清楚
新手友好度
43/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。