From 197215c8976d58ad172eca9cb925fc9d917730ea Mon Sep 17 00:00:00 2001 From: CyberSecurityUP Date: Sat, 21 Nov 2026 09:47:22 -0300 Subject: [PATCH] fix(web): graph finding detail + don't resume finished run on reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Attack-graph finding panel now falls back to the finding's real fields (payload, evidence, impact, remediation, endpoint) when the derived where/what/fix texts are empty — host/AD findings were selecting but showing no detail. Adds PAYLOAD/COMMAND and EVIDENCE (what was done) blocks so each step shows the exact command and observed proof. - tryResumeActiveJob only re-attaches a job that is still running; a finished/stopped/interrupted job no longer hijacks every page reload onto its stale live screen. --- web/public/app.js | 22 +++++++++++++++++----- web/public/style.css | 2 ++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/web/public/app.js b/web/public/app.js index 0aad676..97a478a 100644 --- a/web/public/app.js +++ b/web/public/app.js @@ -984,6 +984,13 @@ async function tryResumeActiveJob() { if (!id) return false; try { const snap = await api(`/api/exploit/${id}`); + // Only resume a job that is STILL RUNNING. A finished/stopped job must not + // hijack every page reload onto its old live screen — clear it and fall + // through to the normal landing view. + if (snap.done || snap.state === 'complete' || snap.state === 'interrupted' || snap.state === 'stopped') { + localStorage.removeItem(ACTIVE_JOB_KEY); + return false; + } attachLiveJob(id, snap.target, snap.name, snap.pinnedAgents); return true; } catch { @@ -4459,9 +4466,12 @@ function renderGraphMemory(x) { const votes = finding.votes || ''; const reviewStatus = finding.review_status || props.status || ''; const agent = finding.agent || ''; - const whereText = finding.where_text || finding.proof || props.description || ''; - const whatText = finding.what_text || ''; - const fixText = finding.fix_text || ''; + const whereText = finding.where_text || finding.proof || finding.endpoint || props.description || ''; + const payloadText = finding.payload || ''; + const evidenceText = finding.evidence || ''; + const impactText = finding.impact || ''; + const whatText = finding.what_text || impactText || ''; + const fixText = finding.fix_text || finding.remediation || ''; descBox.innerHTML = `
${esc(props.local_severity || 'info')} ${esc(finding.title || gmName(fNode))} @@ -4477,8 +4487,10 @@ function renderGraphMemory(x) { ${reviewStatus ? `
Review Status
${esc(reviewStatus)}
` : ''} ${agent ? `
Agent
${esc(agent)}
` : ''}
- ${whereText ? `
WHERE THE PROBLEM IS

${esc(whereText)}

` : ''} - ${whatText ? `
WHAT IT MEANS

${esc(whatText)}

` : ''} + ${whereText ? `
WHERE

${esc(whereText)}

` : ''} + ${payloadText ? `
PAYLOAD / COMMAND
${esc(payloadText)}
` : ''} + ${evidenceText ? `
EVIDENCE — WHAT WAS DONE
${esc(evidenceText)}
` : ''} + ${whatText ? `
IMPACT

${esc(whatText)}

` : ''} ${fixText ? `
HOW TO FIX IT

${esc(fixText)}

` : ''}`; show(descBox, true); } diff --git a/web/public/style.css b/web/public/style.css index 900cae5..97040a6 100644 --- a/web/public/style.css +++ b/web/public/style.css @@ -1677,3 +1677,5 @@ input[type="number"] { font-variant-numeric: tabular-nums; } #c2View .badge-ok { color: var(--sev-low-fg, #1a7f37); border-color: var(--sev-low-fg, #1a7f37); background: var(--sev-low-bg, rgba(26,127,55,.08)); } #c2View .badge-warn { color: var(--sev-medium-fg, #9a6700); border-color: var(--sev-medium-fg, #9a6700); background: var(--sev-medium-bg, rgba(154,103,0,.08)); } #c2View .badge-muted { color: var(--text-faint); } +/* Attack-graph finding detail: evidence/payload blocks */ +.fd-pre { font-family: var(--mono); font-size: var(--fs-xs); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2, rgba(127,127,127,.08)); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin: 2px 0 0; max-height: 240px; overflow: auto; }