Bug 1471782 - There is an illegal address access in eval.cpp of libsass
There is an illegal address access in eval.cpp of libsass
Status: NEW
Product: Fedora
Classification: Fedora
Component: sassc (Show other bugs)
27
x86_64 Linux
unspecified Severity urgent
: ---
: ---
Assigned To: Aurelien Bompard
Fedora Extras Quality Assurance
: Security
Depends On:
Blocks: CVE-2017-11554/CVE-2017-11555/CVE-2017-11556/CVE-2017-11605/CVE-2017-11608/CVE-2017-12962/CVE-2017-12963/CVE-2017-12964
  Show dependency treegraph
 
Reported: 2017-07-17 08:33 EDT by owl337
Modified: 2017-08-15 05:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Triggered by "./sassc POC" (119 bytes, application/x-rar)
2017-07-17 08:33 EDT, owl337
no flags Details

  None (edit)
Description owl337 2017-07-17 08:33:50 EDT
Created attachment 1299841 [details]
Triggered by "./sassc POC"

Description of problem:

There is an illegal address access in eval.cpp of libsass

Version-Release number of selected component (if applicable):

<= latest version

How reproducible:

./sassc $POC

Steps to Reproduce:
The debugging information is as follows:

$ ./sassc POC


Program received signal SIGSEGV, Segmentation fault.
Sass::Eval::operator() (this=0x7fffffffde20, m=0x646820) at eval.cpp:526
526	      Expression_Ptr ex_val = m->at(key)->perform(this);
(gdb) bt
#0  Sass::Eval::operator() (this=0x7fffffffde20, m=0x646820) at eval.cpp:526
#1  0x00007ffff79ace11 in Sass::Eval::operator() (this=0x7fffffffde20, l=0x631630) at eval.cpp:491
#2  0x00007ffff79b053f in Sass::Eval::operator() (this=0x7fffffffde20, b_in=<optimized out>) at eval.cpp:721
#3  0x00007ffff79acbc3 in Sass::Eval::operator() (this=0x7fffffffde20, l=0x631080) at eval.cpp:503
#4  0x00007ffff79f2bb4 in Sass::Expand::operator() (this=<optimized out>, a=<optimized out>) at expand.cpp:330
#5  0x00007ffff7a09771 in Sass::Expand::append_block (this=0x7fffffffde10, b=<optimized out>) at expand.cpp:799
#6  0x00007ffff79e9f89 in Sass::Expand::operator() (this=0x7fffffffde10, b=0x630f10) at expand.cpp:81
#7  0x00007ffff7800358 in Sass::Context::compile (this=0x62ff40) at context.cpp:659
#8  0x00007ffff77fd303 in Sass::File_Context::parse (this=0x62ff40) at context.cpp:588
#9  0x00007ffff7b16376 in Sass::sass_parse_block (compiler=0x630480) at sass_context.cpp:227
#10 sass_compiler_parse (compiler=0x630480) at sass_context.cpp:476
#11 0x00007ffff7b15562 in sass_compile_context (c_ctx=0x62fda0, cpp_ctx=0x7ffff7fda050) at sass_context.cpp:364
#12 0x00007ffff7b1592a in sass_compile_file_context (file_ctx=0x62fda0) at sass_context.cpp:463
#13 0x0000000000402796 in compile_file (options=0x62fd20, input_path=<optimized out>, outfile=0x0) at sassc.c:145
#14 0x0000000000403117 in main (argc=<optimized out>, argv=<optimized out>) at sassc.c:335

The asan debug info is as follows:

ASAN:SIGSEGV
=================================================================
==31154==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x7f1450d3b64d bp 0x7ffdff76db10 sp 0x7ffdff76d8c0 T0)
    #0 0x7f1450d3b64c  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x53664c)
    #1 0x7f1450d3a3e2  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x5353e2)
    #2 0x7f1450d3feaa  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x53aeaa)
    #3 0x7f1450d3a14e  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x53514e)
    #4 0x7f1450daba49  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x5a6a49)
    #5 0x7f1450dcf9da  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x5ca9da)
    #6 0x7f1450d9d71a  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x59871a)
    #7 0x7f1450a931aa  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x28e1aa)
    #8 0x7f1450a8e3b3  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x2893b3)
    #9 0x7f1450f9fe60  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x79ae60)
    #10 0x7f1450f9eaa1  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x799aa1)
    #11 0x7f1450f9eee1  (/home/icy/secreal/libsass-asan/install/lib/libsass.so.1+0x799ee1)
    #12 0x4ddfc5  (/home/icy/secreal/sassc-asan/install/bin/sassc+0x4ddfc5)
    #13 0x4debe5  (/home/icy/secreal/sassc-asan/install/bin/sassc+0x4debe5)
    #14 0x7f144f590a3f  (/lib/x86_64-linux-gnu/libc.so.6+0x20a3f)
    #15 0x436508  (/home/icy/secreal/sassc-asan/install/bin/sassc+0x436508)

AddressSanitizer can not provide additional info.
==31154==ABORTING


Actual results:

crash

Expected results:

crash

Additional info:

Credits:

This vulnerability is detected by team OWL337, with our custom fuzzer collAFL. Please contact ganshuitao@gmail.com   and chaoz@tsinghua.edu.cn if you need more info about the team, the tool or the vulnerability.
Comment 1 Aurelien Bompard 2017-07-18 09:24:05 EDT
Reported upstream as https://github.com/sass/libsass/issues/2446
Comment 2 Jan Kurik 2017-08-15 05:11:45 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Note You need to log in before you can comment on or make changes to this bug.