From 8c403cc65481ada0fe1ddde4110ec1cb00a4aaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Mon, 9 Dec 2024 15:24:15 +0100 Subject: [PATCH] Upload only one path, simplify --- library/agent/Agent.ts | 2 +- library/vulnerabilities/ssrf/isRequestToItself.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/agent/Agent.ts b/library/agent/Agent.ts index bed952ae7..90782b52e 100644 --- a/library/agent/Agent.ts +++ b/library/agent/Agent.ts @@ -168,7 +168,7 @@ export class Agent { module: module, operation: operation, blocked: blocked, - path: paths.join(), + path: paths.length > 0 ? paths[0] : "", stack: stack, source: source, metadata: limitLengthMetadata(metadata, 4096), diff --git a/library/vulnerabilities/ssrf/isRequestToItself.ts b/library/vulnerabilities/ssrf/isRequestToItself.ts index 04f67db37..f60f68a1b 100644 --- a/library/vulnerabilities/ssrf/isRequestToItself.ts +++ b/library/vulnerabilities/ssrf/isRequestToItself.ts @@ -26,7 +26,7 @@ export function isRequestToItself({ if (path === ".origin" || path === ".referer") { const url = tryParseURL(str); - if (!!url && url.host === `localhost:${port}`) { + if (url && url.host === `localhost:${port}`) { ignoredPaths++; } }