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/Section/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function dropCached(string $key)
*/
public function create(
string $name,
string $password,
#[\SensitiveParameter] string $password,
Comment on lines 64 to +66
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 $password contains sensitive authentication 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 password disclosure. Add the #[\SensitiveParameter] attribute to prevent exposure.

To resolve this comment:

✨ Commit Assistant Fix Suggestion
  1. Add the #[\SensitiveParameter] attribute right before the $password parameter in the function signature, so it looks like: #[\SensitiveParameter] string $password.
  2. Ensure the function signature is updated to:
    public function create(string $name, #[\SensitiveParameter] string $password, string $email, string $display_name, array $applications = ["jira-software"]) : \stdClass { ... }

This prevents the value of $password from being exposed in stack traces or error logs if an exception occurs.

💬 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-password.

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

string $email,
string $display_name,
array $applications = ["jira-software"]
Expand Down