mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #313] stack-buffer-overflow in worksheet_insert_image_buffer_opt #253
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#253
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 @MrBeanc on GitHub (Nov 6, 2020).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/313
Originally assigned to: @jmcnamara on GitHub.
I think I found a stack overflow vulnerability,Here are the details
You can reproduce it in the following ways
Add special options when compiling libxlsxwriter
then compile test file
then
You can also find a crash in the following ways
i put test file and crash in zip。
fuzz.zip
@jmcnamara commented on GitHub (Nov 6, 2020):
For reference, here is the attached program:
@jmcnamara commented on GitHub (Nov 6, 2020):
Can you submit a complete program that demonstrates the issue. You can base it on this: http://libxlsxwriter.github.io/image_buffer_8c-example.html
I presume that if the size is larger than the actual data size you can get a stack overflow. Do you have any suggested mitigation?
@MrBeanc commented on GitHub (Nov 8, 2020):
test4.zip
I think you should check whether the size of image_buffer is consistent with that of image_size, otherwise it will cause overflow. The examples in the document can illustrate the problem.
@MrBeanc commented on GitHub (Nov 18, 2020):
@MrBeanc commented on GitHub (Nov 18, 2020):
Uncontrollable input image_size can cause overflow
@jmcnamara commented on GitHub (Mar 27, 2021):
Merged into #323
@ANaumann85 commented on GitHub (Apr 5, 2021):
In the example, the user creates a buffer on the heap, but gives the wrong buffer size to the function "worksheet_insert_image_buffer". Inside the function, are have very small chances to detect that mistake. In my optinion, that is is not a bug in the library, but a wrong usage.
@jmcnamara commented on GitHub (Apr 7, 2021):
I agree that this is wrong usage. If the user passes an incorrect buffer size then there isn't much (anything?) that libxlsxwriter can do about that.
I am going to keep this issue closed. If anyone has a different opinion/analysis, let me know.