<?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>Gocsaf | FirewallSync</title><link>https://firewallsync.com/tags/gocsaf/</link><description>Practical cybersecurity writing for engineering teams that ship fast.</description><language>en-us</language><image><url>https://firewallsync.com/icon-512.png</url><title>FirewallSync</title><link>https://firewallsync.com/</link></image><lastBuildDate>Sat, 21 Nov 2026 04:30:00 +0000</lastBuildDate><atom:link href="https://firewallsync.com/tags/gocsaf/index.xml" rel="self" type="application/rss+xml"/><item><title>CSAF VEX Remediations and Threats: What Trivy Gets Wrong</title><link>https://firewallsync.com/posts/csaf-vex-remediations-threats-category-product-ids-trivy/</link><guid>https://firewallsync.com/posts/csaf-vex-remediations-threats-category-product-ids-trivy/</guid><pubDate>Sat, 21 Nov 2026 04:30:00 +0000</pubDate><dc:creator>Craig Leslie</dc:creator><category>AppSec &amp; APIs</category><description>CSAF 2.0 puts the fix, the workaround, the restart cost and the reason a product is not affected in two arrays: remediations and threats. Here is what each field means, how to resolve them per product, and three places where Trivy v0.76.2 and gocsaf v3.7.0 diverge from the spec.</description><enclosure url="https://firewallsync.com/posts/csaf-vex-remediations-threats-category-product-ids-trivy/cover_hu12283328291714519248.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/csaf-vex-remediations-threats-category-product-ids-trivy/cover_hu12283328291714519248.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/csaf-vex-remediations-threats-category-product-ids-trivy/cover_hu12283328291714519248.jpg" alt="A set of chrome combination wrenches in a black rack, lying on rusty metal in a sunlit workshop" width="1200" height="630"></p><p><strong>Short answer:</strong> In a CSAF 2.0 VEX document, <code>product_status</code> says <em>whether</em> each product is affected. Two arrays under each vulnerability say <em>what to do about it</em>: <strong><code>remediations</code></strong> (category, details, date, URL, entitlements, restart cost) and <strong><code>threats</code></strong> (impact, exploit status, target set). Both apply to products only through their own <code>product_ids</code> or <code>group_ids</code>, so you have to resolve them per product. Trivy v0.76.2 does not: it ignores remediations, takes the first <code>impact</code> threat for every product it filters, and, through the gocsaf v3.7.0 library, fails to decode any file that uses <code>product_groups</code>.</p>
<p>If you consume CSAF VEX from a vendor such as Red Hat or from an internal team, these two arrays are where the patch-or-wait decision lives. This article reads the <a href="https://github.com/oasis-tcs/csaf/blob/master/csaf_2.0/prose/csaf-v2-editor-draft.md">CSAF 2.0 specification</a> and <a href="https://github.com/oasis-tcs/csaf/blob/master/csaf_2.0/json_schema/csaf_json_schema.json">JSON schema</a>, <a href="https://github.com/aquasecurity/trivy/blob/v0.76.2/pkg/vex/csaf.go">Trivy v0.76.2</a> and <a href="https://github.com/gocsaf/csaf/blob/v3.7.0/csaf/advisory.go">gocsaf v3.7.0</a>, the version pinned in Trivy&rsquo;s go.mod. For resolving product IDs to purls first, see <a href="/posts/csaf-vex-product-tree-product-status-purl-sbom-matching/">CSAF VEX product_tree</a>; this piece picks up where that one stops.</p>
<h2 id="remediations-the-fields">Remediations: the fields</h2>
<p>Every remediation item has two mandatory properties, <code>category</code> and <code>details</code>. The spec adds: &ldquo;At least one of the optional elements Group IDs (<code>group_ids</code>) and Product IDs (<code>product_ids</code>) MUST be present to state for which products or product groups this remediation is applicable.&rdquo; A remediation with neither fails mandatory test 6.1.29, <em>Remediation without Product Reference</em>.</p>
<table>
  <thead>
      <tr>
          <th>Field</th>
          <th>Type</th>
          <th>What it tells you</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>category</code></td>
          <td>enum (required)</td>
          <td>What kind of action this is (table below)</td>
      </tr>
      <tr>
          <td><code>details</code></td>
          <td>string (required)</td>
          <td>&ldquo;a thorough human-readable discussion of the remediation&rdquo;</td>
      </tr>
      <tr>
          <td><code>product_ids</code> / <code>group_ids</code></td>
          <td>ID lists</td>
          <td>Which products the remediation covers; at least one must be present</td>
      </tr>
      <tr>
          <td><code>date</code></td>
          <td>date-time</td>
          <td>&ldquo;the date from which the remediation is available&rdquo;</td>
      </tr>
      <tr>
          <td><code>url</code></td>
          <td>URI</td>
          <td>&ldquo;the URL where to obtain the remediation&rdquo;</td>
      </tr>
      <tr>
          <td><code>entitlements</code></td>
          <td>string list</td>
          <td>&ldquo;vendor-defined constraints for obtaining fixed software or hardware&rdquo;, such as a support contract</td>
      </tr>
      <tr>
          <td><code>restart_required</code></td>
          <td>object</td>
          <td><code>category</code> (required) and <code>details</code>: what must restart for the remediation to take effect</td>
      </tr>
  </tbody>
