-
Notifications
You must be signed in to change notification settings - Fork 21
Fixed vulnerable to Cross Site Request Forgery (CSRF) #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next/2.x/main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few comments / questions.
I also changed the base from master to our v2 branch.
} | ||
|
||
// Additional security check - ensure we're in admin context | ||
if (!is_admin()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a REST endpoint in the admin context?
'permission_callback' => '__return_true', | ||
'permission_callback' => function() { | ||
// Check if user is logged in and has manage_options capability | ||
return is_user_logged_in() && current_user_can('manage_options'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@@ -350,6 +380,11 @@ public static function restoreDefaultsAction() | |||
|
|||
public static function flashRedirect($type, $message) | |||
{ | |||
// Security check - ensure user has proper capabilities | |||
if (!current_user_can('manage_options')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we are adding this here when it is only called from restoreDefaultsAction()
which has the same check?
} | ||
|
||
// Verify nonce if provided (for admin menu link) | ||
if (isset($_GET['_wpnonce']) && !wp_verify_nonce($_GET['_wpnonce'], 'rollbar_wp_admin_link')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this check being optional, what is the benefit of having it?
Description of the change
Type of change
Related issues
Checklists
Development
Code review