Repository navigation
fix: redact sensitive command args in error objects - #2076
wotan-allfather wants to merge 1 commit into
Conversation
When errors are thrown and include command information (e.g., for debugging purposes), sensitive commands like 'auth', 'acl', and 'config' now have their arguments redacted to '[REDACTED]'. This prevents credentials from being leaked into logs when authentication fails or connections are aborted. Commands with redacted args: - auth (username, password) - acl (setuser passwords, etc.) - config (requirepass, etc.) Closes redis#1713
|
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
|
@wotan-allfather, thanks for the PR, I’ll take a look when I get a chance and follow up with any feedback or questions. |
| const SENSITIVE_COMMANDS = new Set([ | ||
| "auth", | ||
| "acl", | ||
| "config", | ||
| ]); |
There was a problem hiding this comment.
It might make sense to add these in the CommandNameFlags
| const SENSITIVE_COMMANDS = new Set([ | ||
| "auth", | ||
| "acl", | ||
| "config", | ||
| ]); |
| if (SENSITIVE_COMMANDS.has(lowerName)) { | ||
| // For auth, acl setuser, config set requirepass - redact all args | ||
| // to avoid leaking username/password combinations | ||
| return { | ||
| name, | ||
| args: args.map(() => "[REDACTED]"), | ||
| }; | ||
| } |
There was a problem hiding this comment.
This will over-redact all ACL and CONFIG commands even though not all of them take sensitive arguments, again this will lead to more complex logic here
|
Since this has been quiet since March, I opened #2231, which follows the review here: the commands are flagged in |
|
Closing this as superseded by #2231, which built on this PR and its review. |
When errors are thrown and include command information (e.g., for debugging purposes), sensitive commands like 'auth', 'acl', and 'config' now have their arguments redacted to '[REDACTED]'.
This prevents credentials from being leaked into logs when authentication fails or connections are aborted.
Commands with redacted args:
Closes #1713