</table>
<h3 id="the-five-remediation-categories">The five remediation categories</h3>
<table>
  <thead>
      <tr>
          <th><code>category</code></th>
          <th>Spec meaning (CSAF 2.0, 3.2.3.12.1)</th>
          <th>Ticket action</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>vendor_fix</code></td>
          <td>&ldquo;an official fix that is issued by the original author of the affected product. Unless otherwise noted, it is assumed that this fix fully resolves the vulnerability.&rdquo;</td>
          <td>Schedule the upgrade; use <code>url</code> and <code>date</code></td>
      </tr>
      <tr>
          <td><code>workaround</code></td>
          <td>a configuration or deployment scenario &ldquo;that can be used to avoid exposure to the vulnerability&rdquo;</td>
          <td>Apply now, keep the ticket open for the fix</td>
      </tr>
      <tr>
          <td><code>mitigation</code></td>
          <td>&ldquo;helps to reduce the risk of the vulnerability but that does not resolve the vulnerability on the affected product&rdquo;</td>
          <td>Compensating control; the finding stays open</td>
      </tr>
      <tr>
          <td><code>none_available</code></td>
          <td>&ldquo;there is currently no fix or other remediation available&rdquo;</td>
          <td>Track; the spec suggests the issuer include an expected date</td>
      </tr>
      <tr>
          <td><code>no_fix_planned</code></td>
          <td>no fix &ldquo;and it is not planned to provide one at any time&rdquo;, often for end-of-life products</td>
          <td>Replace, isolate or accept the risk</td>
      </tr>
  </tbody>
