
# Istiod TLS证书密钥滥用（CVE-2021-34824）
#### 漏洞详情
表1漏洞信息 
| 漏洞类型      | CVE-ID         | 披露/发现时间    |
|:---|:---|:---|
| TLS证书密钥滥用 | CVE-2021-34824 | 2021-06-24 |
   
#### 影响评分
9.1 高危
 #### 触发场景
同时满足下列三个条件：
1. Istio版本为1.8.x，或1.10.0-1.110.1，或1.9.0-1.9.5
2. Gateways或DestinationRules资源中定义了credentialName字段
3. 没有将Istiod flag置为PILOT_ENABLE_XDS_CACHE=false
 
#### 根本原因
Istio Gateway和DestinationRule可以通过credentialName配置从Kubernetes Secret中加载私钥和证书。对于Istio1.8及更高版本，Secret通过XDS API从Istiod传送到网关或工作负载。
网关或工作负载部署应该只能访问存储在其命名空间内的Kubernetes Secret中的凭证（TLS证书和私钥）。但是，Istiod中的一个错误允许授权客户端访问和检索缓存在Istiod中的任何TLS证书和私钥。
#### 受影响版本
参考[触发场景]
#### 补丁修复版本
- ASM 1.8.4-r5版本及以上
- Istio 1.10.2版本及以上
- Istio 1.9.6版本及以上
 
#### 规避和消减措施
除了升级版本来规避外，还可以通过设置Istiod的环境变量PILOT_ENABLE_XDS_CACHE=false来关闭Istiod缓存。但是，在关闭了XDS缓存后，系统和Istiod的性能可能会受影响。
#### 相关链接
- Istio官方[安全问题汇总](https://istio.io/latest/news/security/istio-security-2021-007/)
- CVE[漏洞公告](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34824)
 
