Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreThe fix for CVE-2026-40987 validates only the file name against the local directory. For the remote file outbound gateway MGET command, the local directory itself can be derived from the server-controlled listing entry via the documented #remoteDirectory SpEL variable in a local-directory-expression. Since the directory is canonicalized before the containment check, the check passes even though the directory has already escaped the intended root, and the framework then creates the escaped directory.
As a result, a malicious FTP, SFTP or SMB server can write files with attacker-controlled content to arbitrary paths outside the configured local directory.
Applications are affected if they use the MGET command of an FTP, SFTP or SMB outbound gateway with a local directory expression that references #remoteDirectory (as in the reference documentation examples) and connect to a server that may be malicious or compromised.
Spring Integration:
| Fix version | Availability |
|---|---|
| 7.1.3 | OSS |
| 7.1.2.1 | Enterprise Support Only |
| 7.0.8 | OSS |
| 7.0.7.1 | Enterprise Support Only |
| 6.5.12 | Enterprise Support Only |
| 6.4.14 | Enterprise Support Only |
| 5.5.23 | Enterprise Support Only |
Users of affected versions who cannot upgrade should avoid referencing #remoteDirectory in the MGET local directory expression, or ensure the resolved local directory is validated against the intended root directory. Connecting only to trusted FTP, SFTP or SMB servers further reduces the risk.
This vulnerability was discovered and responsibly reported by h1ei1.
To report a security vulnerability for a project within the Spring portfolio, see the Security Policy