<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>CryptoLib on SecMate Blog</title><link>https://blog.secmate.dev/tags/cryptolib/</link><description>What we find. What we share.</description><generator>Hugo</generator><language>en-us</language><managingEditor>noreply@blog.secmate.dev//blog.secmate.dev/ (SecMate Team)</managingEditor><lastBuildDate>Sat, 25 Jul 2026 09:06:45 +0000</lastBuildDate><atom:link href="https://blog.secmate.dev/tags/cryptolib/index.xml" rel="self" type="application/rss+xml"/><item><title>Vulnerabilities in NASA CryptoLib</title><link>https://blog.secmate.dev/posts/nasa-cryptolib-vulnerabilities/</link><pubDate>Wed, 17 Jun 2026 00:00:00 +0000</pubDate><dc:creator>Maxime Rossi Bellom</dc:creator><dc:creator>Ramtine Tofighi Shirazi</dc:creator><category>Security</category><category>Vulnerability Research</category><category>Space</category><guid>https://blog.secmate.dev/posts/nasa-cryptolib-vulnerabilities/</guid><description>SecMate-reported vulnerabilities in NASA CryptoLib's KMC crypto service client and MariaDB Security Association handling. Affected deployments should upgrade or rebase to v1.4.3 or later.</description><content:encoded><![CDATA[<h1 id="vulnerabilities-in-nasa-cryptolib">Vulnerabilities in NASA CryptoLib</h1>
<p>SecMate reported eight vulnerabilities in <a href="https://github.com/nasa/CryptoLib" rel="noopener noreferrer" target="_blank">NASA CryptoLib</a>
. NASA has published six of them as GitHub Security Advisories covering CryptoLib&rsquo;s KMC crypto service client and MariaDB Security Association handling. Two additional reports remain under review and are not described in this post.</p>
<p>SecMate produced these findings with the automated vulnerability-research engine used across its <a href="https://secmate.dev/disclosures/?utm_source=blog&amp;utm_medium=body&amp;utm_campaign=nasa-cryptolib-vulnerabilities&amp;utm_content=security" rel="noopener noreferrer" target="_blank" data-cta-type="body_disclosures" data-post-slug="nasa-cryptolib-vulnerabilities" data-post-category="security">public disclosures</a>
. The engine is built for sovereign deployment on locally deployable language models and does not require sending code to external services. This analysis used GPT-OSS 20B and GPT-OSS 120B.</p>
<p>NASA published the six public advisories on January 9, 2026. Each advisory lists CryptoLib <code>v1.4.3</code> as the patched version. CryptoLib <code>v1.5.0</code>, released on January 14, 2026, is the latest public GitHub release as of June 17, 2026.</p>
<h2 id="what-is-cryptolib">What Is CryptoLib?</h2>
<p><a href="https://github.com/nasa/CryptoLib" rel="noopener noreferrer" target="_blank">CryptoLib</a>
 is NASA&rsquo;s software-only C library for applying CCSDS Space Data Link Security to space-communication frames. It helps mission software add or verify security fields on commands sent to spacecraft and telemetry returned by spacecraft.</p>
