Commit Graph

10 Commits (01d649b2bf9b87656f60f57bb495b45a21cf9023)

Author SHA1 Message Date
Jack Christensen adbb38f298 Do not allow protocol messages larger than ~1GB
The PostgreSQL server will reject messages greater than ~1 GB anyway.
However, worse than that is that a message that is larger than 4 GB
could wrap the 32-bit integer message size and be interpreted by the
server as multiple messages. This could allow a malicious client to
inject arbitrary protocol messages.

https://github.com/jackc/pgx/security/advisories/GHSA-mrww-27vc-gghv
2024-03-04 09:09:29 -06:00
jeremy.spriet 603c8c1e90 feat(pgproto3/backend): add a SetMaxBodyLen to limit the max body length for the receive 2023-12-23 10:25:35 -06:00
Alexey Palazhchenko f839d501a7 Apply `gofmt -s`
And add CI check for that.
2023-01-24 07:55:00 -06:00
Mark Chambers 516300aabf spelling: successfully, compatibility 2023-01-16 20:06:01 -06:00
Jack Christensen b74c109f61 Optimize tracing
The addition of tracing caused messages to escape to the heap. By
avoiding interfaces the messages no longer escape.
2022-05-21 17:22:58 -05:00
Jack Christensen f2e96156a0 Add message tracing 2022-05-21 14:43:04 -05:00
Jack Christensen 5714896b10 Restructure sending messages
Use an internal buffer in pgproto3.Frontend and pgproto3.Backend instead
of directly writing to the underlying net.Conn. This will allow tracing
messages as well as simplify pipeline mode.
2022-05-21 11:06:44 -05:00
Jack Christensen a92f1df1df Merge remote-tracking branch 'pgproto3/master' into v5-dev
Pull in pgproto3 changes and update for pgx v5
2022-04-23 10:43:48 -05:00
Jack Christensen 2e0ec225de Make Chunkreader an internal implementation detail 2022-02-26 08:50:46 -06:00
Jack Christensen 04476c4a13 Move pgproto3 to subdirectory 2022-02-21 11:57:34 -06:00