Skip to content
Heist/ feed
Back to feed
Critical

Security advisory

Type: advisorySources: OSVCVE: CVE-2017-9226

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 next_state_val() during regular expression compilation. Octal numbers larger than 0xff are not handled correctly in fetch_token() and fetch_token_in_cc(). A malformed regular expression containing an octal number in the form of '\700' would produce an invalid code point value larger than 0xff in next_state_val(), resulting in an out-of-bounds write memory corruption.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2017-9226
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 09:11 UTC · Revision 1

Source evidence

CVE-2017-9226

core-osv · Original source

Published 24 May 2017, 15:29 UTC

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 next_state_val() during regular expression compilation. Octal numbers larger than 0xff are not handled correctly in fetch_token() and fetch_token_in_cc(). A malformed regular expression containing an octal number in the form of '\700' would produce an invalid code point value larger than 0xff in next_state_val(), resulting in an out-of-bounds write memory corruption.

osv:CVE-2017-9226
Complete source record
{
  "id": "025c18d84e57440dcca41710b18fa1bfb568bb73cd3bcbe4fa6b48bfc25fd26a",
  "url": "https://osv.dev/vulnerability/CVE-2017-9226",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2017-9226",
    "summary": "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 next_state_val() during regular expression compilation. Octal numbers larger than 0xff are not handled correctly in fetch_token() and fetch_token_in_cc(). A malformed regular expression containing an octal number in the form of '\\700' would produce an invalid code point value larger than 0xff in next_state_val(), resulting in an out-of-bounds write memory corruption.",
    "evidence": "osv:CVE-2017-9226",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2017-9226",
      "aliases": [
        "CVE-2017-9226"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/kkos/oniguruma",
              "type": "GIT",
              "events": [
                {
                  "introduced": "c4ce370f5754b34321c7f87cdc6f198864221eca"
                },
                {
                  "last_affected": "c4ce370f5754b34321c7f87cdc6f198864221eca"
                },
                {
                  "fixed": "b4bf968ad52afe14e60a2dc8a95d3555c543353a"
                },
                {
                  "fixed": "f015fbdd95f76438cd86366467bb2b39870dd7c6"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:oniguruma_project:oniguruma:6.2.0:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "6.2.0"
                      },
                      {
                        "last_affected": "6.2.0"
                      }
                    ],
                    "source": "CPE_STRING"
                  },
                  {
                    "range": [
                      {
                        "fixed": "b4bf968ad52afe14e60a2dc8a95d3555c543353a"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "f015fbdd95f76438cd86366467bb2b39870dd7c6"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "6.2.0",
            "v6.2.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-9226.json",
            "vanir_signatures": [
              {
                "id": "CVE-2017-9226-02f03537",
                "digest": {
                  "length": 4764,
                  "function_hash": "155442029631141137222097712221615512576"
                },
                "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6",
                "target": {
                  "file": "src/regparse.c",
                  "function": "fetch_token_in_cc"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2017-9226-03e1ab44",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "340282246448782130687958519807593876335",
                    "19691577292326266259481888258337573200",
                    "285750249724714625561365284898613084533",
                    "290219382971341702585136164131101210587",
                    "216387815878479387550531275983473066368",
                    "174739561935101457874745057573467750982",
                    "311901103716194130129169947058170981802",
                    "290219382971341702585136164131101210587"
                  ]
                },
                "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6",
                "target": {
                  "file": "src/regparse.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2017-9226-25483da6",
                "digest": {
                  "length": 14321,
                  "function_hash": "70594886040663805677780996931635258295"
                },
                "source": "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6",
                "target": {
                  "file": "src/regparse.c",
                  "function": "fetch_token"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2017-9226-4c23b0ba",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "246829258880076191915156482018696757530",
                    "223947624233669634426607050500944957916",
                    "160761884261585877422819118548410376246",
                    "223713518639165331567966595224563676527"
                  ]
                },
                "source": "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a",
                "target": {
                  "file": "src/regparse.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2017-9226-af653b09",
                "digest": {
                  "length": 1647,
                  "function_hash": "237816653384729961923500547356155140782"
                },
                "source": "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a",
                "target": {
                  "file": "src/regparse.c",
                  "function": "next_state_val"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-24T14:11:23Z"
          }
        },
        {
          "ranges": [
            {
              "repo": "https://github.com/php/php-src",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "de96a08a90e480f1afb655bcfeac8ac28a14228e"
                },
                {
                  "introduced": "60fffd296abce5fc071f3c173c25a2696cf683c6"
                },
                {
                  "fixed": "8a79ce6c8b9d309573993ce332f3951ea1947e2f"
                },
                {
                  "introduced": "0221e9f827632942225586687a33cfd554860d5e"
                },
                {
                  "fixed": "73915a2bd61f21fd809b4d50af9aba950f43e807"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "5.6.31"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "7.0.0"
                      },
                      {
                        "fixed": "7.0.21"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "7.1.0"
                      },
                      {
                        "fixed": "7.1.7"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "php-7.1.7RC1",
            "php-7.0.21RC1",
            "POST_PHP7_NSAPI_REMOVAL",
            "PRE_PHP7_NSAPI_REMOVAL",
            "PRE_PHP7_EREG_MYSQL_REMOVALS",
            "PRE_PHP7_REMOVALS",
            "POST_PHP7_REMOVALS",
            "POST_AST_MERGE",
            "PRE_AST_MERGE",
            "POST_64BIT_BRANCH_MERGE",
            "PRE_64BIT_BRANCH_MERGE",
            "POST_PHPNG_MERGE"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-9226.json",
            "vanir_signatures": [
              {
                "id": "CVE-2017-9226-343f4c1a",
                "digest": {
                  "length": 13872,
                  "function_hash": "233037532068098537505988791132617368492"
                },
                "source": "https://github.com/php/php-src/commit/73915a2bd61f21fd809b4d50af9aba950f43e807",
                "target": {
                  "file": "ext/pcre/pcrelib/pcre_jit_compile.c",
                  "function": "compile_bracket_matchingpath"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2017-9226-cfd9dfdb",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "41612049881914751775057704412356952022",
                    "206133687184829194312361432760839012982",
                    "60469889591596012334583203454317370370",
                    "317056786488417399517652373716894105276"
                  ]
                },
                "source": "https://github.com/php/php-src/commit/73915a2bd61f21fd809b4d50af9aba950f43e807",
                "target": {
                  "file": "ext/pcre/pcrelib/pcre_jit_compile.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-24T14:11:23Z"
          }
        }
      ],
      "modified": "2026-10-24T14:11:23.127842187Z",
      "provider": "osv",
      "references": [
        "https://access.redhat.com/errata/RHSA-2018:1296",
        "https://github.com/kkos/oniguruma/issues/55",
        "https://github.com/kkos/oniguruma/commit/b4bf968ad52afe14e60a2dc8a95d3555c543353a",
        "https://github.com/kkos/oniguruma/commit/f015fbdd95f76438cd86366467bb2b39870dd7c6"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2017-9226",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 443240,
  "published_at": "2017-05-24T15:29:00.277+00:00"
}