DATA-12974: redact sensitive request headers before logging - #32
Merged
bs-amitmahajan29 merged 5 commits intoAug 26, 2026
Merged
Conversation
pragyash258
force-pushed
the
data-12974-secure-headers-and-ci-hygiene
branch
from
August 16, 2026 19:27
7b9d866 to
336de33
Compare
tanishq171
previously approved these changes
Aug 21, 2026
bs-amitmahajan29
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes DATA-12974:
populateServerDataserialised every request header verbatim, so Authorization, Cookie and API-key values reached the log sink in cleartext.Changes:
[REDACTED]before serialisation, keeping the header names so a reader still sees which headers were sent.Chitragupta.extendSensitiveHeaders([...])for hosts that need additional header names, and document it in the README.test/headers.jstonpm test, covering redaction, case-insensitive matching, request-object immutability and the extension API.1.7.7.semver5.7.1 to 5.7.2. This root lock is not published or honored by downstream consumers. This also supports DATA-12994, but Dependabot and npm-audit CI remain separate work.Validation:
npm testpasses on Node 8, 10, 12, 14, 18, 20 and 26.npm audit --omit=dev --audit-level=highpasses with no high or critical production advisories. The emitted JSON envelope and its key set are unchanged, and the request object itself is not modified, so host auth code still reads the original header value.No
enginesfloor is added: the code runs unchanged on Node 8, and a floor would break installs for consumers on older runtimes.