T-3: M0.4 Purge hardcoded proxy credential + fix IB collection typo

This commit is contained in:
Studio 2026-11-27 10:55:00 -05:00
parent 36489a1e91
commit 316607b3c2
4 changed files with 159 additions and 16 deletions

View file

@ -23,7 +23,7 @@ export interface HttpCredentialFinding {
}
function isPlaceholderHost(rawHost: string): boolean {
const host = rawHost.toLowerCase();
const host = rawHost.toLowerCase().replace(/\.$/, '');
return (
placeholderHosts.has(host) ||
host.endsWith('.example') ||
@ -45,11 +45,12 @@ export function findEmbeddedHttpCredentials(content: string): number[] {
for (const match of line.matchAll(httpCredentialPattern)) {
const fullMatch = match[0] ?? '';
const host = match[3] ?? '';
const normalizedHost = host.replace(/\.$/, '');
if (
fullMatch.includes('${') ||
host.startsWith('.') ||
host.endsWith('.') ||
isPlaceholderHost(host)
!normalizedHost ||
normalizedHost.startsWith('.') ||
isPlaceholderHost(normalizedHost)
) {
continue;
}