Skip to content

Heap overflow in jerry-core #3976

Closed
Closed
@Changochen

Description

@Changochen

JerryScript revision

git hash: 392ee71

Test case

( function ( { a =  arguments   }) {
    const arguments
}
)

In debug build, it triggers an assertion 'scope_stack_p > context_p->scope_stack_p' failed

Execution steps

./jerry poc.js

Build cmd

python tools/build.py --compile-flag="-fsanitize=address"

Stack dump:

=================================================================
==59856==ERROR: AddressSanitizer: global-buffer-overflow on address 0x5581992ba27c at pc 0x558198ef79cd bp 0x7ffffcf5f490 sp 0x7ffffcf5f480
READ of size 2 at 0x5581992ba27c thread T0
    #0 0x558198ef79cc  (/home/yongheng/jerry_clean/build/bin/jerry+0x2d9cc)
    #1 0x558198f263d7  (/home/yongheng/jerry_clean/build/bin/jerry+0x5c3d7)
    #2 0x558198f81326  (/home/yongheng/jerry_clean/build/bin/jerry+0xb7326)
    #3 0x558198f34f6c  (/home/yongheng/jerry_clean/build/bin/jerry+0x6af6c)
    #4 0x558198eff1a3  (/home/yongheng/jerry_clean/build/bin/jerry+0x351a3)
    #5 0x558198f030ca  (/home/yongheng/jerry_clean/build/bin/jerry+0x390ca)
    #6 0x558198f3dbcb  (/home/yongheng/jerry_clean/build/bin/jerry+0x73bcb)
    #7 0x558198f3f19c  (/home/yongheng/jerry_clean/build/bin/jerry+0x7519c)
    #8 0x558198f2f238  (/home/yongheng/jerry_clean/build/bin/jerry+0x65238)
    #9 0x558198f33ac8  (/home/yongheng/jerry_clean/build/bin/jerry+0x69ac8)
    #10 0x558198f3c101  (/home/yongheng/jerry_clean/build/bin/jerry+0x72101)
    #11 0x558198f0484d  (/home/yongheng/jerry_clean/build/bin/jerry+0x3a84d)
    #12 0x558198f0515a  (/home/yongheng/jerry_clean/build/bin/jerry+0x3b15a)
    #13 0x558198f745c0  (/home/yongheng/jerry_clean/build/bin/jerry+0xaa5c0)
    #14 0x558198ee044e  (/home/yongheng/jerry_clean/build/bin/jerry+0x1644e)
    #15 0x7f2eec31db96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #16 0x558198ee1219  (/home/yongheng/jerry_clean/build/bin/jerry+0x17219)

Metadata

Metadata

Assignees

Labels

bugUndesired behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions