Skip to content

PacketEncoder: add minimal validation of fcgi packets on decode#78

Open
rcanavan wants to merge 1 commit into
hollodotme:masterfrom
rcanavan:master
Open

PacketEncoder: add minimal validation of fcgi packets on decode#78
rcanavan wants to merge 1 commit into
hollodotme:masterfrom
rcanavan:master

Conversation

@rcanavan

@rcanavan rcanavan commented May 2, 2024

Copy link
Copy Markdown

Proposed Changes

When accidentally contacting a HTTP server instead of an fcgi server, Socket::readPacket() can turn into an infinite loop. This change implements a rudimentary check that the server that was contacted is actually a fcgi server.

Further comments

A proper fix would also implement a global timeout in Socket::readPacket(). On top of that, stream_select() or similar should be used in the while ( $length && ($buffer = fread loop so that it does not run as a busy loop, but I was unable to convince it to block with the HTTP server that caused the initial problem.

@rcanavan rcanavan requested a review from hollodotme as a code owner May 2, 2024 13:42
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.

1 participant