Skip to content

ftplistparser: cap the max amount of wildcard entries - #23633

Closed
bagder wants to merge 2 commits into
masterfrom
bagder/wildcard-limit
Closed

bagder wants to merge 2 commits into
masterfrom
bagder/wildcard-limit

Conversation

@bagder

@bagder bagder commented Oct 27, 2026

Copy link
Copy Markdown
Member

To avoid mistakes or malicious intent to keep adding to the list.

To avoid mistakes or malicious intent to keep adding to the list.
@bagder bagder added the FTP label Oct 27, 2026
@bagder
bagder marked this pull request as ready for review October 27, 2026 16:04
@bagder
bagder requested a balanced review from Copilot October 27, 2026 16:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The pre-append check permits 100,001 matching entries, exceeding the documented maximum.

1 open issue
What changed in this PR

This PR bounds the FTP wildcard match list to prevent excessive growth from accidental or malicious directory listings.

Changes:

  • Defines a 100,000-entry limit for FTP wildcard matches.
  • Adds a parser check that returns an error when the limit is exceeded.
  • Documents the limit for CURLOPT_WILDCARDMATCH starting in curl 8.24.0.
File Description
lib/​ftplistparser.h Defines the directory-entry limit.
lib/​ftplistparser.c Adds limit enforcement and diagnostic logging.
docs/​libcurl/​opts/​CURLOPT_WILDCARDMATCH.md Documents the wildcard match limit.

Review effort: Balanced

Comment thread lib/ftplistparser.c Resolved
@bagder bagder closed this in fdb9159 Oct 27, 2026
@bagder
bagder deleted the bagder/wildcard-limit branch October 27, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants