Skip to content

Add #[\SensitiveParameter] to more functions taking secrets - #23782

Open
jordikroon wants to merge 5 commits into
php:masterfrom
jordikroon:sensitive-parameter-adoption
Open

jordikroon wants to merge 5 commits into
php:masterfrom
jordikroon:sensitive-parameter-adoption

Conversation

@jordikroon

Copy link
Copy Markdown
Member

Several functions still accepted passwords, keys, etc without marking them as #[\SensitiveParameter].
This may (likely) not be complete, but this is what I could find.

As mhash is deprecated I was debating if we should include it, but I don't see any downsides. It's a free protection for those who still rely on it.

@jordikroon
jordikroon force-pushed the sensitive-parameter-adoption branch from f351ab3 to ee89463 Compare September 20, 2026 00:23
sodium
--FILE--
<?php
foreach ([

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.

why doesn't this test also trigger an exception just like the rest of the tests?

@Girgias Girgias left a comment

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.

Makes sense, one minor question as I don't fully understand the characteristics of it.

Comment thread ext/snmp/snmp.stub.php
function snmp_set_oid_numeric_print(Snmp\OidOutput|int $format): true {}

function snmp2_get(string $hostname, string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}
function snmp2_get(string $hostname, #[\SensitiveParameter] string $community, array|string $object_id, int $timeout = -1, int $retries = -1): mixed {}

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.

What is sensitive about the $community variable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants