CVE-2026-59437: Man In The Middle Attack Possible When Using Git and SSH With Spring Cloud Config Server
When Spring Cloud Config Server uses property-based SSH settings ( spring.cloud.config.server.git.ignoreLocalSshSettings=true ) for a Git repository and no spring.cloud.config.server.git.hostKey is configured, it disables strict host key checking even if spring.cloud.config.server.git.strictHostKeyChecking is true , which is the default. The server then accepts any SSH server key and never consults the configured spring.cloud.config.server.git.knownHostsFile .
Applications are affected when they use the Config Server with a Git backend over SSH in property-based SSH mode without an explicit hostKey .
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Configure an explicit spring.cloud.config.server.git.hostKey when using property-based SSH settings for a Git repository.
Spring Cloud Config Server spring.cloud.config.server.git.hostKey = explicit host key
Event History
Frequently Asked Questions
Which deployments are affected?
Deployments are affected when Spring Cloud Config Server uses a Git backend over SSH, enables property-based SSH settings with spring.cloud.config.server.git.ignoreLocalSshSettings=true, and does not configure spring.cloud.config.server.git.hostKey.
Does enabling strictHostKeyChecking or configuring knownHostsFile prevent this issue?
No. In the affected configuration, strict host key checking is disabled even when spring.cloud.config.server.git.strictHostKeyChecking=true, and the configured spring.cloud.config.server.git.knownHostsFile is not consulted.
What does an attacker need to exploit this?
An attacker must be able to perform a man-in-the-middle attack on the SSH connection between the Config Server and its Git repository. Exploitation can result in integrity impact.
What configuration change can mitigate the issue if patching is not immediately possible?
Configure an explicit SSH host key using spring.cloud.config.server.git.hostKey. Alternatively, avoid the affected property-based SSH mode for Git-over-SSH repositories.