MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / sanitizeHeaderValue

Function sanitizeHeaderValue

source code/utils/hooks/execHttpHook.ts:78–81  ·  view source on GitHub ↗

* Strip CR, LF, and NUL bytes from a header value to prevent HTTP header * injection (CRLF injection) via env var values or hook-configured header * templates. A malicious env var like "token\r\nX-Evil: 1" would otherwise * inject a second header into the request.

(value: string)

Source from the content-addressed store, hash-verified

76 * inject a second header into the request.
77 */
78function sanitizeHeaderValue(value: string): string {
79 // eslint-disable-next-line no-control-regex
80 return value.replace(/[\r\n\x00]/g, '')
81}
82
83/**
84 * Interpolate $VAR_NAME and ${VAR_NAME} patterns in a string using process.env,

Callers 1

interpolateEnvVarsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected