<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Rustls-Webpki — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/rustls-webpki/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 09 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/rustls-webpki/feed.xml" rel="self" type="application/rss+xml"/><item><title>rustls-webpki Denial-of-Service Vulnerability via Malformed CRL BIT STRING</title><link>https://feed.craftedsignal.io/briefs/2024-01-rustls-webpki-dos/</link><pubDate>Tue, 09 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-rustls-webpki-dos/</guid><description>A denial-of-service vulnerability exists in rustls-webpki versions prior to 0.103.13 and between 0.104.0-alpha.1 and 0.104.0-alpha.7 due to a panic in `bit_string_flags()` when processing a malformed CRL BIT STRING, triggered when CRL checking is enabled and an attacker provides a crafted CRL.</description><content:encoded><![CDATA[<p>A denial-of-service vulnerability has been identified in the rustls-webpki crate, specifically affecting versions prior to 0.103.13 and versions between 0.104.0-alpha.1 and 0.104.0-alpha.7. The vulnerability stems from a panic within the <code>bit_string_flags()</code> function located in <code>src/der.rs</code>. This panic occurs when the function processes a malformed Certificate Revocation List (CRL) containing a BIT STRING with a content of exactly <code>[0x00]</code>. The issue is triggered via the <code>issuingDistributionPoint</code> CRL extension when CRL revocation checking is explicitly enabled through <code>RevocationOptions</code> and the application loads CRL data from a source controlled by an attacker. This vulnerability allows a remote attacker to cause a denial of service in applications that rely on rustls-webpki for certificate validation.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker obtains a certificate from a Certificate Authority (CA) that permits custom Certificate Distribution Point (CDP) URLs.</li>
<li>Attacker sets the CDP of the certificate to point to a server they control (e.g., <code>cdp</code>).</li>
<li>The attacker crafts a malicious CRL with a BIT STRING in the <code>issuingDistributionPoint</code> extension containing the byte sequence <code>0x00</code>, triggering the vulnerability in <code>bit_string_flags()</code>. The CRL must be DER encoded and contain the following ASN.1 structure: <code>a0 10 30 0e 30 0c 06 03 55 1d 1c 04 05 30 03 83 01 00</code></li>
<li>The attacker hosts the crafted CRL on the server specified in the CDP.</li>
<li>A vulnerable mTLS server configured to use CRL checking receives a connection request from a client presenting the attacker&rsquo;s certificate.</li>
<li>The mTLS server fetches the CRL from the attacker-controlled CDP server during the TLS handshake.</li>
<li>The <code>BorrowedCertRevocationList::from_der()</code> function parses the CRL, leading to the execution of <code>bit_string_flags()</code> on the malformed BIT STRING.</li>
<li>The <code>bit_string_flags()</code> function panics due to an index-out-of-bounds error, resulting in a denial-of-service condition on the mTLS server.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability leads to a denial-of-service condition. Affected applications that perform mTLS, particularly servers, become unavailable when processing connections from clients presenting certificates with malicious CRL distribution points. This can disrupt services and impact availability. The severity is high because an attacker can trigger the vulnerability remotely without authentication.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to rustls-webpki version 0.103.13 or 0.104.0-alpha.7 or later to patch the vulnerability.</li>
<li>Deploy the Sigma rule <code>Detect-Malformed-CRL-Bit-String</code> to identify attempts to exploit this vulnerability by monitoring for specific byte sequences in CRL data.</li>
<li>Implement strict validation and sanitization of CRL data before processing it with <code>rustls-webpki</code>, especially when fetching CRLs from untrusted sources.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>denial-of-service</category><category>rustls-webpki</category><category>crl</category></item></channel></rss>