Skip to content

Override basic-ftp to ^6.2.1 (GHSA-c475-qrg2-pj4r) - #8086

Merged
code-asher merged 1 commit into
coder:mainfrom
harshbhx:fix/8078-basic-ftp
Oct 28, 2026
Merged

code-asher merged 1 commit into
coder:mainfrom
harshbhx:fix/8078-basic-ftp

Conversation

@harshbhx

Copy link
Copy Markdown
Contributor

Fixes #8078

basic-ftp <= 6.2.0 is affected by GHSA-c475-qrg2-pj4r (quadratic-time regex backtracking in the Unix listing parser used by Client.list()), fixed in 6.2.1. code-server only gets it transitively (proxy-agent -> pac-proxy-agent -> get-uri -> basic-ftp), and the newest get-uri (8.0.1) still depends on basic-ftp@^5.3.1, so a plain lockfile refresh can't reach a patched release.

This adds an overrides entry ("basic-ftp": "^6.2.1") and updates package-lock.json, which moves basic-ftp from 5.3.1 to 6.2.3. The lockfile diff is only the basic-ftp entry.

Compatibility: get-uri only uses new Client(), access, lastMod, list, downloadTo and close, all still present in 6.x. The one 6.0.0 breaking change is that separate transfer hosts are rejected by default (FTP bounce protection, https://github.com/patrickjuchli/basic-ftp/releases/tag/v6.0.0). It only affects an FTP server whose PASV reply names a different host than the control connection. Here get-uri is only reached when a PAC script fetches an ftp: URL for a proxy config, so I expect the impact to be negligible.

Testing:

  • Checked on my fork's CI (https://github.com/harshbhx/code-server/actions/runs/40720819144): npm ci accepts the lockfile, npm ls basic-ftp shows get-uri -> basic-ftp@6.2.3 overridden, and a local fake FTP server (USER/PASS/MDTM/PASV/RETR) served a file through get-uri's ftp: handler with the override applied.
  • I did not run code-server's own build or test suite for this change, and it was not tested against a real FTP server. The repo's Build workflow does not run on my fork.

get-uri still depends on basic-ftp ^5.x, which has no patched release.
@harshbhx
harshbhx requested a review from a team as a code owner October 28, 2026 17:34
@harshbhx harshbhx changed the title chore: override basic-ftp to ^6.2.1 (GHSA-c475-qrg2-pj4r) Override basic-ftp to ^6.2.1 (GHSA-c475-qrg2-pj4r) Oct 28, 2026

@code-asher code-asher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I see upstream has already bumped basic-ftp but looks like no new version yet, so overriding in the meantime makes sense to me.

@code-asher
code-asher merged commit 70fc911 into coder:main Oct 28, 2026
15 checks passed
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.

Bump basic-ftp to >=6.2.1 to fix CVE-2026-102990 (DoS in Client.list())

2 participants