If the noAssert
flag is set, offset
can go beyond the end of the Buffer
, which is a security vulnerability.
Apply with the Grit CLI
grit apply remove_node_buffer_offset_check_flag
Converts double equality check
BEFORE
buf.readUIntLE(0xfeedface, 0, true); buf1.writeUInt32LE(0xfeedface, 1); buf.writeUIntBE(a, b, c, g); buf.writeUIntBE(a, b, 1); buf.readInt16BE(a, b, 1); buf.readInt16BE(a, 1); console.log(buf);
AFTER
buf.readUIntLE(0xfeedface, 0); buf1.writeUInt32LE(0xfeedface, 1); buf.writeUIntBE(a, b, c); buf.writeUIntBE(a, b, 1); buf.readInt16BE(a, b, 1); buf.readInt16BE(a); console.log(buf);