CVE-2026-59381

Path Traversal
Affects
Spring Integration
in
Spring
No items found.
Versions
>=5.5.0 <=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

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Spring Integration is a Spring project that extends the Spring programming model to support Enterprise Integration Patterns, providing lightweight messaging and adapters for external systems such as FTP, SFTP and SMB servers.

A path traversal vulnerability (CVE-2026-59381) has been identified in the FTP, SFTP and SMB outbound gateway MGET command of Spring Integration, which allows a malicious or compromised remote server to create directories and write files with attacker-controlled content outside the configured local directory.

Per OWASP: A path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder. By manipulating variables that reference files with "dot-dot-slash (../)" sequences and its variations or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system including application source code or configuration and critical system files.

This issue affects multiple versions of Spring Integration.

Details

Module Info

Vulnerability Info

This High-severity vulnerability is found in the org.springframework.integration:spring-integration-file package in multiple versions of Spring Integration. Applications are exposed when they use the MGET command of an FTP, SFTP or SMB outbound gateway with a local directory expression that references #remoteDirectory and connect to a server that is malicious or compromised (CVSS 3.1 AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L, base score 7.1).

The remote file outbound gateway (AbstractRemoteFileOutboundGateway, the base of the FTP, SFTP and SMB outbound gateways) supports an MGET command that lists a remote directory and downloads each entry. For every listing entry, getRemoteFileForMget() derives the remote directory from the file name the server returned and passes it to get(), which resolves the local target directory through generateLocalDirectory():

private File generateLocalDirectory(Message<?> message, String remoteDirectory) {
	EvaluationContext evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
	if (remoteDirectory != null) {
		evaluationContext.setVariable("remoteDirectory", remoteDirectory);
	}
	File localDir = ExpressionUtils.expressionToFile(this.localDirectoryExpression, evaluationContext, message,
			"Local Directory");
	if (!localDir.exists()) {
		Assert.isTrue(localDir.mkdirs(), () -> "Failed to make local directory: " + localDir);
	}
	return localDir;
}

The documented #remoteDirectory SpEL variable is set from this server-controlled value, and applications can reference it in local-directory-expression (as in the reference documentation examples) to mirror the remote tree locally. The resulting directory is created with no check that it stays inside the intended local root, so a listing entry whose path contains .. segments makes the application create a directory outside that root. Any check on the downloaded file name is then made against this already-escaped directory, so it passes, and the file contents supplied by the server are written to an attacker-chosen location on the local file system.

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

Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
High
ID
CVE-2026-59381
PROJECT Affected
Spring Integration
Versions Affected
>=5.5.0 <=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
NES Versions Affected
Published date
November 20, 2026
≈ Fix date
Category
Path Traversal
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Spring
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.