Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

Potential fix for pull request finding 'CodeQL / Log injection'

Andy Pavia504bc815cb84
diff --git a/mcp-host/src/core/guardrails/hooks/hookFetcher.ts b/mcp-host/src/core/guardrails/hooks/hookFetcher.ts
index c63b734a5..ea7400279 100644
--- a/mcp-host/src/core/guardrails/hooks/hookFetcher.ts
+++ b/mcp-host/src/core/guardrails/hooks/hookFetcher.ts
@@ -174,8 +174,9 @@ export function createHookFetcher(deps: HookFetcherDeps): HookFetcher {
} catch (err) {
// timeout / connection error / SSRF refusal → unavailable (→ fail-mode, §8.6).
if (err instanceof SsrfBlockedError) {
+ const safeErrMessage = String(err.message).replace(/[\r\n]+/g, ' ')
console.warn(
- `[Guardrails] remote hook ${descriptor.id} blocked by SSRF guard: ${err.message}`
+ `[Guardrails] remote hook ${descriptor.id} blocked by SSRF guard: ${safeErrMessage}`
)
}
return { status: 0, body: undefined, unavailable: true }