An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7.1.5. A heap out-of-bounds write or read occurs in nextstateval() during regular expression compilation. Octal numbers larger than 0xff are not handled correctly in fetchtoken() and fetchtokenincc(). A malformed regular expression containing an octal number in the form of '\700' would produce an invalid code point value larger than 0xff in nextstateval(), resulting in an out-of-bounds write memory corruption.
[ { "digest": { "threshold": 0.9, "line_hashes": [ "340282246448782130687958519807593876335", "19691577292326266259481888258337573200", "285750249724714625561365284898613084533", "290219382971341702585136164131101210587", "216387815878479387550531275983473066368", "174739561935101457874745057573467750982", "311901103716194130129169947058170981802", "290219382971341702585136164131101210587" ] }, "id": "CVE-2017-9226-03e1ab44", "target": { "file": "src/regparse.c" }, "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6", "signature_version": "v1", "signature_type": "Line", "deprecated": false }, { "digest": { "threshold": 0.9, "line_hashes": [ "246829258880076191915156482018696757530", "223947624233669634426607050500944957916", "160761884261585877422819118548410376246", "223713518639165331567966595224563676527" ] }, "id": "CVE-2017-9226-4c23b0ba", "target": { "file": "src/regparse.c" }, "source": "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a", "signature_version": "v1", "signature_type": "Line", "deprecated": false }, { "digest": { "function_hash": "237816653384729961923500547356155140782", "length": 1647.0 }, "id": "CVE-2017-9226-af653b09", "target": { "file": "src/regparse.c", "function": "next_state_val" }, "source": "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a", "signature_version": "v1", "signature_type": "Function", "deprecated": false } ]