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

Array elements left uninitialized in Array.prototype.slice() for primitive this values. #188

Closed
l0kihardt opened this issue Jul 3, 2019 · 5 comments
Labels

Comments

@l0kihardt
Copy link

l0kihardt commented Jul 3, 2019

env

ubuntu 18.04
njs 0feca92
gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
built with ASAN on

bug

> (1..__proto__.length = '1', Array.prototype.slice.call(1, 0, 2)).toString()
ASAN:SIGSEGV
=================================================================
==13918==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000407181 bp 0x7ffdf2511450 sp 0x7ffdf2511430 T0)
    #0 0x407180 in nxt_lvlhsh_find nxt/nxt_lvlhsh.c:181
    #1 0x4479b7 in njs_object_property njs/njs_object_property.c:757
    #2 0x4210c2 in njs_primitive_value njs/njs_vm.c:2987
    #3 0x4206ec in njs_vmcode_string_argument njs/njs_vm.c:2864
    #4 0x41473f in njs_vmcode_interpreter njs/njs_vm.c:159
    #5 0x412c4e in njs_vm_start njs/njs.c:594
    #6 0x404a75 in njs_process_script njs/njs_shell.c:771
    #7 0x40387b in njs_interactive_shell njs/njs_shell.c:501
    #8 0x402ad1 in main njs/njs_shell.c:271
@VBart
Copy link
Contributor

VBart commented Jul 3, 2019

njs scripts have no remote access, so the attacker can't control them and thus it's not a remote code execution.

@l0kihardt
Copy link
Author

l0kihardt commented Jul 3, 2019 via email

@xeioex
Copy link
Contributor

xeioex commented Jul 3, 2019

@l0kihardt

njs is used for nginx configuration and is not an application server. njs only executes js code from a static file which is a part of nginx config file (which must be trusted source anyway).

@VBart
Copy link
Contributor

VBart commented Jul 3, 2019

@l0kihardt If you can control njs script on a server, then you already have a root access and can control the whole server without any bugs needed.

@xeioex xeioex added the bug label Jul 3, 2019
@xeioex xeioex changed the title Logic problems happen in the nxt_lvlhsh.c Array elements left uninitialized in Array.prototype.slice() for primitive this values. Jul 3, 2019
@l0kihardt
Copy link
Author

l0kihardt commented Jul 3, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants