mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #487] Global Buffer Overflow in format_set_pattern() Function #381
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/libxlsxwriter#381
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LkkkLxy on GitHub (Sep 30, 2025).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/487
Summary
A global buffer overflow vulnerability exists in the libxlsxwriter library when using
format_set_pattern()with invalid pattern values. This can lead to memory corruption and program crashes.Environment
Vulnerability Details
_write_fill()function in/src/libxlsxwriter/src/styles.c:732format_set_pattern()Root Cause
The
format_set_pattern()function accepts pattern values without proper bounds checking. When an invalid pattern value (e.g., 19) is used, it causes an out-of-bounds access in the_write_fill()function during workbook serialization. Thepatternsarray in_write_fill()has a fixed size that doesn't accommodate all possible pattern values.Steps to Reproduce
Expected Behavior
The function should either:
Actual Behavior
The program crashes with a global buffer overflow:
Proposed Fix
format_set_pattern():Additional Information
This bug was discovered through fuzz testing.
@jmcnamara commented on GitHub (Sep 30, 2025):
Fixed on main along with several other similar potential issues.