Skip to content

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

Open
drakkan wants to merge 1 commit into
fclairamb:mainfrom
drakkan:fix-prot-after-pasv
Open

drakkan wants to merge 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
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.

1 participant