Build 7 success

gitbay-security on main · b765f11c0d · queued 2026-11-05 04:00 UTC · finished 2026-11-05 04:13 UTC · ran 1m23s

setup
$ git clone ssh://git@127.0.0.1/audit-labs/gh-attest.git (b765f11c0d)
step 1/2 mkdir -p "$GITBAY_RESULTS"

step 2/2 opengrep scan --quiet --disable-version-check --config /opt/opengrep-rules --sarif-output="$GITBAY_RESULTS/opengrep.sarif" .
                    
                    
┌──────────────────┐
│ 28 Code Findings │
└──────────────────┘
                              
    scripts/check-mappings.mjs
    ❯❱ opt.opengrep-rules.javascript.lang.correctness.no-replaceall
          The string method replaceAll is not supported in all versions of javascript, and is not supported by
          older browser versions. Consider using replace() with a regex as the first argument instead like    
          mystring.replace(/bad/g, "good") instead of mystring.replaceAll("bad", "good")                      
          (https://discourse.threejs.org/t/replaceall-is-not-a-function/14585)                                
                                                                                                              
           68┆ const status = statusCell.replaceAll("`", ""); // "·" for NULL
            ⋮┆----------------------------------------
           69┆ set.add(key({ resource: resource.replaceAll("`", ""), status, framework, control, posture,
               rationale: rationale ?? "" }));                                                           
               
    src/auth.ts
    ❯❱ opt.opengrep-rules.javascript.lang.correctness.no-replaceall
          The string method replaceAll is not supported in all versions of javascript, and is not supported by
          older browser versions. Consider using replace() with a regex as the first argument instead like    
          mystring.replace(/bad/g, "good") instead of mystring.replaceAll("bad", "good")                      
          (https://discourse.threejs.org/t/replaceall-is-not-a-function/14585)                                
                                                                                                              
           99┆ return btoa(input).replaceAll("+", "-").replaceAll("/", "_").replace(/={1,2}$/, "");
            ⋮┆----------------------------------------
           99┆ return btoa(input).replaceAll("+", "-").replaceAll("/", "_").replace(/={1,2}$/, "");
            ⋮┆----------------------------------------
          103┆ const padded = input.replaceAll("-", "+").replaceAll("_", "/");
            ⋮┆----------------------------------------
          103┆ const padded = input.replaceAll("-", "+").replaceAll("_", "/");
                    
    src/dashboard.ts
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
           27┆ `<option value="${esc(i.installation_id)}"${i.installation_id === current ? " selected" :
               ""}>${esc(                                                                               
           28┆   i.org_login,
           29┆ )}</option>`,
            ⋮┆----------------------------------------
           32┆ return `<form method="post" action="/switch" class="switcher">
           33┆     <input type="hidden" name="return" value="${esc(returnTo)}">
           34┆     <select name="installationId" onchange="this.form.submit()">${options}</select>
           35┆     <noscript><button type="submit">Switch</button></noscript>
           36┆   </form>`;
   
     ❱ opt.opengrep-rules.javascript.lang.correctness.missing-template-string-indicator
          This looks like a JavaScript template string. Are you missing a '$' in front of '{...}'?
                                                                                                  
           79┆ const STYLE = `
           80┆   :root { color-scheme: light; }
           81┆   * { box-sizing: border-box; }
           82┆   body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               sans-serif;                                                                              
           83┆          color: #1a1a1a; background: #f6f7f9; }
           84┆   header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
           85┆            padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid #e2e5e9; flex-
               wrap: wrap; }                                                                             
           86┆   header h1 { font-size: 1.05rem; margin: 0; }
           87┆   header .who { color: #666; font-size: 0.85rem; }
           88┆   header .who a { color: #0055dc; margin-left: 0.75rem; }
             [hid 27 additional lines, adjust with --max-lines-per-finding] 
           79┆ const STYLE = `
           80┆   :root { color-scheme: light; }
           81┆   * { box-sizing: border-box; }
           82┆   body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               sans-serif;                                                                              
           83┆          color: #1a1a1a; background: #f6f7f9; }
           84┆   header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
           85┆            padding: 1rem 1.5rem; background: #fff; border-bottom: 1px solid #e2e5e9; flex-
               wrap: wrap; }                                                                             
           86┆   header h1 { font-size: 1.05rem; margin: 0; }
           87┆   header .who { color: #666; font-size: 0.85rem; }
           88┆   header .who a { color: #0055dc; margin-left: 0.75rem; }
             [hid 26 additional lines, adjust with --max-lines-per-finding] 
   
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
          128┆ return `<tr>
          129┆       <td>${esc(r.framework)}</td>
          130┆       <td>${esc(r.control_id)}</td>
          131┆       <td class="posture ${esc(r.posture)}">${esc(r.posture)}</td>
          132┆       <td>${esc(r.repo ?? r.subject ?? "—")}</td>
          133┆       <td>${esc(r.resource)}</td>
          134┆       <td>${esc(r.status)}</td>
          135┆     </tr>`;
            ⋮┆----------------------------------------
          141┆ ? `<a href="/exports/${esc(e.id)}/download">Download ${esc(e.format.toUpperCase())}</a>`
            ⋮┆----------------------------------------
          142┆ : `<span class="muted" data-export-id="${esc(e.id)}">${esc(e.status)}…</span>`;
            ⋮┆----------------------------------------
          143┆ return `<tr>
          144┆       <td>${esc(e.created_at)}</td>
          145┆       <td>${esc(e.framework)}</td>
          146┆       <td>${esc(e.format.toUpperCase())}</td>
          147┆       <td class="export-status">${cell}</td>
          148┆     </tr>`;
            ⋮┆----------------------------------------
          153┆ ? `<div class="bar"><form method="post" action="/exclusions">
          154┆     <select name="repo">${excludableRepos.map((r) => `<option
               value="${esc(r)}">${esc(r)}</option>`).join("")}</select>    
          155┆     <button type="submit">Exclude</button>
          156┆   </form></div>`
            ⋮┆----------------------------------------
          154┆ <select name="repo">${excludableRepos.map((r) => `<option
               value="${esc(r)}">${esc(r)}</option>`).join("")}</select>
            ⋮┆----------------------------------------
          161┆ return `<tr>
          162┆       <td>${esc(repo)}</td>
          163┆       <td><form method="post" action="/exclusions">
          164┆         <input type="hidden" name="repo" value="${esc(repo)}">
          165┆         <input type="hidden" name="action" value="remove">
          166┆         <button class="secondary" type="submit">Include again</button>
          167┆       </form></td>
          168┆     </tr>`;
            ⋮┆----------------------------------------
          181┆ `<a href="${href(value, data.posture)}" class="${data.framework === value ? "active" :
               ""}">${label}</a>`;                                                                   
            ⋮┆----------------------------------------
          186┆ return `<a class="card${active ? " active" : ""}" href="${href(data.framework, active ?
               null : posture)}"                                                                      
          187┆   aria-pressed="${active}"><div class="n ${posture}">${counts[posture]}</div><div
               class="l">${label}</div></a>`;                                                   
            ⋮┆----------------------------------------
          197┆   return `<!doctype html>
          198┆ <html lang="en">
          199┆ <head>
          200┆   <meta charset="utf-8">
          201┆   <meta name="viewport" content="width=device-width, initial-scale=1">
          202┆   <title>gh-attest — Compliance Evidence</title>
          203┆   <style>${STYLE}</style>
          204┆ </head>
          205┆ <body>
          206┆   <header>
             [hid 84 additional lines, adjust with --max-lines-per-finding] 
          247┆ `<tr><td colspan="6" class="muted">${
          248┆   data.posture ? `No ${esc(data.posture)} evidence in this view.` : "No evidence yet."
          249┆ }</td></tr>`
   
     ❱ opt.opengrep-rules.javascript.lang.correctness.missing-template-string-indicator
          This looks like a JavaScript template string. Are you missing a '$' in front of '{...}'?
                                                                                                  
          265┆     <tbody>${exportRows || `<tr><td colspan="4" class="muted">No exports
               yet.</td></tr>`}</tbody>                                                
          266┆   </table>
          267┆ </main>
          268┆
          269┆ <script>
          270┆   // Poll any pending exports and swap in the download link when ready.
          271┆   for (const el of document.querySelectorAll("[data-export-id]")) {
          272┆     const id = el.getAttribute("data-export-id");
          273┆     const tick = async () => {
          274┆       const r = await fetch("/exports/" + id, { headers: { accept: "application/json" } });
             [hid 16 additional lines, adjust with --max-lines-per-finding] 
   
    ❯❱ opt.opengrep-rules.javascript.lang.security.html-in-template-string
          This template literal looks like HTML and has interpolated variables. These variables are not HTML-
          encoded by default. If the variables contain HTML tags, these may be interpreted by the browser,   
          resulting in cross-site scripting (XSS).                                                           
                                                                                                             
          313┆ (e) => `<tr>
          314┆   <td class="posture ${esc(CHANGE_CLASS[e.change] ??
               "informational")}">${esc(e.change)}</td>            
          315┆   <td>${esc(e.resource === "org_member" ? "org member" : "team member")}</td>
          316┆   <td>${esc(e.subject)}</td>
          317┆   <td>${esc(e.from ?? "—")}</td>
          318┆   <td>${esc(e.to ?? "—")}</td>
          319┆ </tr>`,
            ⋮┆----------------------------------------
          329┆ banner = `<p class="muted">Baseline captured ${esc(diff.currentAt)} (${diff.currentCount}
               access                                                                                   
          330┆   entries). No earlier snapshot before ${esc(data.since)} to compare against yet — the next
               sync                                                                                       
          331┆   after that date will produce a diff.</p>`;
            ⋮┆----------------------------------------
          333┆ banner = `<p class="muted">Comparing ${esc(diff.priorAt)} → ${esc(diff.currentAt)} ·
          334┆   ${diff.currentCount} current access entries · ${diff.entries.length} change(s).</p>`;
            ⋮┆----------------------------------------
          337┆   return `<!doctype html>
          338┆ <html lang="en">
          339┆ <head>
          340┆   <meta charset="utf-8">
          341┆   <meta name="viewport" content="width=device-width, initial-scale=1">
          342┆   <title>gh-attest — Access Review</title>
          343┆   <style>${STYLE}</style>
          344┆ </head>
          345┆ <body>
          346┆   <header>
             [hid 23 additional lines, adjust with --max-lines-per-finding] 
                   
    src/exporter.ts
    ❯❱ opt.opengrep-rules.javascript.lang.correctness.no-replaceall
          The string method replaceAll is not supported in all versions of javascript, and is not supported by
          older browser versions. Consider using replace() with a regex as the first argument instead like    
          mystring.replace(/bad/g, "good") instead of mystring.replaceAll("bad", "good")                      
          (https://discourse.threejs.org/t/replaceall-is-not-a-function/14585)                                
                                                                                                              
          126┆ return `"${str.replaceAll('"', '""')}"`;
                     
    src/github-app.ts
     ❱ opt.opengrep-rules.generic.secrets.gitleaks.private-key
          A gitleaks private-key was detected which attempts to identify hard-coded credentials. It is not  
          recommended to store credentials in source-code, as this risks secrets being leaked and used by   
          either an internal or external malicious adversary. It is recommended to use environment variables
          to securely provide credentials or retrieve credentials from a secure vault or HSM (Hardware      
          Security Module).                                                                                 
                                                                                                            
           34┆ return `-----BEGIN PRIVATE KEY-----\n${btoa(binary)}\n-----END PRIVATE KEY-----`;

results uploaded