Closed
Description
Description
<?php
function some_lib( $auth ) {
throw new Exception( 'Some error' );
}
function my_code(
#[\SensitiveParameter]
$password
) {
some_lib( $password );
}
try {
my_code('hunter2');
} catch ( Throwable $e ) {
var_dump( $e->getTrace() );
}
At the moment, SensitiveParameter only makes sense if the function does not pass this parameter to any other function (unless that other function also has SensitiveParameter implemented), as that other function will leak the sensitive parameter anyway.
This creates a false sense of security.
Possible options:
- if the param is passed to another function call, ignore the sensitive parameter alltogether, since it's pointless just marking it sensitive in 1 trace frame
or - if the param is used without modification, it should pass on that "sensitive" even to a function, where the param is not marked sensitive.