Invalid Slice Split Results in Server Panic
Description
Faulty parsing in odoh-rs causes server panic on crafted encrypted queries, leading to denial of service.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Faulty parsing in odoh-rs causes server panic on crafted encrypted queries, leading to denial of service.
Vulnerability
Overview
CVE-2023-3766 is a denial-of-service (DoS) vulnerability in the odoh-rs Rust crate, which implements RFC 9230 Oblivious DNS over HTTPS (ODoH) [3]. The bug resides in the decrypt_query function, which fails to validate that the encrypted message length is sufficient before splitting it to extract the encapsulated key [4]. When a specially crafted encrypted query is sent, the split_at call uses a slice index larger than the input length, causing a panic and immediate crash of the server process [1][2].
Exploitation
Conditions
An attacker with network access to an ODoH server using a vulnerable version of odoh-rs (prior to 1.0.2) can trigger the crash without any authentication or user interaction [2]. The attack complexity is rated high because the attacker must craft a malformed encrypted message that passes basic parsing but fails the unchecked split_at operation [2]. The vulnerability does not require any special privileges and can be exploited remotely.
Impact
Successful exploitation results in abrupt termination of the affected ODoH server, rendering the service temporarily unavailable. The vulnerability only affects availability; confidentiality and integrity remain unaffected [2]. This can be especially impactful for DNS resolvers relying on ODoH for privacy, as it allows an attacker to disrupt anonymous query resolution.
Mitigation
The fix was implemented in commit c1bc4ed [4] and the vulnerability is patched in odoh-rs version 1.0.2 and later [2]. Users are advised to update to the latest version. The RustSec advisory (RUSTSEC-2023-0095) provides full details and references the GitHub security advisory GHSA-gpcv-p28p-fv2p [2]. No workarounds are documented; updating the crate is the recommended course of action.
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
odoh-rscrates.io | < 1.0.2 | 1.0.2 |
Affected products
2- Range: 0
Patches
1c1bc4ed71dccFix a panic triggered by malformed encrypted message
1 file changed · +20 −0
src/protocol.rs+20 −0 modified@@ -597,6 +597,9 @@ pub fn decrypt_query( let server_sk = key_pair.private(); let key_size = <Kem as KemTrait>::PublicKey::size(); + if key_size > query.encrypted_msg.len() { + return Err(Error::InvalidInputLength); + } let (enc, ct) = query.encrypted_msg.split_at(key_size); let encapped_key = <Kem as KemTrait>::EncappedKey::from_bytes(enc)?; @@ -887,4 +890,21 @@ mod tests { query.padding = vec![1, 2].into(); assert_eq!(Error::InvalidPadding, compose(&query).unwrap_err()); } + + #[test] + fn parse_encapsulated_key() { + // Use a seed to initialize a RNG. *Note* you should rely on some + // random source. + let mut rng = StdRng::from_seed([0; 32]); + let key_pair = ObliviousDoHKeyPair::new(&mut rng); + + // Construct a malformed payload. Parsing the encrypted message should fail because it is + // too short to include the encapsulated key. + let query_enc = ObliviousDoHMessage { + msg_type: ObliviousDoHMessageType::Query, + key_id: key_pair.public().identifier().unwrap().to_vec().into(), + encrypted_msg: b"too short".to_vec().into(), + }; + assert!(decrypt_query(&query_enc, &key_pair).is_err()); + } }
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/cloudflare/odoh-rs/pull/28ghsapatchWEB
- github.com/advisories/GHSA-gpcv-p28p-fv2pghsaADVISORY
- github.com/cloudflare/odoh-rs/security/advisories/GHSA-gpcv-p28p-fv2pghsavendor-advisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2023-3766ghsaADVISORY
- github.com/cloudflare/odoh-rs/commit/c1bc4ed71dcc9842b7dc1ea26f278f105074bbaaghsaWEB
- rustsec.org/advisories/RUSTSEC-2023-0095.htmlghsaWEB
News mentions
0No linked articles in our index yet.