postgres_proxy: fix partial initial message leaking to upstream - #46776
Open
tsaarni wants to merge 2 commits into
Open
postgres_proxy: fix partial initial message leaking to upstream#46776tsaarni wants to merge 2 commits into
tsaarni wants to merge 2 commits into
Conversation
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
Signed-off-by: Tero Saarni <tero.saarni@est.tech>
Member
Author
|
/retest |
agrawroh
reviewed
Aug 19, 2026
agrawroh
left a comment
Member
There was a problem hiding this comment.
Looks okay to me but I'd still let @cpakulski take a look to make sure we have not missed any edge cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Message: postgres_proxy: fix partial initial message leaking to upstream
Additional Description:
Before this PR the postgres_proxy filter forwarded partial bytes of the initial message (SSLRequest or Startup) to upstream when the message arrives split across multiple
onData()calls. The upstream PostgreSQL server received an incomplete message fragment and logs an error.This PR changes the decoder logic to return
Stoppedwhen processing incomplete initial message, which avoids forwarding the incomplete data to the next filter. The filter drains the connection buffer and waits for more data.Risk Level: Low
Testing: Unit tests were added.
Release Notes: Fixed the postgres_proxy filter forwarding incomplete initial message bytes to upstream when the message arrives in multiple TCP segments, causing PostgreSQL to reject the connection.
Fixes #46774