Skip to content

Commit

Permalink
fix: Broken Access Control Issue
Browse files Browse the repository at this point in the history
Fixed a broken access control vulnerability that allowed lower privileged users to execute plugin settings without permission. Added current_user_can() checks to prevent unauthorized access.
  • Loading branch information
nurul-umbhiya authored Jan 16, 2024
1 parent c5fd458 commit 5fc8f51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Insights.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,10 @@ public function handle_optin_optout()
return;
}

if (!current_user_can('manage_options')) {
return;
}

if (isset($_GET[$this->client->slug . '_tracker_optin']) && $_GET[$this->client->slug . '_tracker_optin'] === 'true') {
$this->optin();

Expand Down

0 comments on commit 5fc8f51

Please sign in to comment.