Skip to content

Security: Harden Proxy Protocol V2 parsing against OOB reads and shor…#4999

Open
uwezkhan wants to merge 1 commit intoMariaDB:mainfrom
uwezkhan:fix/proxy-v2-hardening
Open

Security: Harden Proxy Protocol V2 parsing against OOB reads and shor…#4999
uwezkhan wants to merge 1 commit intoMariaDB:mainfrom
uwezkhan:fix/proxy-v2-hardening

Conversation

@uwezkhan
Copy link
Copy Markdown

…t readsThis improves validation in the PROXY protocol v2 parsing path.

The previous implementation assumed vio_read() would return the full
requested number of bytes, but short reads are possible and could leave
parts of the header buffer only partially initialized while parsing
continued.

This patch updates the parser to read the full fixed and trailing header
sections before processing, corrects trailer length decoding from network
byte order, and validates that enough address data is present for each
supported address family before accessing it.

Malformed or truncated PROXY v2 headers are now rejected safely.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant