Update src/helpers.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Yonatan Golick
2026-01-18 11:59:12 +02:00
committed by GitHub
parent 6402ff8f9a
commit f77380037b

View File

@@ -129,6 +129,12 @@ function validateAndMaskHeaders(headers: Record<string, unknown>): Record<string
// Convert value to string
const stringValue = String(value)
// Validate header value to prevent CRLF/header injection
if (stringValue.includes('\r') || stringValue.includes('\n')) {
core.warning(`Skipping header "${name}" because its value contains newline characters, which are not allowed in HTTP header values.`)
continue
}
validHeaders[name] = stringValue
// Mask sensitive headers in logs