Update basic-ftp to 5.2.2 to patch CVE-2026-27699 path traversal#2
Draft
Update basic-ftp to 5.2.2 to patch CVE-2026-27699 path traversal#2
Conversation
…rsal vulnerability Agent-Logs-Url: https://github.com/IntelliSOFT-Consulting/Chanjo-web-TestingAutomation/sessions/c27b9593-09b8-4c6f-b720-375e9ee87cb5 Co-authored-by: moshonk <1963527+moshonk@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix path traversal vulnerability in basic-ftp downloadToDir method
Update basic-ftp to 5.2.2 to patch CVE-2026-27699 path traversal
Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
basic-ftp≤5.0.5 allows a malicious FTP server to write files outside the intended download directory via../sequences in LIST response filenames passed unsanitized topath.join()indownloadToDir(). Fixed in 5.2.0.Changes
package-lock.json: Bumped transitive depbasic-ftp5.0.5 → 5.2.2 vianpm update basic-ftp(no manifest change needed;get-uri's^5.0.2constraint already permits this range)Reachability
basic-ftpis pulled in transitively viacypress → proxy-agent → get-uri → basic-ftp. No code in this repo callsdownloadToDir()or anybasic-ftpAPI directly — the vulnerable code path is not reachable. Update clears the Dependabot alert and removes the vulnerable version from the tree.Original prompt
This section details the Dependabot vulnerability alert you should resolve
<alert_title>Basic FTP has Path Traversal Vulnerability in its downloadToDir() method</alert_title>
<alert_description>The
basic-ftplibrary contains a path traversal vulnerability in thedownloadToDir()method. A malicious FTP server can send directory listings with filenames containing path traversal sequences (../) that cause files to be written outside the intended download directory.Source-to-Sink Flow
Vulnerable Code
File:
src/Client.ts:707Root Cause:
- Parser validation (
parseListUnix.ts:101) only filters exact.or..entries- No sanitization of
../sequences in filenamespath.join()doesn't prevent traversal,fs.open()resolves pathsImpact
A malicious FTP server can:
- Write files to arbitrary locations on the client filesystem
- Overwrite critical system files (if user has write access)
- Potentially achieve remote code execution
Affected Versions
Mitigation
Workaround: Do not use
downloadToDir()with untrusted FTP servers.Fix: Sanitize filenames before use: