-
-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stack-buffer-overflow and heap-buffer-overflow #286
Comments
@liweiii Note that I do not consider leaks at exit a bug - unfortunately AddressSanitizer on Linux defaults to performing leak checks at exit which often yields false positives. When a process goes away, so does any memory it allocated... Anyways, if you will kindly provide the input that causes the stack/heap overflow issues I will look into this further. |
Hi,
I argee with your idea that ASan is check leak that way, but that not mean that leaks occurred when exit! Besides, I didn't use ASan to check ,but LSan, it can report leak when it occurs. Second, I couldn't upload the crash case until Monday, but you can quickly reproduce the crash used my teatcase and compile lines provided in issue.
Best Wishes
…------------------ 原始邮件 ------------------
发件人: "michaelrsweet/mxml" ***@***.***>;
发送时间: 2021年10月15日(星期五) 晚上9:46
***@***.***>;
抄送: "COME WITH ***@***.******@***.***>;
主题: Re: [michaelrsweet/mxml] stack-buffer-overflow and heap-buffer-overflow (#286)
@liweiii Note that I do not consider leaks at exit a bug - unfortunately AddressSanitizer on Linux defaults to performing leak checks at exit which often yields false positives. When a process goes away, so does any memory it allocated...
Anyways, if you will kindly provide the input that causes the stack/heap overflow issues I will look into this further.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Here is the input . I think the reason I have found. leak is because you didn‘’t free the memory. I think if this lib is used in an server or parse a lot of XML ,maybe OOM and crash will occur. overflow is because my input string is not a well-formed XML string. so it's your deal if it's necessery to change the code or tell that only formed strings to use mxmlLoadStrin |
@liweiii OK, after testing the current master code, I can't get this to fail. Can you re-test and let me know if the other changes I've made have corrected the issue? |
Closing as fixed in current master; if you can reproduce on master, please let me know the details! |
Hi, I'm trying to triage CVE-2021-42859 on behalf of Debian. I have been unable to reproduce using the PoC ZIP attached to this issue using version 3.2 as packaged in Debian. (https://tracker.debian.org/pkg/mxml) @michaelrsweet - if the issue cannot be reproduced, can I ask that you, as upstream, request that the CVE is rejected at https://cveform.mitre.org/ please? (using the requesting an update of the CVE option) |
@codehelp Done! |
Hi,
We have used Mini-xml in our project, so I test v3.2 and master branch and found something:
Fisrt, there are some memory leaks in v3.2 and master:
and :
this is your testmxml.c:
also ,we I input an unformed string to mxmlLoadString, there will be a stack-buffer-overflow and heap-buffer-overflow. I think if you add a longth check in mxml_string_getc when every pointer change("like (*s)++"), will be better? Of course Maybe I have use it in a wrong . you can check it here:
this is my testcase:
you can compile your lib with
CFLAGS =+ "-g -O0 -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link" and
LDFLAGS =+"-fsanitize=fuzzer-no-link -fsanitize=address"
and
clang++ -g -O1 -fno-omit-frame-pointer -gline-tables-only -fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link mxml_fuzzer.cpp -I ./ -fsanitize=fuzzer ./libmxml.a
run and these are the backtrace:
The text was updated successfully, but these errors were encountered: