From 854f5a1558a41a92f06ad1e3e262d8f7422a0df3 Mon Sep 17 00:00:00 2001
From: seonghobae <8172694+seonghobae@users.noreply.github.com>
Date: Tue, 6 Oct 2026 14:41:27 +0000
Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A1=EF=B8=8F=20Sentinel:=20[HIGH]=20Fi?=
=?UTF-8?q?x=20DOM=20XSS=20via=20unescaped=20numeric=20properties=20in=20d?=
=?UTF-8?q?ashboard?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
scanner/dashboard/console.html | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/scanner/dashboard/console.html b/scanner/dashboard/console.html
index 7ec262af4..c35e6da0f 100644
--- a/scanner/dashboard/console.html
+++ b/scanner/dashboard/console.html
@@ -121,10 +121,10 @@
AppGuardrail Console
const latest=scans[0]||{severity_counts:{}};
const c=latest.severity_counts||{};
$("#stats").innerHTML=[
- ["Latest deploy-blocking",latest.deploy_blocking||0],
- ["New since last scan",latest.new_blocking||0],
- ["Critical",c.CRITICAL||0],
- ["Scans stored",scans.length],
+ ["Latest deploy-blocking",Number(latest.deploy_blocking)||0],
+ ["New since last scan",Number(latest.new_blocking)||0],
+ ["Critical",Number(c.CRITICAL)||0],
+ ["Scans stored",Number(scans.length)||0],
].map(([l,n])=>``).join("");
const ord=[...scans].reverse();
const max=Math.max(1,...ord.map(s=>s.deploy_blocking||0));
@@ -133,7 +133,7 @@ AppGuardrail Console
return ``;}).join("")||'No scans yet.';
$("#history tbody").innerHTML=scans.map(s=>`
| ${esc(s.created_at)} | ${esc(s.repo||"—")} | ${esc((s.commit||"—").slice(0,10))} |
- ${s.total} | ${pill(s.deploy_blocking,"var(--crit)")} | ${pill(s.new_blocking,"var(--high)")} |
`).join("")||'| No scans. POST to /api/v1/scans from CI. |
';
+ ${Number(s.total)||0} | ${pill(Number(s.deploy_blocking)||0,"var(--crit)")} | ${pill(Number(s.new_blocking)||0,"var(--high)")} | `).join("")||'| No scans. POST to /api/v1/scans from CI. |
';
document.querySelectorAll("tr.scan").forEach(tr=>{
tr.onclick=()=>detail(tr.dataset.id,tr);
tr.addEventListener('keydown', e => { if(e.key === 'Enter' || e.key === ' ') { e.preventDefault(); detail(tr.dataset.id,tr); } });
@@ -155,7 +155,7 @@ AppGuardrail Console
try{
const s=await api("/api/v1/scans/"+id);
if(requestId!==currentDetailRequest)return;
- const rows=(s.findings||[]).map(f=>`| ${esc(f.severity)} |
+ const rows=(s.findings||[]).map(f=>`
| ${esc(f.severity)} |
${esc(f.rule_id)} | ${esc((f.message||"").split("\n")[0].slice(0,120))} |
${esc(f.file)}:${esc(f.line)} |
`).join("");
d.innerHTML=`Scan #${esc(s.id)} ${esc(s.created_at)} · ${esc(s.repo||"—")}