<p>The public advisories concern:</p>
<ul>
<li><strong>KMC crypto service client</strong>: code that sends cryptographic-operation requests to an external KMC service and parses HTTP responses. The issues are in response parsing, response buffering, and cleanup paths.</li>
<li><strong>MariaDB Security Association backend</strong>: code that loads Security Associations from a MariaDB database. A Security Association is the record that tells CryptoLib which keys, algorithms, counters, and frame fields apply to protected traffic. The issue is in decoding hex-encoded database fields into fixed-size buffers.</li>
</ul>
<h2 id="advisory-map">Advisory Map</h2>
<table>
<thead>
<tr>
<th>Advisory</th>
<th>CVE</th>
<th>Area</th>
<th>Issue</th>
<th>Severity</th>
<th>Fixed</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-8w3h-q8jm-3chq" rel="noopener noreferrer" target="_blank">GHSA-8w3h-q8jm-3chq</a>
</td>
<td>CVE-2026-22023</td>
<td>KMC AEAD encrypt</td>
<td>Out-of-bounds read in metadata parsing</td>
<td>High</td>
<td><code>v1.4.3</code></td>
</tr>
<tr>
<td><a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-4g6v-36fv-qcvw" rel="noopener noreferrer" target="_blank">GHSA-4g6v-36fv-qcvw</a>
</td>
<td>CVE-2026-21900</td>
<td>KMC encrypt</td>
<td>Out-of-bounds read in metadata parsing</td>
<td>High</td>
<td><code>v1.4.3</code></td>
</tr>
<tr>
<td><a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-r3wg-g8xv-gxvf" rel="noopener noreferrer" target="_blank">GHSA-r3wg-g8xv-gxvf</a>
</td>
<td>CVE-2026-22024</td>
<td>KMC encrypt</td>
<td>Memory leak on success path</td>
<td>Moderate</td>
<td><code>v1.4.3</code></td>
</tr>
<tr>
<td><a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-h74x-vwwr-mm5g" rel="noopener noreferrer" target="_blank">GHSA-h74x-vwwr-mm5g</a>
</td>
<td>CVE-2026-22025</td>
<td>KMC client</td>
<td>Memory leak on HTTP error path</td>
<td>Moderate</td>
<td><code>v1.4.3</code></td>
</tr>
<tr>
<td><a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-w9cm-q69w-34x7" rel="noopener noreferrer" target="_blank">GHSA-w9cm-q69w-34x7</a>
</td>
<td>CVE-2026-22026</td>
<td>KMC HTTP response handler</td>
<td>Unbounded response buffering</td>
<td>High</td>
<td><code>v1.4.3</code></td>
</tr>
<tr>
<td><a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-3m35-m689-h29x" rel="noopener noreferrer" target="_blank">GHSA-3m35-m689-h29x</a>
</td>
<td>CVE-2026-22027</td>
<td>MariaDB SA backend</td>
<td>Heap buffer overflow in hexstring conversion</td>
<td>Moderate</td>
<td><code>v1.4.3</code></td>
</tr>
</tbody>
</table>
<h2 id="affected-builds-and-use-cases">Affected Builds and Use Cases</h2>
<p>For these six advisories, affected deployments are those running CryptoLib <code>v1.4.2</code> or earlier with the KMC crypto service client or MariaDB Security Association backend in use.</p>
<p>For KMC, the relevant input is the HTTP response returned to CryptoLib by the external KMC crypto service. A malicious, compromised, or untrusted KMC endpoint can trigger the response parsing and response buffering issues. The KMC success-path memory leak can also affect normal repeated use because it does not require a malicious response.</p>
<p>For MariaDB, the relevant input is the SA database content. Oversized hex-encoded fields can overflow destination buffers during Security Association loading if an attacker can alter database rows, compromise provisioning, or feed malformed SA material into the backend.</p>
<h2 id="kmc-client-issues">KMC Client Issues</h2>
<p>Five public advisories affect <code>src/crypto/kmc/cryptography_interface_kmc_crypto_service.template.c</code>.</p>
<p>Two are out-of-bounds reads in metadata parsing in the standard encrypt and AEAD encrypt paths. Both come from resuming <code>strtok</code> parsing by pointer arithmetic on the previous token, which can advance past the end of short or malformed metadata.</p>
<p>Two are memory leaks: one on the encrypt success path, and one on HTTP error paths that return after a non-200 response without releasing prior allocations.</p>
<p>The fifth KMC advisory covers unbounded HTTP response buffering. The libcurl write callback grows the response buffer with <code>realloc</code> without a response-size limit, so a large response can force excessive allocation and terminate or stall the process.</p>
<h2 id="mariadb-sa-backend-issue">MariaDB SA Backend Issue</h2>
<p>One public advisory affects <code>src/sa/mariadb/sa_interface_mariadb.template.c</code>.</p>
<p>CryptoLib&rsquo;s MariaDB backend loads Security Association fields from database rows. Some fields are hex-encoded and decoded into fixed-size buffers in the SA structure. In affected versions, the converter did not check the destination buffer capacity before writing decoded bytes. Oversized hex fields could overrun fields such as IV, ARSN, ABM, or cipher configuration buffers during SA load.</p>
<p>The patched code adds a maximum-length argument to the converter and checks source length against destination capacity before writing.</p>
<h2 id="recommendations">Recommendations</h2>
<p>For these six advisories, NASA lists versions up to and including <code>v1.4.2</code> as affected and <code>v1.4.3</code> as patched. CryptoLib <code>v1.5.0</code> was released shortly after <code>v1.4.3</code>.</p>
<ul>
<li>Update CryptoLib to <code>v1.4.3</code> or later. Prefer the latest public release where compatibility allows.</li>
<li>If CryptoLib is vendored or forked, check that the KMC and MariaDB fixes from <code>v1.4.3</code> are present.</li>
<li>For KMC deployments, review how the KMC endpoint is authenticated, isolated, and monitored.</li>
<li>For MariaDB-backed SA storage, review who can write or provision SA rows.</li>
</ul>
<h2 id="timeline">Timeline</h2>
<div style="position: relative; padding-left: 1.5rem; margin: 1.5rem 0;">
  <div style="position: absolute; left: 0.35rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--color-border);"></div>
  <div style="position: relative; padding-bottom: 1.25rem;">
    <div style="position: absolute; left: -1.15rem; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); border: 2px solid var(--color-bg);"></div>
    <div style="font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 600;">Nov 29, 2025</div>
    <div style="color: var(--color-text);">The SecMate team opens eight NASA CryptoLib reports in GitHub's Security Advisory workflow.</div>
  </div>
  <div style="position: relative; padding-bottom: 1.25rem;">
    <div style="position: absolute; left: -1.15rem; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); border: 2px solid var(--color-bg);"></div>
    <div style="font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 600;">Jan 9, 2026</div>
    <div style="color: var(--color-text);">NASA publishes six GitHub Security Advisories for the KMC and MariaDB findings listed in this post.</div>
  </div>
  <div style="position: relative; padding-bottom: 1.25rem;">
    <div style="position: absolute; left: -1.15rem; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--color-bg);"></div>
    <div style="font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 600;">Jan 9, 2026</div>
    <div style="color: var(--color-text);">CryptoLib <code>v1.4.3</code> is released. The published advisories list <code>v1.4.3</code> as the patched version.</div>
  </div>
  <div style="position: relative; padding-bottom: 1.25rem;">
    <div style="position: absolute; left: -1.15rem; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--color-bg);"></div>
    <div style="font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 600;">Jan 14, 2026</div>
    <div style="color: var(--color-text);">CryptoLib <code>v1.5.0</code> is released.</div>
  </div>
  <div style="position: relative;">
    <div style="position: absolute; left: -1.15rem; top: 0.35rem; width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; border: 2px solid var(--color-bg);"></div>
    <div style="font-size: 0.75rem; color: var(--color-text-secondary); font-weight: 600;">Jun 17, 2026</div>
    <div style="color: var(--color-text);">SecMate publishes this post.</div>
  </div>
