Skip to content

Critical: fix stack overflow from unbounded sprintf()#2410

Open
sfc-gh-dachristensen wants to merge 1 commit intoapache:masterfrom
sfc-gh-dachristensen:fix/critical-stack-overflow-sprintf
Open

Critical: fix stack overflow from unbounded sprintf()#2410
sfc-gh-dachristensen wants to merge 1 commit intoapache:masterfrom
sfc-gh-dachristensen:fix/critical-stack-overflow-sprintf

Conversation

@sfc-gh-dachristensen
Copy link
Copy Markdown

The %f format specifier for doubles can produce over 300 characters (e.g., DBL_MAX formatted with %f). The 64-byte stack buffer is insufficient. This is a stack buffer overflow exploitable via crafted agtype float values.

Fix this by both bumping the buffer size (to allow full precision) and changing all sprintf() call sites to be snprintf() calls instead.

The %f format specifier for doubles can produce over 300 characters (e.g.,
DBL_MAX formatted with %f). The 64-byte stack buffer is insufficient. This is a
stack buffer overflow exploitable via crafted agtype float values.

Fix this by both bumping the buffer size (to allow full precision) and changing
all sprintf() call sites to be snprintf() calls instead.

Signed-off-by: David Christensen <david.christensen@snowflake.com>
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.

1 participant