fix: redact sensitive command args in error objects#2076
Open
wotan-allfather wants to merge 1 commit intoredis:mainfrom
Open
fix: redact sensitive command args in error objects#2076wotan-allfather wants to merge 1 commit intoredis:mainfrom
wotan-allfather wants to merge 1 commit intoredis:mainfrom
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. |
Contributor
|
@wotan-allfather, thanks for the PR, I’ll take a look when I get a chance and follow up with any feedback or questions. |
PavelPashov
requested changes
Mar 20, 2026
Comment on lines
+365
to
+369
| const SENSITIVE_COMMANDS = new Set([ | ||
| "auth", | ||
| "acl", | ||
| "config", | ||
| ]); |
Contributor
There was a problem hiding this comment.
It might make sense to add these in the CommandNameFlags
Comment on lines
+365
to
+369
| const SENSITIVE_COMMANDS = new Set([ | ||
| "auth", | ||
| "acl", | ||
| "config", | ||
| ]); |
Contributor
Comment on lines
+384
to
+391
| 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]"), | ||
| }; | ||
| } |
Contributor
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
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.
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