Skip to content

Commit de93ff1

Browse files
committed
fix: normalize JS kinds and collapse unknown tab variants
Normalize dirty kind/module values so JS matcher rows route to js-analysis, JS URL rows route to js_urls, and unknown/unknowns variants collapse to prevent duplicate Unknown tabs. Made-with: Cursor
1 parent 2fb2892 commit de93ff1

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

  • internal/modules/gobot/ui

internal/modules/gobot/ui/app.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,7 @@ function normalizeModuleKey(module) {
18981898
'dns-cf1016': 'dns-takeover',
18991899
'dep-confusion': 'dependency-confusion',
19001900
'dependency_confusion': 'dependency-confusion',
1901+
'unknowns': 'unknown',
19011902
};
19021903
return aliases[raw] || raw;
19031904
}
@@ -4145,10 +4146,32 @@ async function loadReconUnifiedTable(scanId, allFiles, containerId, scanRecord)
41454146
}
41464147

41474148
allRows = allRows
4148-
.map((r) => ({
4149-
...r,
4150-
kind: String(r.kind || inferKindFromFileName(r.file) || 'other').toLowerCase(),
4151-
}))
4149+
.map((r) => {
4150+
let kind = String(r.kind || inferKindFromFileName(r.file) || 'other').toLowerCase().trim();
4151+
const file = String(r.file || '').toLowerCase();
4152+
const target = String(r.target || r.host || '').toLowerCase();
4153+
const finding = String(r.title || r.finding || '').trim();
4154+
const moduleNorm = normalizeModuleKey(r.module);
4155+
4156+
if (kind === 'js-urls') kind = 'js_urls';
4157+
if (kind === 'unknown' || kind === 'unknowns') kind = 'other';
4158+
4159+
const looksLikeJSMatcher = /^\s*\[[^\]]+\].*->/i.test(finding) || file.includes('js-secret') || file.includes('js-exposure');
4160+
const looksLikeJSURL = file.includes('js-url') || /\.m?jsx?(\?|$)/i.test(target);
4161+
4162+
if (looksLikeJSMatcher) kind = 'js-analysis';
4163+
else if (looksLikeJSURL && kind === 'other') kind = 'js_urls';
4164+
4165+
const normalizedModule = (moduleNorm === 'unknown' && (kind === 'js-analysis' || kind === 'js_urls'))
4166+
? 'js-analysis'
4167+
: moduleNorm;
4168+
4169+
return {
4170+
...r,
4171+
kind,
4172+
module: normalizedModule,
4173+
};
4174+
})
41524175
.filter((r) => {
41534176
const finding = String(r.title || r.finding || '').trim().toLowerCase();
41544177
const target = String(r.target || r.host || '').trim();

0 commit comments

Comments
 (0)