{"id":"CVE-2022-31100","aliases":["CVE-2022-31100","GHSA-8v9w-p43c-r885","RUSTSEC-2022-0031"],"related":[],"kind":"vulnerability","state":"published","title":"Reachable Assertion in rulex","summary":"rulex is a new, portable, regular expression language. When parsing untrusted rulex expressions, rulex may crash, possibly enabling a Denial of Service attack. This happens when the expression contains a multi-byte UTF-8 code point in a string literal or after a backslash, because rulex tries to slice into the code point and panics as a result. This is a security concern for you, if your service parses untrusted rulex expressions (expressions provided by an untrusted user), and your service becomes unavailable when the thread running rulex panics. The crashes are fixed in version **0.4.3**. Affected users are advised to update to this version. The only known workaround for this issue is to assume that regular expression parsing will panic and to add logic to catch panics.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"rulex is a new, portable, regular expression language. When parsing untrusted rulex expressions, rulex may crash, possibly enabling a Denial of Service attack. This happens when the expression contains a multi-byte UTF-8 code point in a string literal or after a backslash, because rulex tries to slice into the code point and panics as a result. This is a security concern for you, if your service parses untrusted rulex expressions (expressions provided by an untrusted user), and your service becomes unavailable when the thread running rulex panics. The crashes are fixed in version **0.4.3**. Affected users are advised to update to this version. The only known workaround for this issue is to assume that regular expression parsing will panic and to add logic to catch panics.","source":"cvelist"},{"lang":"en","text":"### Impact\nWhen parsing untrusted rulex expressions, rulex may crash, possibly enabling a Denial of Service attack. This happens when the expression contains a multi-byte UTF-8 code point in a string literal or after a backslash, because rulex tries to slice into the code point and panics as a result.\n\nThis is a security concern for you, if\n- your service parses untrusted rulex expressions (expressions provided by an untrusted user), and\n- your service becomes unavailable when the thread running rulex panics.\n\n### Patches\nThe crashes are fixed in version **0.4.3**. Affected users are advised to update to this version.\n\n### Workarounds\nYou can use `catch_unwind` to recover from panics.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [rulex](https://github.com/rulex-rs/rulex/issues)\n* Email me at [ludwig.stecher@gmx.de](mailto:ludwig.stecher@gmx.de)\n\n### Credits\n\nCredit for finding these bugs goes to\n\n- [cargo fuzz](https://github.com/rust-fuzz/cargo-fuzz) and [afl.rs](https://github.com/rust-fuzz/afl.rs)\n- [evanrichter](https://github.com/evanrichter)\n- [ForAllSecure Mayhem](https://forallsecure.com/)","format":"markdown","source":"ghsa"},{"lang":"en","text":"When parsing untrusted rulex expressions, rulex may panic, possibly enabling\na Denial of Service attack. This happens when the expression contains a multi-\nbyte UTF-8 code point in a string literal or after a backslash, because rulex\ntries to slice into the code point and panics as a result.\n\nThe flaw was corrected in commits `fac6d58b25` and `330b3534e7` by using\n`len_utf8()` to derive character width in bytes instead of assuming ASCII\nencoding of 1 byte per char.","format":"markdown","source":"rustsec"},{"lang":"es","text":"rulex es un nuevo lenguaje de expresión regular portátil. Cuando son analizadas expresiones de rulex que no son confiables, rulex puede bloquearse, permitiendo posiblemente un ataque de Denegación de Servicio. Esto ocurre cuando la expresión contiene un punto de código UTF-8 multibyte en una cadena literal o después de una barra invertida, porque rulex intenta cortar el punto de código y entra en pánico como resultado. Esto es un problema de seguridad para usted, si su servicio analiza expresiones de rulex que no son confiables (expresiones proporcionadas por un usuario que no es confiable), y su servicio deja de estar disponible cuando el hilo que ejecuta rulex entra en pánico. Los bloqueos han sido corregidos en versión **0.4.3**. Es recomendado a usuarios afectados actualizar a esta versión. La única mitigación conocida para este problema es asumir que el análisis de expresiones regulares entrará en pánico y añadir lógica para detectar los pánicos","source":"nvd"}],"published":"2022-05-21T12:00:00.000Z","modified":"2026-10-12T18:00:05.115Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:S/C:N/I:N/A:P","score":4,"rating":"MEDIUM"}],"cwes":["CWE-617"],"affected":[{"ranges":[{"version":"< 0.4.3","status":"affected"}],"vendor":"rulex-rs","product":"rulex","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.4.3"}],"ecosystem":"crates.io","package":"rulex","purl":"pkg:cargo/rulex","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.4.3"}],"ecosystem":"crates.io","package":"rulex","purl":"pkg:cargo/rulex","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.4.3"}],"vendor":"pomsky-lang","product":"pomsky","cpe":"cpe:2.3:a:pomsky-lang:pomsky:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://github.com/rulex-rs/rulex/security/advisories/GHSA-8v9w-p43c-r885","tags":["mitigation","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/rulex-rs/rulex/commit/fac6d58b25c6f9f8c0a6cdc4dec75b37b219f1d6","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","rustsec","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31100","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/rulex-rs/rulex","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2022-0031.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/rulex","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-04-23T14:04:18.379Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-31100","url":"https://www.cve.org/CVERecord?id=CVE-2022-31100","licence":"CVE Terms of Use","modified":"2025-04-23T18:06:26.973Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8v9w-p43c-r885","url":"https://github.com/advisories/GHSA-8v9w-p43c-r885","licence":"CC-BY-4.0","modified":"2023-11-08T04:09:26.020Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2022-0031","url":"https://rustsec.org/advisories/RUSTSEC-2022-0031.html","licence":"CC0-1.0","modified":"2026-10-12T18:00:05.115Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-31100","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31100","licence":"Public domain","modified":"2026-06-17T04:44:47.843Z"}],"updatedAt":"2026-11-25T22:58:12.601Z","epss":{"score":0.00892,"percentile":0.60491,"date":"2026-12-01T12:00:22.000Z"}}