Skip to content

[Cache] The RedisTrait DSN parsing doesn't urldecode the params #52420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maelanleborgne opened this issue Nov 2, 2023 · 0 comments · Fixed by #52688
Closed

[Cache] The RedisTrait DSN parsing doesn't urldecode the params #52420

maelanleborgne opened this issue Nov 2, 2023 · 0 comments · Fixed by #52688

Comments

@maelanleborgne
Copy link
Contributor

Symfony version(s) affected

5.4

Description

The RedisTrait doesn't urldecode the username/password/host when creating the connection from the dsn. In most other components, params are decoded (in the Mailer for example). That makes it hard to use special chars.
It would be easy enough to fix this but I'm affraid this would impact users that have character sequences that match url-encoded signs (for instance a raw password password%3D would be converted to password=).

Is this something we could fit in 7.0 ?

How to reproduce

Use redis with a password containing à @ char.
Using no encoding the parsing will be wrong
redis://user:p@ssword@localhost
If encoded the auth will fail
redis://user:p%40assword@localhost

Possible Solution

No response

Additional Context

No response

@OskarStark OskarStark changed the title [Cache] The RedisTrait dsn parsing doesn't urldecode the params [Cache] The RedisTrait DSN parsing doesn't urldecode the params Nov 3, 2023
nicolas-grekas added a commit that referenced this issue Nov 24, 2023
…alexandre-daubois)

This PR was merged into the 5.4 branch.

Discussion
----------

[Cache] Add url decoding of password in `RedisTrait` DSN

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Issues        | Fix #52420
| License       | MIT

This brings support for `@` char in passwords

Commits
-------

1717fca [Cache] Add url decoding of password in `RedisTrait` DSN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants