6.5medium
Reachable Assertion in rulex
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.89% (higher than 60% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-8v9w-p43c-r885RUSTSEC-2022-0031
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| rulex-rs rulex | < 0.4.3 | CVE List |
| rulex (crates.io) | before 0.4.3, from 0.0.0-0 before 0.4.3 | GitHub Advisory Database, RustSec Advisory Database |
| pomsky-lang pomsky | before 0.4.3 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| NVD | 4.0medium CVSS:2.0 | AV:N/AC:L/Au:S/C:N/I:N/A:P |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
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.
GitHub Advisory Database
Impact
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.
Patches
The crashes are fixed in version 0.4.3. Affected users are advised to update to this version.
Workarounds
You can use catch_unwind to recover from panics.
For more information
If you have any questions or comments about this advisory:
- Open an issue in rulex
- Email me at ludwig.stecher@gmx.de
Credits
Credit for finding these bugs goes to
RustSec Advisory Database
When parsing untrusted rulex expressions, rulex may panic, 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.
The flaw was corrected in commits fac6d58b25 and 330b3534e7 by using
len_utf8() to derive character width in bytes instead of assuming ASCII
encoding of 1 byte per char.
NVD (es)
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
References
| https://github.com/rulex-rs/rulex/security/advisories/GHSA-8v9w-p43c-r885 | mitigation, third-party-advisory, web | |
| https://github.com/rulex-rs/rulex/commit/fac6d58b25c6f9f8c0a6cdc4dec75b37b219f1d6 | patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-31100 | advisory | |
| https://github.com/rulex-rs/rulex | package | |
| https://rustsec.org/advisories/RUSTSEC-2022-0031.html | advisory, web | |
| https://crates.io/crates/rulex | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-31100 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8v9w-p43c-r885 changed 2023-11-08 | CC-BY-4.0 |
| RustSec Advisory Database | RUSTSEC-2022-0031 changed 2026-10-12 | CC0-1.0 |
| NVD | CVE-2022-31100 changed 2026-06-17 | Public domain |