</table>
<p>Two consistency rules matter for parsers. <code>vendor_fix</code> &ldquo;contradicts with the categories <code>none_available</code> and <code>no_fix_planned</code> for the same product&rdquo;, so a document should never carry both for one product. And the difference between <code>workaround</code> and <code>mitigation</code> is the difference between &ldquo;avoids exposure&rdquo; and &ldquo;reduces risk&rdquo;: do not close a finding on a mitigation.</p>
<h3 id="restart_required">restart_required</h3>
<p>This is the field operations teams want and scanners rarely show. CSAF 2.0 defines nine values: <code>none</code>, <code>vulnerable_component</code>, <code>service</code>, <code>parent</code>, <code>dependencies</code>, <code>connected</code>, <code>machine</code>, <code>zone</code> and <code>system</code>. They escalate from &ldquo;No restart required&rdquo; through <code>machine</code> (&ldquo;This is the value which SHOULD be used if an OS needs to be restarted&rdquo;) to <code>system</code>, a restart of &ldquo;the whole system&rdquo;, which &ldquo;MAY include multiple security zones&rdquo;. If you build change tickets automatically, map <code>machine</code>, <code>zone</code> and <code>system</code> to a maintenance window rather than a rolling restart.</p>
<h2 id="threats-impact-exploit_status-target_set">Threats: impact, exploit_status, target_set</h2>
<p>Threat items also need <code>category</code> and <code>details</code>, take optional <code>date</code>, <code>product_ids</code> and <code>group_ids</code>, and describe information that &ldquo;can change as the vulnerability ages&rdquo;. There are three categories:</p>
<ul>
<li><strong><code>impact</code></strong>: an assessment of the impact if the vulnerability is exploited &ldquo;or a description why it cannot be exploited&rdquo;.</li>
<li><strong><code>exploit_status</code></strong>: &ldquo;the degree to which an exploit for the vulnerability is known&rdquo;, which the spec says can mirror CVSS exploitability or use a contextual status such as &ldquo;Weaponized&rdquo;.</li>
<li><strong><code>target_set</code></strong>: &ldquo;the currently known victim population&rdquo;, for example platform, product type, user segment or geography.</li>
</ul>
<p>For threats, <code>date</code> is &ldquo;the date when the assessment was done or the threat appeared&rdquo;, so an old <code>exploit_status</code> is a reason to check <a href="/posts/cisa-kev-json-feed-what-each-field-means-and-how-to-match-it-against-a-scanner-export/">KEV</a> and EPSS rather than trust it.</p>
<h3 id="what-the-vex-profile-requires">What the VEX profile requires</h3>
<p>The <code>csaf_vex</code> profile (section 4.5) ties both arrays to product status:</p>
<ul>
<li>Every product in <code>known_not_affected</code> needs an impact statement, &ldquo;as machine readable flag in <code>/vulnerabilities[]/flags</code> or as human readable justification in <code>/vulnerabilities[]/threats</code>&rdquo;. For a threat, &ldquo;the <code>category</code> value for such a statement MUST be <code>impact</code>&rdquo;.</li>
<li>Every product in <code>known_affected</code> needs &ldquo;additional product specific information&rdquo; in <code>remediations</code> &ldquo;as an action statement&rdquo;. <code>no_fix_planned</code> and <code>none_available</code> are allowed.</li>
<li>Group IDs may be used, but &ldquo;it MUST be ensured that for each Product ID the required information according to its product status as stated in the two points above is available&rdquo;.</li>
</ul>
<p>That last sentence is the important one: the requirement is per product. A vulnerability can, and in multi-product advisories usually does, carry several impact threats with different <code>product_ids</code>.</p>
<h2 id="resolving-remediations-and-threats-per-product">Resolving remediations and threats per product</h2>
<p>The file below is an illustrative CSAF 2.0 VEX document: one CVE (a placeholder ID, CVE-2099-0001), two container images, one product group. <code>example-worker</code> is affected and has a vendor fix; <code>example-api</code> is not affected, and its impact threat says why. It validates with zero errors against the CSAF 2.0 JSON schema (Python <code>jsonschema</code>, with the FIRST CVSS schemas the CSAF repository ships under <code>csaf_2.0/referenced_schema</code>).</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-json" data-lang="json"><span style="display:flex;"><span><span style="color:#e6db74">&#34;product_groups&#34;</span><span style="color:#960050;background-color:#1e0010">:</span> [
</span></span><span style="display:flex;"><span>  {<span style="color:#f92672">&#34;group_id&#34;</span>: <span style="color:#e6db74">&#34;CSAFGID-ALL&#34;</span>, <span style="color:#f92672">&#34;product_ids&#34;</span>: [<span style="color:#e6db74">&#34;CSAFPID-API&#34;</span>, <span style="color:#e6db74">&#34;CSAFPID-WORKER&#34;</span>]}
</span></span><span style="display:flex;"><span>]<span style="color:#960050;background-color:#1e0010">,</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">...</span>
</span></span><span style="display:flex;"><span><span style="color:#e6db74">&#34;product_status&#34;</span><span style="color:#960050;background-color:#1e0010">:</span> {
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;known_affected&#34;</span>: [<span style="color:#e6db74">&#34;CSAFPID-WORKER&#34;</span>],
</span></span><span style="display:flex;"><span>  <span style="color:#f92672">&#34;known_not_affected&#34;</span>: [<span style="color:#e6db74">&#34;CSAFPID-API&#34;</span>]
</span></span><span style="display:flex;"><span>}<span style="color:#960050;background-color:#1e0010">,</span>
</span></span><span style="display:flex;"><span><span style="color:#e6db74">&#34;threats&#34;</span><span style="color:#960050;background-color:#1e0010">:</span> [
</span></span><span style="display:flex;"><span>  {<span style="color:#f92672">&#34;category&#34;</span>: <span style="color:#e6db74">&#34;impact&#34;</span>, <span style="color:#f92672">&#34;product_ids&#34;</span>: [<span style="color:#e6db74">&#34;CSAFPID-WORKER&#34;</span>],
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;details&#34;</span>: <span style="color:#e6db74">&#34;example-worker parses uploaded XML with libexample; a crafted file can crash the worker.&#34;</span>},
</span></span><span style="display:flex;"><span>  {<span style="color:#f92672">&#34;category&#34;</span>: <span style="color:#e6db74">&#34;impact&#34;</span>, <span style="color:#f92672">&#34;product_ids&#34;</span>: [<span style="color:#e6db74">&#34;CSAFPID-API&#34;</span>],
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;details&#34;</span>: <span style="color:#e6db74">&#34;example-api ships libexample but never calls its XML parser.&#34;</span>},
</span></span><span style="display:flex;"><span>  {<span style="color:#f92672">&#34;category&#34;</span>: <span style="color:#e6db74">&#34;exploit_status&#34;</span>, <span style="color:#f92672">&#34;group_ids&#34;</span>: [<span style="color:#e6db74">&#34;CSAFGID-ALL&#34;</span>],
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;details&#34;</span>: <span style="color:#e6db74">&#34;No public exploit known to Example Corp.&#34;</span>, <span style="color:#f92672">&#34;date&#34;</span>: <span style="color:#e6db74">&#34;2026-11-21T00:00:00Z&#34;</span>}
</span></span><span style="display:flex;"><span>]<span style="color:#960050;background-color:#1e0010">,</span>
</span></span><span style="display:flex;"><span><span style="color:#e6db74">&#34;remediations&#34;</span><span style="color:#960050;background-color:#1e0010">:</span> [
</span></span><span style="display:flex;"><span>  {<span style="color:#f92672">&#34;category&#34;</span>: <span style="color:#e6db74">&#34;vendor_fix&#34;</span>, <span style="color:#f92672">&#34;product_ids&#34;</span>: [<span style="color:#e6db74">&#34;CSAFPID-WORKER&#34;</span>],
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;details&#34;</span>: <span style="color:#e6db74">&#34;Upgrade to example-worker 1.8.1.&#34;</span>, <span style="color:#f92672">&#34;date&#34;</span>: <span style="color:#e6db74">&#34;2026-11-21T00:00:00Z&#34;</span>,
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;url&#34;</span>: <span style="color:#e6db74">&#34;https://example.com/releases/worker-1.8.1&#34;</span>,
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;restart_required&#34;</span>: {<span style="color:#f92672">&#34;category&#34;</span>: <span style="color:#e6db74">&#34;service&#34;</span>, <span style="color:#f92672">&#34;details&#34;</span>: <span style="color:#e6db74">&#34;Restart the worker deployment.&#34;</span>}},
</span></span><span style="display:flex;"><span>  {<span style="color:#f92672">&#34;category&#34;</span>: <span style="color:#e6db74">&#34;mitigation&#34;</span>, <span style="color:#f92672">&#34;group_ids&#34;</span>: [<span style="color:#e6db74">&#34;CSAFGID-ALL&#34;</span>],
</span></span><span style="display:flex;"><span>   <span style="color:#f92672">&#34;details&#34;</span>: <span style="color:#e6db74">&#34;Reject XML uploads at the gateway until upgraded.&#34;</span>}
</span></span><span style="display:flex;"><span>]
</span></span></code></pre></div><p>This Python 3 script (standard library only) expands <code>group_ids</code> and prints, for each product and status, the threats and remediations that actually apply to it:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">import</span> json<span style="color:#f92672">,</span> sys
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">expand</span>(item, groups):
</span></span><span style="display:flex;"><span>    ids <span style="color:#f92672">=</span> set(item<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;product_ids&#34;</span>, []))
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">for</span> g <span style="color:#f92672">in</span> item<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;group_ids&#34;</span>, []):
</span></span><span style="display:flex;"><span>        ids <span style="color:#f92672">|=</span> set(groups<span style="color:#f92672">.</span>get(g, []))
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> ids
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>doc <span style="color:#f92672">=</span> json<span style="color:#f92672">.</span>load(open(sys<span style="color:#f92672">.</span>argv[<span style="color:#ae81ff">1</span>]))
</span></span><span style="display:flex;"><span>groups <span style="color:#f92672">=</span> {g[<span style="color:#e6db74">&#34;group_id&#34;</span>]: g[<span style="color:#e6db74">&#34;product_ids&#34;</span>]
</span></span><span style="display:flex;"><span>          <span style="color:#66d9ef">for</span> g <span style="color:#f92672">in</span> doc[<span style="color:#e6db74">&#34;product_tree&#34;</span>]<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;product_groups&#34;</span>, [])}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">for</span> vuln <span style="color:#f92672">in</span> doc[<span style="color:#e6db74">&#34;vulnerabilities&#34;</span>]:
</span></span><span style="display:flex;"><span>    status <span style="color:#f92672">=</span> vuln<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;product_status&#34;</span>, {})
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">for</span> state <span style="color:#f92672">in</span> (<span style="color:#e6db74">&#34;known_affected&#34;</span>, <span style="color:#e6db74">&#34;known_not_affected&#34;</span>, <span style="color:#e6db74">&#34;fixed&#34;</span>, <span style="color:#e6db74">&#34;under_investigation&#34;</span>):
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">for</span> pid <span style="color:#f92672">in</span> status<span style="color:#f92672">.</span>get(state, []):
</span></span><span style="display:flex;"><span>            rem <span style="color:#f92672">=</span> [r <span style="color:#66d9ef">for</span> r <span style="color:#f92672">in</span> vuln<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;remediations&#34;</span>, []) <span style="color:#66d9ef">if</span> pid <span style="color:#f92672">in</span> expand(r, groups)]
</span></span><span style="display:flex;"><span>            thr <span style="color:#f92672">=</span> [t <span style="color:#66d9ef">for</span> t <span style="color:#f92672">in</span> vuln<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;threats&#34;</span>, []) <span style="color:#66d9ef">if</span> pid <span style="color:#f92672">in</span> expand(t, groups)]
</span></span><span style="display:flex;"><span>            print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;</span><span style="color:#e6db74">{</span>vuln<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#39;cve&#39;</span>)<span style="color:#e6db74">}</span><span style="color:#e6db74"> </span><span style="color:#e6db74">{</span>pid<span style="color:#e6db74">}</span><span style="color:#e6db74"> </span><span style="color:#e6db74">{</span>state<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">for</span> t <span style="color:#f92672">in</span> thr:
</span></span><span style="display:flex;"><span>                print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;  threat  </span><span style="color:#e6db74">{</span>t[<span style="color:#e6db74">&#39;category&#39;</span>]<span style="color:#e6db74">:</span><span style="color:#e6db74">&lt;15</span><span style="color:#e6db74">}</span><span style="color:#e6db74"> </span><span style="color:#e6db74">{</span>t[<span style="color:#e6db74">&#39;details&#39;</span>]<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">for</span> r <span style="color:#f92672">in</span> rem:
</span></span><span style="display:flex;"><span>                restart <span style="color:#f92672">=</span> r<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;restart_required&#34;</span>, {})<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;category&#34;</span>, <span style="color:#e6db74">&#34;-&#34;</span>)
</span></span><span style="display:flex;"><span>                print(<span style="color:#e6db74">f</span><span style="color:#e6db74">&#34;  remedy  </span><span style="color:#e6db74">{</span>r[<span style="color:#e6db74">&#39;category&#39;</span>]<span style="color:#e6db74">:</span><span style="color:#e6db74">&lt;15</span><span style="color:#e6db74">}</span><span style="color:#e6db74"> date=</span><span style="color:#e6db74">{</span>r<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#39;date&#39;</span>, <span style="color:#e6db74">&#39;-&#39;</span>)<span style="color:#e6db74">}</span><span style="color:#e6db74"> restart=</span><span style="color:#e6db74">{</span>restart<span style="color:#e6db74">}</span><span style="color:#e6db74">&#34;</span>)
</span></span></code></pre></div><p>Run against the full example file, it prints:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>CVE-2099-0001 CSAFPID-WORKER known_affected
</span></span><span style="display:flex;"><span>  threat  impact          example-worker parses uploaded XML with libexample; a crafted file can crash the worker.
</span></span><span style="display:flex;"><span>  threat  exploit_status  No public exploit known to Example Corp.
</span></span><span style="display:flex;"><span>  remedy  vendor_fix      date=2026-11-21T00:00:00Z restart=service
</span></span><span style="display:flex;"><span>  remedy  mitigation      date=- restart=-
</span></span><span style="display:flex;"><span>CVE-2099-0001 CSAFPID-API known_not_affected
</span></span><span style="display:flex;"><span>  threat  impact          example-api ships libexample but never calls its XML parser.
</span></span><span style="display:flex;"><span>  threat  exploit_status  No public exploit known to Example Corp.
</span></span><span style="display:flex;"><span>  remedy  mitigation      date=- restart=-
</span></span></code></pre></div><p>The script reads only <code>product_ids</code> and <code>group_ids</code> on plain products. Products defined through <code>relationships</code> need the full-product-name resolution described in the <a href="/posts/csaf-vex-product-tree-product-status-purl-sbom-matching/">product_tree article</a> first. Treat it as a starting point, not a complete CSAF consumer.</p>
<h2 id="where-trivy-v0762-diverges">Where Trivy v0.76.2 diverges</h2>
<p>Trivy is a common first consumer of CSAF VEX files. Reading its source at v0.76.2, and running the same decoding path against the files above, shows three gaps. We could not run Trivy itself in our build environment; instead we compiled gocsaf v3.7.0&rsquo;s <code>csaf</code> package from its source files, unmodified, and called it the way Trivy&rsquo;s <code>decodeCSAF</code> does (<code>json.NewDecoder(r).Decode(&amp;adv)</code>), together with a Go port of Trivy&rsquo;s <code>statement()</code> function.</p>
<h3 id="1-files-with-product_groups-do-not-decode">1. Files with product_groups do not decode</h3>
<p>The CSAF 2.0 schema defines <code>product_tree.product_groups</code> as <code>&quot;type&quot;: &quot;array&quot;</code> of group objects. gocsaf v3.7.0 declares the field as <code>ProductGroups *ProductGroups</code>, where <code>ProductGroups</code> is a struct with a <code>product_group_ids</code> list. Decoding the schema-valid example fails:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>decode error: json: cannot unmarshal array into Go struct field ProductTree.product_tree.product_groups of type csaf.ProductGroups
</span></span></code></pre></div><p>In Trivy, <code>decodeVEX</code> collects that error, <code>NewDocument</code> returns it as &ldquo;unable to load VEX from file&rdquo;, and the VEX filter wraps it as a &ldquo;VEX error&rdquo;. None of the file&rsquo;s statements are applied. The struct is unchanged in gocsaf v3.7.1 and on the main branch as of November 21, 2026, and Trivy&rsquo;s main branch still pins v3.7.0. Until that changes, a workaround is to expand groups into <code>product_ids</code> before handing the file to Trivy; the same document with groups expanded decoded cleanly.</p>
<h3 id="2-one-impact-threat-for-every-filtered-product">2. One impact threat for every filtered product</h3>
<p>When Trivy filters a finding, it attaches a statement taken by <code>statement()</code>, which returns the <code>details</code> of the first threat whose category is <code>impact</code>, and does not look at that threat&rsquo;s <code>product_ids</code>. With groups expanded, our example decodes, and Trivy would filter <code>example-api</code> (known_not_affected) with this statement:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-text" data-lang="text"><span style="display:flex;"><span>example-worker parses uploaded XML with libexample; a crafted file can crash the worker.
</span></span></code></pre></div><p>That is the impact text for the <em>affected</em> product, recorded as the justification for suppressing the unaffected one. The suppression itself is correct (it comes from <code>product_status</code>), but anyone auditing modified findings reads the wrong reason. Order your impact threats with this in mind if Trivy is your consumer, and do not use Trivy&rsquo;s statement field as your audit record for multi-product files.</p>
<h3 id="3-remediations-are-never-read">3. Remediations are never read</h3>
<p>Trivy&rsquo;s matcher builds its status map from <code>known_not_affected</code> and <code>fixed</code> only. <code>known_affected</code> findings pass through unchanged, and nothing in <code>pkg/vex/csaf.go</code> reads <code>remediations</code>. The vendor fix URL, the availability <code>date</code>, <code>entitlements</code> and <code>restart_required</code> never reach the scan output. If you want them in tickets, parse them separately, as above, and join on CVE and product.</p>
<h2 id="csaf-21-adds-two-remediation-categories">CSAF 2.1 adds two remediation categories</h2>
<p>The OASIS CSAF TC&rsquo;s repository now carries CSAF 2.1 prose headed &ldquo;Committee Specification 01&rdquo;, dated 9 November 2026; it is not yet an OASIS Standard. Its schema has seven remediation categories, adding:</p>
<ul>
<li><strong><code>fix_planned</code></strong>: &ldquo;there is a fix for the vulnerability planned but not yet ready&rdquo;. This takes over the &ldquo;fix is being developed&rdquo; use that CSAF 2.0 put under <code>none_available</code>.</li>
<li><strong><code>optional_patch</code></strong>: a patch from the original author whose &ldquo;application is not necessary, but might be desired by the user, e.g. to calm a security scanner&rdquo;. The spec adds: &ldquo;Unless otherwise noted, it is assumed that this does not change the state regarding the vulnerability.&rdquo;</li>
</ul>
<p><code>optional_patch</code> is the category a vendor would attach to a <code>known_not_affected</code> product that still ships a flagged library version. Do not treat it as a <code>vendor_fix</code>.</p>
<p>Tooling has not caught up. gocsaf v3.7.0 accepts only <code>csaf_version</code> &ldquo;2.0&rdquo; and the five 2.0 remediation categories; in our test, a file declaring 2.1 failed with <code>2.1 not in [2.0]</code>, and a 2.0 file with a <code>fix_planned</code> remediation failed with <code>fix_planned not in [mitigation|no_fix_planned|none_available|vendor_fix|workaround]</code>. Both also fail the CSAF 2.0 JSON schema, as expected.</p>
<h2 id="common-mistakes">Common mistakes</h2>
<ul>
<li><strong>Applying a remediation to every product in the vulnerability.</strong> Remediations and threats are scoped by their own <code>product_ids</code> and <code>group_ids</code>, not by <code>product_status</code>.</li>
<li><strong>Closing a finding on <code>mitigation</code> or <code>workaround</code>.</strong> Only <code>vendor_fix</code> is assumed to resolve the flaw, and only once you have applied it.</li>
<li><strong>Forgetting group expansion.</strong> A product named only through a group ID still has its remediation. A parser that reads only <code>product_ids</code> misses it.</li>
<li><strong>Reading an old exploit_status as current.</strong> Check its <code>date</code> against fresher exploitation signals.</li>
</ul>
<h2 id="where-this-fits">Where this fits</h2>
<p>Remediations and threats answer the last questions in the <a href="/posts/vulnerability-prioritization-workflow-cve-record-to-patch-ticket/">CVE-record-to-ticket workflow</a>: once VEX tells you a product is affected, what is the fix, when is it available and what will it cost to apply. For the meaning of the VEX statuses themselves, see <a href="/posts/vex-explained-what-a-not-affected-statement-means-and-how-to-read-one/">VEX explained</a>; for the equivalent OpenVEX fields, see <a href="/posts/openvex-statement-fields-status-notes-action-statement-version-trivy/">OpenVEX statement fields</a>.</p>
<h2 id="limits-of-this-article">Limits of this article</h2>
<ul>
<li>The Trivy findings come from reading v0.76.2 source and running gocsaf v3.7.0&rsquo;s decoding code, not from running the Trivy binary. Behaviour in later Trivy releases may differ.</li>
<li>The example document is illustrative; CVE-2099-0001 and Example Corp are placeholders.</li>
<li>CSAF 2.1 text is quoted from the TC&rsquo;s Committee Specification 01 draft in the oasis-tcs/csaf repository and may change before it becomes an OASIS Standard.</li>
</ul>
<h2 id="sources-and-verification">Sources and verification</h2>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Status</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Remediation and threat fields, required properties, five categories, restart_required values, field meanings</td>
          <td><a href="https://github.com/oasis-tcs/csaf/blob/master/csaf_2.0/prose/csaf-v2-editor-draft.md">CSAF 2.0 prose, 3.2.3.12 and 3.2.3.14</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>VEX profile impact and action statement rules; tests 6.1.27.9, 6.1.27.10, 6.1.29</td>
          <td>Same document, sections 4.5 and 6.1</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>product_groups is an array in the schema; example validates</td>
          <td><a href="https://github.com/oasis-tcs/csaf/blob/master/csaf_2.0/json_schema/csaf_json_schema.json">CSAF 2.0 JSON schema</a>, run with Python jsonschema</td>
          <td>Verified (run)</td>
      </tr>
      <tr>
          <td>Trivy acts on known_not_affected and fixed; statement() takes first impact threat; decodeCSAF uses json.Decoder</td>
          <td><a href="https://github.com/aquasecurity/trivy/blob/v0.76.2/pkg/vex/csaf.go">Trivy v0.76.2 pkg/vex/csaf.go</a>, <a href="https://github.com/aquasecurity/trivy/blob/v0.76.2/pkg/vex/document.go">document.go</a></td>
          <td>Verified (source)</td>
      </tr>
      <tr>
          <td>Trivy pins gocsaf v3.7.0; ProductGroups is a struct; version and category enums</td>
          <td><a href="https://github.com/aquasecurity/trivy/blob/v0.76.2/go.mod">Trivy go.mod</a>, <a href="https://github.com/gocsaf/csaf/blob/v3.7.0/csaf/advisory.go">gocsaf v3.7.0 advisory.go</a></td>
          <td>Verified (source, run)</td>
      </tr>
      <tr>
          <td>CSAF 2.1 CS01 dated 9 November 2026; fix_planned and optional_patch text</td>
          <td><a href="https://github.com/oasis-tcs/csaf/blob/master/csaf_2.1/prose/share/csaf-v2.1-draft.md">oasis-tcs/csaf csaf_2.1 prose</a></td>
          <td>Qualified (Committee Specification, not OASIS Standard)</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item></channel></rss>