CVE-2026-59416
Patch Available.
This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.
Overview
Spring Integration extends the Spring programming model to support the well-known Enterprise Integration Patterns, enabling lightweight messaging within Spring-based applications and integration with external systems, such as FTP servers, through declarative adapters.
A command injection vulnerability (CVE-2026-59416) has been identified in the FTP outbound channel adapter and gateway of Spring Integration, which allows attackers who can influence a remote file name or directory to inject additional FTP commands on the control connection. Depending on the FTP account's permissions, the injected commands can delete or rename files, change permissions, or run other operations the server supports.
Per OWASP: A CRLF Injection attack occurs when a user manages to submit a CRLF into an application.
This issue affects multiple versions of Spring Integration.
Details
Module Info
- Product: Spring Integration
- Affected packages:
org.springframework.integration:spring-integration-ftp - Affected versions: <=5.5.22, >=6.4.0 <=6.4.13, >=6.5.0 <=6.5.11, >=7.0.0 <=7.0.7, >=7.1.0 <=7.1.2
- GitHub repository: https://github.com/spring-projects/spring-integration
- Published packages: https://central.sonatype.com/artifact/org.springframework.integration/spring-integration-ftp
- Package manager: Maven
- Fixed in:
- OSS Spring Integration 7.0.8, 7.1.3
- NES for Spring Integration
Vulnerability Info
This High-severity vulnerability is found in the org.springframework.integration:spring-integration-ftp package in multiple versions of Spring Integration. When the chmod option is set, FtpMessageHandler (the FTP outbound channel adapter) and FtpOutboundGateway change the permissions of an uploaded file by sending a textual SITE chmod command. The command is built by concatenating the remote path onto the command text, with no check on the characters the path contains:
@Override
protected void doChmod(RemoteFileTemplate<FTPFile> remoteFileTemplate, final String path, final int chmod) {
remoteFileTemplate.executeWithClient((ClientCallbackWithoutResult<FTPClient>) client -> {
String chModCommand = "chmod " + Integer.toOctalString(chmod) + " " + path;
try {
client.sendSiteCommand(chModCommand);
}
// ...
});
}
The remote path is commonly derived from the message: the default DefaultFileNameGenerator takes the file name from the FileHeaders.FILENAME header, and the remote directory can come from an expression evaluated against the message. FTP commands on the control connection are terminated by CR LF, so a file name such as good.txt\r\nDELE victim.txt makes the server receive the SITE chmod command followed by a second, attacker-chosen command, which runs with the privileges of the configured FTP account. The same unvalidated paths also reach the commands that Apache Commons Net builds for the FtpSession operations (such as STOR, RNFR and DELE) and the working-directory change performed by FtpOutboundGateway. An application is exposed when it uses the FTP outbound channel adapter or gateway with chmod set and an untrusted message sender can control the remote file name or remote directory.
Mitigation
Only recent versions of Spring Integration receive community support. Older lines are End-of-Life and will not receive public updates to address this issue.
Users of the affected components should apply one of the following mitigations:
- Upgrade to a currently supported version of Spring Integration.
- Leverage a commercial support partner like HeroDevs for post-EOL security support.
Credits
- anand1139 (finder)