Skip to content

fix: check the protection of the data connection in TransferOpen - #685

Merged
fclairamb merged 1 commit into
fclairamb:mainfrom
drakkan:fix-prot-after-pasv
Oct 30, 2026
Merged

fclairamb merged 1 commit into
fclairamb:mainfrom
drakkan:fix-prot-after-pasv

Conversation

@drakkan

@drakkan drakkan commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Without this patch, a client that sends the PROT P command after a PASV or PORT command would receive data in the clear. Since standard clients do not behave this way, this represents the minimum fix: in such a scenario, an error is returned instead of transmitting the data in the clear.

This is a minimal port derived from the fork I use in SFTPGo Enterprise; it resolves an issue reported in the open-source version of SFTPGo, which uses the unmodified ftpserverlib.

Without this patch, a client that sends the PROT P command after a PASV or
PORT command would receive data in the clear. Since standard clients do not
behave this way, this represents the minimum fix: in such a scenario, an
error is returned instead of transmitting the data in the clear.
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.11%. Comparing base (d9ba563) to head (995c2d1).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #685      +/-   ##
==========================================
+ Coverage   91.08%   91.11%   +0.02%     
==========================================
  Files          13       13              
  Lines        2108     2115       +7     
==========================================
+ Hits         1920     1927       +7     
  Misses        175      175              
  Partials       13       13              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@drakkan
drakkan force-pushed the fix-prot-after-pasv branch from 4eceaa3 to 995c2d1 Compare October 23, 2026 06:42
@drakkan drakkan changed the title check the protection of the data connection before initiating the transfer fix: check the protection of the data connection in TransferOpen Oct 23, 2026
@drakkan

drakkan commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator Author

I noticed this was also reported as CVE from VulnCheck:

https://www.vulncheck.com/advisories/fclairamb-ftpserverlib-through-0.32.4-cleartext-ftpes-data-transfer-via-prot-p

@fclairamb sorry, although it is not possible to report security issues privately in this repository, I should have contacted you privately in other ways.

@fclairamb
fclairamb merged commit c7715c4 into fclairamb:main Oct 30, 2026
8 checks passed
@fclairamb

Copy link
Copy Markdown
Owner

Hi @drakkan, no problem. I will define a better security rule. Thank you for your fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants