Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .Jules/sentinel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## 2026-08-31 - Add explicit sensitive key redaction in sanitizeObject
**Vulnerability:** The `sanitizeObject` utility redacted entire `headers` or `request` objects but failed to redact specific sensitive keys (like `authorization`, `password`, or `token`) if they were logged independently or at the top level of an object structure.
**Learning:** Hardcoded blacklists must account for individual sensitive fields, not just container objects, to prevent partial credential leaks in unstructured logs.
**Prevention:** Expanded the blacklist in `sanitizeObject` to include common sensitive keywords (`authorization`, `password`, `token`, etc.) and implemented case-insensitive matching (`toLowerCase()`) to catch variants.
14 changes: 10 additions & 4 deletions src/core/utils/sanitizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,20 @@ export function sanitizeObject(obj: any, maxDepth = MAX_DEPTH, depth = 0): any {
// Blacklisted fields that contain raw request/response data that should be completely hidden
if (
[
'requestBodyValues',
'requestBody',
'requestbodyvalues',
'requestbody',
'headers',
'responseHeaders',
'responseheaders',
'request',
'stack',
'url',
].includes(keyStr)
'authorization',
'password',
'token',
'secret',
'cookie',
'credential',
].includes(keyStr.toLowerCase())
) {
result[key] = '[HIDDEN FOR SECURITY]';
continue;
Expand Down
Loading