]> git.ipfire.org Git - thirdparty/squid.git/commit
Reject excessively large FTP control replies (#2434) master
authorRicardo Ferreira Ribeiro <garb12@pm.me>
Thu, 4 Jun 2026 07:25:21 +0000 (07:25 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 7 Jun 2026 16:13:42 +0000 (16:13 +0000)
commit0a261cbfa775bfc439a1fc8a9f774f11e79d387b
tree919f5fe7e6dbb5f97cb282f5f2b327c9b01ad2cf
parent2c89b9b4054ad14ea191bc7cd35f969feba8df53
Reject excessively large FTP control replies (#2434)

When parsing FTP control replies, `Ftp::Client::parseControlReply()`
stores individual lines in the `ctrl.message` wordlist. The stored
values are later combined, appended, encoded, and/or converted to String
objects, exposing the results to `String::SizeMax_` limitations. Recent
commit 46f3f80 already ensures `reply_header_max_size` limits for
control replies. This change adds checks for cases where
`reply_header_max_size` configuration exceeds the recommended maximum
value. It also protects any sensitive worldlist-manipulating code that
might become reachable before `reply_header_max_size` limit is checked.

Excessively large FTP control replies now lead to ERR_FTP_FAILURE.

This is a Measurement Factory project.
src/SquidString.h
src/cache_cf.cc
src/clients/FtpClient.cc