Panic due to improper UTF-8 indexing
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.
- Products
- rulex
- Affected versions
- Not specified
- Fixed versions
- 0.4.3
- CVEs
- CVE-2022-31100
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 08:42 UTC · Revision 1
Source evidence
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.
osv:RUSTSEC-2022-0031
rulex
Fixed versions: 0.4.3
Complete source record
{
"id": "b77d3658bb6ffe8a2325ca29f9493491838abc9b797ed4f740b9d31b5c0a9f4f",
"url": "https://osv.dev/vulnerability/RUSTSEC-2022-0031",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Panic due to improper UTF-8 indexing",
"summary": "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.",
"evidence": "osv:RUSTSEC-2022-0031",
"products": [
{
"name": {
"value": "rulex",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.4.3",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "RUSTSEC-2022-0031",
"aliases": [
"CVE-2022-31100",
"GHSA-8v9w-p43c-r885",
"RUSTSEC-2022-0031"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0.0.0-0"
},
{
"fixed": "0.4.3"
}
]
}
],
"package": {
"name": "rulex",
"purl": "pkg:cargo/rulex",
"ecosystem": "crates.io"
},
"database_specific": {
"cvss": null,
"source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2022-0031.json",
"categories": [
"denial-of-service"
],
"informational": null
},
"ecosystem_specific": {
"affects": {
"os": [],
"arch": [],
"functions": []
},
"affected_functions": null
}
}
],
"modified": "2026-10-12T18:00:05.115301404Z",
"provider": "osv",
"references": [
"https://crates.io/crates/rulex",
"https://rustsec.org/advisories/RUSTSEC-2022-0031.html",
"https://github.com/rulex-rs/rulex/commit/fac6d58b25c6f9f8c0a6cdc4dec75b37b219f1d6"
],
"provider_metadata": {
"license": "CC0-1.0"
}
},
"related_cves": [
{
"value": "CVE-2022-31100",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 306348,
"published_at": "2022-05-21T12:00:00+00:00"
}