Skip to content

fix(go): added maxBinarySize limit to decimal deserialization#3623

Merged
chaokunyang merged 3 commits into
apache:mainfrom
ayush00git:fix/decimal_desr
Apr 27, 2026
Merged

fix(go): added maxBinarySize limit to decimal deserialization#3623
chaokunyang merged 3 commits into
apache:mainfrom
ayush00git:fix/decimal_desr

Conversation

@ayush00git
Copy link
Copy Markdown
Contributor

@ayush00git ayush00git commented Apr 27, 2026

Why?

the deserialization of arbitrary-precision DECIMAL numbers involves reading a magnitude payload byte array. The length of this payload is derived from the header's metadata and is completely attacker-controlled.

What does this PR do?

use ctx.ReadBinaryLength() which correctly enforces maxBinarySize guardrails.

Related issues

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

@ayush00git ayush00git requested a review from chaokunyang as a code owner April 27, 2026 09:25
@ayush00git
Copy link
Copy Markdown
Contributor Author

@chaokunyang have a look

Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chaokunyang chaokunyang merged commit 62b0d91 into apache:main Apr 27, 2026
62 checks passed
@ayush00git ayush00git deleted the fix/decimal_desr branch April 27, 2026 12:29
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.

2 participants