</div>
<h2 id="references">References</h2>
<ul>
<li>
<p><a id="ref1"></a>[1] NASA. &ldquo;CryptoLib.&rdquo; <em>GitHub repository</em>. <a href="https://github.com/nasa/CryptoLib" rel="noopener noreferrer" target="_blank">Repository</a>
</p>
</li>
<li>
<p><a id="ref2"></a>[2] NASA. &ldquo;Security Advisories.&rdquo; <em>CryptoLib</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories" rel="noopener noreferrer" target="_blank">Advisories</a>
</p>
</li>
<li>
<p><a id="ref3"></a>[3] NASA. &ldquo;Releases.&rdquo; <em>CryptoLib</em>. <a href="https://github.com/nasa/CryptoLib/releases" rel="noopener noreferrer" target="_blank">Releases</a>
</p>
</li>
<li>
<p><a id="ref4"></a>[4] NASA. &ldquo;Out-of-Bounds Read in KMC AEAD Encrypt Metadata Parsing via Flawed strtok Pattern.&rdquo; <em>GitHub Security Advisory</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-8w3h-q8jm-3chq" rel="noopener noreferrer" target="_blank">GHSA-8w3h-q8jm-3chq</a>
</p>
</li>
<li>
<p><a id="ref5"></a>[5] NASA. &ldquo;Out-of-Bounds Read in KMC Encrypt Metadata Parsing via Flawed strtok Pattern.&rdquo; <em>GitHub Security Advisory</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-4g6v-36fv-qcvw" rel="noopener noreferrer" target="_blank">GHSA-4g6v-36fv-qcvw</a>
</p>
</li>
<li>
<p><a id="ref6"></a>[6] NASA. &ldquo;Memory Leak in KMC Encrypt Function Leads to Resource Exhaustion.&rdquo; <em>GitHub Security Advisory</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-r3wg-g8xv-gxvf" rel="noopener noreferrer" target="_blank">GHSA-r3wg-g8xv-gxvf</a>
</p>
</li>
<li>
<p><a id="ref7"></a>[7] NASA. &ldquo;Memory Leak on HTTP Error Response in KMC Client.&rdquo; <em>GitHub Security Advisory</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-h74x-vwwr-mm5g" rel="noopener noreferrer" target="_blank">GHSA-h74x-vwwr-mm5g</a>
</p>
</li>
<li>
<p><a id="ref8"></a>[8] NASA. &ldquo;Unbounded Memory Allocation in KMC HTTP Response Handler Allows Resource Exhaustion.&rdquo; <em>GitHub Security Advisory</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-w9cm-q69w-34x7" rel="noopener noreferrer" target="_blank">GHSA-w9cm-q69w-34x7</a>
</p>
</li>
<li>
<p><a id="ref9"></a>[9] NASA. &ldquo;Heap Buffer Overflow in MariaDB SA Hexstring Conversion.&rdquo; <em>GitHub Security Advisory</em>. <a href="https://github.com/nasa/CryptoLib/security/advisories/GHSA-3m35-m689-h29x" rel="noopener noreferrer" target="_blank">GHSA-3m35-m689-h29x</a>
</p>
</li>
<li>
<p><a id="ref10"></a>[10] NASA. &ldquo;KMC crypto service interface.&rdquo; <em>CryptoLib source</em>. <a href="https://github.com/nasa/CryptoLib/blob/main/src/crypto/kmc/cryptography_interface_kmc_crypto_service.template.c" rel="noopener noreferrer" target="_blank">Source</a>
</p>
</li>
<li>
<p><a id="ref11"></a>[11] NASA. &ldquo;MariaDB SA interface.&rdquo; <em>CryptoLib source</em>. <a href="https://github.com/nasa/CryptoLib/blob/main/src/sa/mariadb/sa_interface_mariadb.template.c" rel="noopener noreferrer" target="_blank">Source</a>
</p>
</li>
</ul>
<hr>
<p><em>The SecMate Team</em></p>
]]></content:encoded><media:content url="https://blog.secmate.dev/images/og_image.png" medium="image"/></item></channel></rss>