Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/REST/ClientRaw.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(
*
* @return ClientRaw
*/
public function setAuth(string $login, string $secret) : ClientRaw
public function setAuth(string $login, #[\SensitiveParameter] string $secret) : ClientRaw
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Semgrep identified an issue in your code:
Function parameter like $secret, $secretKey, or $secret_key contains sensitive data but is not marked with #[\SensitiveParameter]. If the application crashes or throws an exception, this value may be included in stack traces or error logs, leading to unintended secret disclosure. Add the #[\SensitiveParameter] attribute to prevent exposure.

To resolve this comment:

✨ Commit Assistant Fix Suggestion
  1. Add the attribute #[\SensitiveParameter] before the $secret parameter in the function definition so the first line reads: public function setAuth(string $login, #[\SensitiveParameter] string $secret) : ClientRaw.
  2. Make sure there are no syntax errors resulting from this change.

This marks the $secret parameter as sensitive and helps prevent its value from being exposed in error logs or stack traces.

💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by php-missing-sensitive-parameter-secret.

You can view more details about this finding in the Semgrep AppSec Platform.

{
$this->login = $login;
$this->secret = $secret;
Expand Down