CVE-2017-9226

Source
https://cve.org/CVERecord?id=CVE-2017-9226
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-9226.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2017-9226
Downstream
Related
Published
2017-05-24T15:29:00.277Z
Modified
2026-03-10T14:31:39.098783Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

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.

References

Affected packages

Git / github.com/kkos/oniguruma

Affected ranges

Type
GIT
Repo
https://github.com/kkos/oniguruma
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
Fixed
Fixed
Database specific
{
    "versions": [
        {
            "introduced": "0"
        },
        {
            "last_affected": "6.2.0"
        }
    ]
}
Type
GIT
Repo
https://github.com/php/php-src
Events
Database specific
{
    "versions": [
        {
            "introduced": "0"
        },
        {
            "fixed": "5.6.31"
        },
        {
            "introduced": "7.0.0"
        },
        {
            "fixed": "7.0.21"
        },
        {
            "introduced": "7.1.0"
        },
        {
            "fixed": "7.1.7"
        }
    ]
}

Affected versions

v5.*
v5.9.6
v6.*
v6.0.0
v6.1.0
v6.1.1
v6.1.2
v6.1.3

Database specific

vanir_signatures
[
    {
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2017-9226-02f03537",
        "target": {
            "file": "src/regparse.c",
            "function": "fetch_token_in_cc"
        },
        "digest": {
            "length": 4764.0,
            "function_hash": "155442029631141137222097712221615512576"
        },
        "signature_version": "v1",
        "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6"
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2017-9226-03e1ab44",
        "target": {
            "file": "src/regparse.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "340282246448782130687958519807593876335",
                "19691577292326266259481888258337573200",
                "285750249724714625561365284898613084533",
                "290219382971341702585136164131101210587",
                "216387815878479387550531275983473066368",
                "174739561935101457874745057573467750982",
                "311901103716194130129169947058170981802",
                "290219382971341702585136164131101210587"
            ]
        },
        "signature_version": "v1",
        "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6"
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2017-9226-25483da6",
        "target": {
            "file": "src/regparse.c",
            "function": "fetch_token"
        },
        "digest": {
            "length": 14321.0,
            "function_hash": "70594886040663805677780996931635258295"
        },
        "signature_version": "v1",
        "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6"
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2017-9226-343f4c1a",
        "target": {
            "file": "ext/pcre/pcrelib/pcre_jit_compile.c",
            "function": "compile_bracket_matchingpath"
        },
        "digest": {
            "length": 13872.0,
            "function_hash": "233037532068098537505988791132617368492"
        },
        "signature_version": "v1",
        "source": "https://github.com/php/php-src/commit/73915a2bd61f21fd809b4d50af9aba950f43e807"
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2017-9226-4c23b0ba",
        "target": {
            "file": "src/regparse.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "246829258880076191915156482018696757530",
                "223947624233669634426607050500944957916",
                "160761884261585877422819118548410376246",
                "223713518639165331567966595224563676527"
            ]
        },
        "signature_version": "v1",
        "source": "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a"
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2017-9226-af653b09",
        "target": {
            "file": "src/regparse.c",
            "function": "next_state_val"
        },
        "digest": {
            "length": 1647.0,
            "function_hash": "237816653384729961923500547356155140782"
        },
        "signature_version": "v1",
        "source": "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a"
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2017-9226-cfd9dfdb",
        "target": {
            "file": "ext/pcre/pcrelib/pcre_jit_compile.c"
        },
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "41612049881914751775057704412356952022",
                "206133687184829194312361432760839012982",
                "60469889591596012334583203454317370370",
                "317056786488417399517652373716894105276"
            ]
        },
        "signature_version": "v1",
        "source": "https://github.com/php/php-src/commit/73915a2bd61f21fd809b4d50af9aba950f43e807"
    }
]
source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-9226.json"