Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-40987 — CVE-2026-40987 PoC | Kitploit
Tools/GitHubGitHub/daehyuh/cve-2026-40987
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingPapers & ResearchLearning & Education
GitHubdaehyuh/cve-2026-40987

CVE-2026-40987

CVE-2026-40987 PoC

View Repository
2 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-40987: Spring Integration Remote File Synchronization Path Traversal PoC

This repository is a minimal reproduction PoC for CVE-2026-40987, as disclosed in the official Spring Security Advisory.

  • Official advisory: https://spring.io/security/cve-2026-40987/
  • Official title: Remote-file synchronizer in Spring Integration writes server-supplied filename under localDirectory without canonicalization
  • Severity: High
  • CVSS v3.1: AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L
  • Disclosure date: 2026-06-10

Vulnerability Summary

The remote-file synchronizer in Spring Integration could use the filename provided by the remote server as-is when creating the local storage path. If canonical path validation is insufficient, a malicious or compromised FTP/SFTP/SMB server could return a filename like ../escaped-by-ftp-list.txt, causing files to be written outside the configured localDirectory.

According to the official advisory, this issue is not limited to FTP but applies to the FTP/SFTP/SMB remote file synchronization family in Spring Integration. This PoC uses FtpInboundFileSynchronizer to reproduce the same vulnerable path in the smallest and clearest way.

Affected Scope

Affected products per the official advisory:

  • Spring Integration

Affected versions:

  • 7.0.0 - 7.0.4
  • 6.5.0 - 6.5.8
  • 6.4.0 - 6.4.11
  • 6.3.0 - 6.3.14
  • 5.5.0 - 5.5.20
  • Older versions that are no longer supported may also be affected

Fixed versions:

  • 7.0.5 or 7.0.4.1
  • 6.5.9 or 6.5.8.1
  • 6.4.12
  • 6.3.15
  • 5.5.21

What This PoC Demonstrates

The tests demonstrate two paths.

  1. SpringIntegrationRemoteFilePathTraversalTest

    • Directly reproduces the common remote-file synchronizer path in Spring Integration.
    • Verifies that when the remote filename is ../escaped-by-spring-integration.txt, the file path is created outside the configured local directory.
  2. SpringIntegrationFtpPathTraversalTest

    • Runs a small malicious FTP server within the test.
    • Injects ../escaped-by-ftp-list.txt into the FTP server's LIST response.
    • Confirms that Spring Integration's actual FtpInboundFileSynchronizer receives this filename, downloads incoming/../escaped-by-ftp-list.txt, and the resulting file is created outside the downloads directory.

The core flow of the PoC is as follows.

root@kitploit:~
configured localDirectory = <temp>/downloads
remote LIST filename      = ../escaped-by-ftp-list.txt
resulting local path      = <temp>/downloads/../escaped-by-ftp-list.txt
normalized location       = <temp>/escaped-by-ftp-list.txt

In other words, it is possible to write files outside the application's intended download directory.

How to Run

Windows:

root@kitploit:~
.\mvnw.cmd test

macOS/Linux:

root@kitploit:~
./mvnw test

Expected results for vulnerable versions:

root@kitploit:~
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Test success means "the vulnerable behavior has been reproduced." In other words, with vulnerable dependencies, the tests pass and demonstrate directory traversal writes.

Versions Verified Locally

You can verify multiple vulnerable versions with the following commands.

root@kitploit:~
.\mvnw.cmd "-Dspring-integration.version=6.4.10" test
.\mvnw.cmd "-Dspring-integration.version=6.5.8" test
.\mvnw.cmd "-Dspring-integration.version=7.0.4" test
.\mvnw.cmd "-Dspring-integration.version=7.1.0-RC1" test

The default value in this repository is spring-integration.version=7.0.4.

Why This Is Dangerous

This vulnerability allows an attacker to write attacker-controlled content to the local filesystem of the client application. The attacker must be able to manipulate the response of a remote file server that the application trusts and polls, rather than being a typical HTTP client.

Therefore, while preconditions exist, the following impacts are possible under the right conditions.

  • Create or overwrite files inside the application's working directory
  • Place attacker-controlled files in batch input directories, web roots, temp directories, etc.
  • When combined with subsequent processing pipelines, a greater integrity impact is possible

The official advisory assessed this issue as High.

Credit

The official Spring advisory credits the following researchers for responsible disclosure.

  • M0untainShley
  • SharlongWen
  • daehyuh

References

  • Spring official advisory: https://spring.io/security/cve-2026-40987/
  • CVSS calculator: https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:L/UI:R/S:C/C:L/I:H/A:L&version=3.1
Download Tool