T-3: M0.4 Purge hardcoded proxy credential + fix IB collection typo
This commit is contained in:
parent
36489a1e91
commit
316607b3c2
4 changed files with 159 additions and 16 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue