Vulnerability MediumRUSTSEC-2022-0031 · rulex
RUSTSEC-2022-0031: Panic due to improper UTF-8 indexing
Short answerA security vulnerability in the rulex crate: Panic due to improper UTF-8 indexing. GitHub rates it Medium. Fixed in 0.4.3: update to a fixed version.
| Crate | rulex |
|---|---|
| Type | Vulnerability (denial-of-service) |
| Affected versions | Before 0.4.3. |
| Fixed in | 0.4.3 |
| Severity | Medium (GitHub rating) |
| Published | 2022-05-21 |
| Last changed | 2026-10-12 |
| Also known as | CVE-2022-31100, GHSA-8v9w-p43c-r885 |
What to do
- See which version you have:
cargo tree -i rulex(it also shows which of your dependencies pulls it in). - Update within your version requirement:
cargo update -p rulex. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for examplerulex = "0.4.3") or update the dependency that pulls it in. - Check again with
cargo audit, or paste your Cargo.lock into our Cargo.toml checker.
Details from the advisory
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.
References
- Package: crates.io/crates/rulex
- Advisory: rustsec.org/advisories/RUSTSEC-2022-0031.html
- Web: github.com/rulex-rs/rulex/commit/fac6d58b25c6f9f8c0a6cdc4dec75b37b219f1d6
From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.
Other advisories for rulex
Up next
Same craterulex: security historyEvery advisory for this crate, and whether it is safe to use today.Read it next →Did this answer your question?