Skip to content
/ server Public

enforce bounded parsing for NUL-terminated fields in authentication p…#4877

Open
jmestwa-coder wants to merge 2 commits intoMariaDB:mainfrom
jmestwa-coder:sql-acl-bounded-parsing-auth-packets
Open

enforce bounded parsing for NUL-terminated fields in authentication p…#4877
jmestwa-coder wants to merge 2 commits intoMariaDB:mainfrom
jmestwa-coder:sql-acl-bounded-parsing-auth-packets

Conversation

@jmestwa-coder
Copy link
Copy Markdown

Summary

Improve robustness of authentication packet parsing in sql_acl by validating NUL-terminated fields within packet bounds.

Changes

  • Replace unbounded string operations (strlen, strend, safe_strlen) with a bounded helper.
  • Ensure user, password, database, and plugin fields are parsed within packet limits.
  • Handle optional plugin field correctly when absent (next_field == packet_end).

Notes

  • No behavior change for valid inputs.
  • Malformed packets are now safely rejected instead of causing undefined behaviour.
  • Changes are minimal and localized.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2026

CLA assistant check
All committers have signed the CLA.

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.

2 participants