Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Hide sensitive information withSensitiveParameter attribute#46183
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
SensitiveParameter attributeSensitiveParameter attribute| 6.2 | ||
| --- | ||
| * Hide sensitive information from stack traces with`SensitiveParameter` attribute |
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.
Added the info to the changelog for discoverability.
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.
I think we need to be more precise about "Hide". It's "only" for back traces.
| * @throws InvalidPasswordException When the plain password is invalid, e.g. excessively long | ||
| */ | ||
| publicfunctionhash(string$plainPassword):string; | ||
| publicfunctionhash(#[\SensitiveParameter]string$plainPassword):string; |
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.
The attribute has no effect on the interface, but is a remainder for implementers.
SensitiveParameter attributeSensitiveParameter attributejaviereguiluz commentedApr 28, 2022
Just saying: in the PHP repository there was an issue about making this |
GromNaN commentedApr 28, 2022
@javiereguiluz we should expose the |
javiereguiluz commentedApr 28, 2022
I don't know. It was just a "maybe we should think about this" comment. Imagine a bug where you mistyped some chars in your password. But is that common? |
chalasr commentedJul 5, 2022
Can you take a look at the rest of the codebase where this could be useful? I think it's fine do it once for all, everywhere plain credentials are passed around (#46853 mentions some relevant places btw) |
TimWolla commentedJul 5, 2022
RFC author here 👋
I recommend not just looking at credentials, but also stuff like plaintext values that are passed into an encryption component to be encrypted. I'm not a Symfony user, but an example would likely be My php-src PR that adds the attribute is this one:php/php-src#8352, it might be a good reference. |
GromNaN commentedJul 9, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I added the attribute on every parameter that looks like a secret. Notes:
|
SensitiveParameter attributeSensitiveParameter attributechalasr commentedJul 10, 2022
That's ok as long as we manage to reveal the sensitive values in debugging contexts such as the webprofiler, right?
Fine to me as well, as they might do at some point or be extended. |
Uh oh!
There was an error while loading.Please reload this page.
| 6.2 | ||
| --- | ||
| * Hide sensitive information from stack traces with`SensitiveParameter` attribute |
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.
I think we need to be more precise about "Hide". It's "only" for back traces.
fabpot commentedJul 11, 2022
Thank you@GromNaN. |
This PR was merged into the 6.3 branch.Discussion----------Add #[\SensitiveParameter] to $sessionId| Q | A| ------------- | ---| Branch? | 6.3| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR | -Follow-up to#48274 and#46183Commits-------32c9f28 Add #[\SensitiveParameter] to $sessionId
Uh oh!
There was an error while loading.Please reload this page.
New feature for PHP 8.2:Redact parameters in back traces
This could be a "minor" change, but I think it should be highlighted to be fully functional. The annotation is required in all calling functions otherwise the argument value is displayed.