Closed (fixed)
Project:
Redis
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Apr 2026 at 18:28 UTC
Updated:
5 Jun 2026 at 21:15 UTC
Jump to comment: Most recent
The $password argument is sensitive and should not be leaked in stack traces:
RedisException:
php_network_getaddresses: getaddrinfo for foo failed: Temporary failure in name resolution
at modules/contrib/redis/src/Client/PhpRedis.php:32
at Redis->connect('foo', 42)
(modules/contrib/redis/src/Client/PhpRedis.php:32)
at Drupal\redis\Client\PhpRedis->getClient('foo', 42, 'bar')
(modules/custom/test/test.module:70)
ini_set('zend.exception_ignore_args', FALSE);
(new PhpRedis())->getClient('foo', 42, 'bar');
Add #[SensitiveParameter] to the $password argument.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
tribekk commentedOpened MR !95.
The 2.x branch passes Redis connection details through the `$settings` array, including the password. This marks the factory settings parameter as `#[\SensitiveParameter]` on the interface and the PhpRedis, Predis, and Relay implementations.
Checked locally:
- composer validate --no-check-publish
- composer install --no-interaction
- php -l over src
- Reflection check that all getClient() settings parameters have SensitiveParameter
Comment #5
tribekk commentedCredit would be appreciated if this is useful.
Comment #6
berdira MR for 8.x-1.x also makes sense I think.
@prudloff I guess the attribute also makes sense on an array parameter that contains the password?
Comment #7
prudloff commented@berdir Yes, ideally any parameter that contains a password should have this.
Comment #10
berdirMerged 2.x and 8.x-1.x. this is going to break several merge requests/patches on 8.x-1.x, oh well.