co-authored by
Copilot
parent
6402ff8f9a
commit
f77380037b
@@ -129,6 +129,12 @@ function validateAndMaskHeaders(headers: Record<string, unknown>): Record<string
|
|||||||
|
|
||||||
// Convert value to string
|
// Convert value to string
|
||||||
const stringValue = String(value)
|
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
|
validHeaders[name] = stringValue
|
||||||
|
|
||||||
// Mask sensitive headers in logs
|
// Mask sensitive headers in logs
|
||||||
|
|||||||
Reference in New Issue
Block a user