更進一步
VMware 提供培訓和認證,以加速您的進步。
瞭解更多Spring Cloud Config Server 在向 Vault 發出請求時,可能不使用客戶端使用 X-CONFIG-TOKEN
標頭髮送的 Vault token。
如果滿足以下條件,您的應用程式可能會受到影響
X-CONFIG-TOKEN
標頭將 Vault token 傳送到 Spring Cloud Config Server,以便 Config Server 在向 Vault 發出請求時使用,並且SessionManager
實現 LifecycleAwareSessionManager
或一個持久化 Vault token 的 SessionManager
實現,例如 SimpleSessionManager
。在這種情況下,SessionManager
會持久化它檢索到的第一個 token,並且即使客戶端向 Spring Cloud Config Server 發出的請求包含具有不同值的 X-CONFIG-TOKEN
標頭,它也會繼續使用該 token。
Spring Cloud Config
受影響版本的使用者應升級到相應的修復版本。
受影響的版本 | 修復版本 | 可用性 |
---|---|---|
4.2.x | 4.2.2 | OSS |
4.1.x | 4.1.6 | OSS |
4.0.x | 4.0.10 | 商業 |
3.1.x | 3.1.10 | 商業 |
3.0.x | 4.1.6 | OSS |
2.2.x | 4.1.6 | OSS |
注意:Spring Cloud Config 3.0.x 和 2.2.x 不再提供開源或商業支援。 建議這些版本的使用者升級到受支援的版本。
不需要其他緩解措施。
如果您無法升級,那麼您可以
SessionManager
,該 SessionManager
不會持久化 Vault token,並在 @Configuration
類中使用該實現提供一個 bean。 例如
public class StatelessSessionManager implements SessionManager {
private final ClientAuthentication clientAuthentication;
private final ReentrantLock lock = new ReentrantLock();
public StatelessSessionManager(ClientAuthentication clientAuthentication) {
Assert.notNull(clientAuthentication, "ClientAuthentication must not be null");
this.clientAuthentication = clientAuthentication;
}
public VaultToken getSessionToken() {
this.lock.lock();
try {
return this.clientAuthentication.login();
}
finally {
this.lock.unlock();
}
}
}
@Configuration
public class MySessionManagerConfiguration extends SpringVaultClientConfiguration {
private final VaultEnvironmentProperties vaultProperties;
public MySessionManagerConfiguration(VaultEnvironmentProperties vaultProperties, ConfigTokenProvider configTokenProvider, List authProviders) {
super(vaultProperties, configTokenProvider, authProviders);
this.vaultProperties = vaultProperties;
}
@Bean
@Primary
public SessionManager sessionManager() {
if (vaultProperties.getAuthentication() == null && !StringUtils.hasText(vaultProperties.getToken())) {
return new StatelessSessionManager(clientAuthentication());
}
return super.sessionManager();
}
}
此漏洞由 Max Brauer 和 Mohammad Shamsi 發現並負責任地報告。
要報告 Spring 產品組合中的專案的安全漏洞,請參閱 安全策略