Skip to content

Commit

Permalink
Prevent undefined path error
Browse files Browse the repository at this point in the history
  • Loading branch information
timokoessler committed Dec 9, 2024
1 parent 61b4a8b commit a699a4a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/agent/hooks/wrapExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function inspectArgs(

if (agent.shouldBlock()) {
throw new Error(
`Zen has blocked ${attackKindHumanName(result.kind)}: ${result.operation}(...) originating from ${result.source}${escapeHTML(result.pathsToPayload.join())}`
`Zen has blocked ${attackKindHumanName(result.kind)}: ${result.operation}(...) originating from ${result.source}${escapeHTML((result.pathsToPayload || []).join())}`
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/sinks/undici/wrapDispatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function blockRedirectToPrivateIP(url: URL, context: Context, agent: Agent) {

if (agent.shouldBlock()) {
throw new Error(
`Zen has blocked ${attackKindHumanName("ssrf")}: fetch(...) originating from ${found.source}${escapeHTML(found.pathsToPayload.join())}`
`Zen has blocked ${attackKindHumanName("ssrf")}: fetch(...) originating from ${found.source}${escapeHTML((found.pathsToPayload || []).join())}`
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion library/vulnerabilities/ssrf/inspectDNSLookupCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function wrapDNSLookupCallback(
if (agent.shouldBlock()) {
return callback(
new Error(
`Zen has blocked ${attackKindHumanName("ssrf")}: ${operation}(...) originating from ${found.source}${escapeHTML(found.pathsToPayload.join())}`
`Zen has blocked ${attackKindHumanName("ssrf")}: ${operation}(...) originating from ${found.source}${escapeHTML((found.pathsToPayload || []).join())}`
)
);
}
Expand Down

0 comments on commit a699a4a

Please sign in to comment.