GeezerVison is showing github.com — fix: validate URI scheme in isValid() to reject non-Redis URIs by eddieran · Pull Request #4486 · redis/jedis
Conversation
eddieran
commented
Apr 13, 2026
•
edited by cursor
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes #4483
JedisURIHelper.isValid() only checked that a URI scheme was present, but did not validate it was redis or rediss. This meant URIs like https://user:pass@host:6380 passed validation and could silently connect in plaintext, transmitting credentials without TLS.
Changes:
isValid() now checks the scheme against the existing REDIS and REDISS constants
- Added test cases verifying that
http, https, and ftp schemes are rejected while redis and rediss are accepted
Test plan
- Added
shouldRejectNonRedisSchemes test in JedisURIHelperTest
- Existing
shouldValidateInvalidURIs test continues to pass
- Full test suite passes
Note
Medium Risk
Changes URI validation behavior in a security-sensitive path; could break callers that previously (incorrectly) passed non-redis/rediss URIs, but the code change is small and well-covered by new tests.
Overview
Tightens JedisURIHelper.isValid(URI) to reject any non-Redis URI schemes, requiring redis:// or rediss:// (now case-insensitive) in addition to host+port.
Updates scheme helpers to use equalsIgnoreCase and adds targeted tests covering non-Redis scheme rejection, mixed-case scheme acceptance, and typoed-scheme rejection to prevent accidental plaintext connections.
Reviewed by Cursor Bugbot for commit 99af5ca. Bugbot is set up for automated code reviews on this repo. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…nections
URIs with non-Redis schemes (e.g. https://) were accepted by isValid(),
which could cause credentials to be silently sent over plaintext connections.
Now only 'redis' and 'rediss' schemes are accepted.
Fixes redis#4483
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
@eddieran
Thanks for reporting and taking the time to address it!
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
ggivo
ggivo approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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.