Skip to content

Protect sensitive data from leaking in debug output/logs. - #822

Open
ADmad wants to merge 2 commits into
4.xfrom
sensitive-data
Open

ADmad wants to merge 2 commits into
4.xfrom
sensitive-data

Conversation

@ADmad

@ADmad ADmad commented Oct 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@ADmad ADmad added this to the 4.x milestone Oct 20, 2026
{
$config = $this->_config;
if (isset($config['salt']) && is_string($config['salt'])) {
$config['salt'] = '*****';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think scrubbing these is a great idea. Should we preserve the last 3 or 4 bytes though so that developers can validate that secrets/keys are correct?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a new trait method for redaction. AI suggested to show the last 4 bytes only if the string is longer than 8 chars :) Let me know if you want to adjust/remove that.

ADmad added 2 commits October 21, 2026 13:38
Allows developers to verify that the correct secret/key is configured
without exposing the full value. Secrets of 8 bytes or less are masked
entirely. The shared masking rule lives in RedactionTrait. Also only
redact string values in AuthenticationService's nested config, so
boolean flags like CookieAuthenticator's salt stay visible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants