Skip to content

bound host copy to its length in php_fopen_do_pasv#22203

Open
alhudz wants to merge 1 commit into
php:masterfrom
alhudz:ftp-pasv-host-overread
Open

bound host copy to its length in php_fopen_do_pasv#22203
alhudz wants to merge 1 commit into
php:masterfrom
alhudz:ftp-pasv-host-overread

Conversation

@alhudz
Copy link
Copy Markdown

@alhudz alhudz commented Jun 1, 2026

php_fopen_do_pasv at ftp_fopen_wrapper.c:364 copies the host with a fixed ip_size from hoststart, which points into the 512-byte tmp_line holding the server's untrusted 227 reply, so a long message before the address tuple drives the read past the end of the buffer. Copy only the NUL-terminated host length instead, capped to ip_size-1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant