Skip to content
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

More appropriate capability check #288

Open
shawfactor opened this issue Oct 5, 2023 · 5 comments
Open

More appropriate capability check #288

shawfactor opened this issue Oct 5, 2023 · 5 comments

Comments

@shawfactor
Copy link

I would suggest a more capability check for this plugin would be install_plugins rather than manage_options. What do you think?

I suggest this as when it is run on a multisite, ordinary site admins have manage_options but cannot change the plugin anyway. In fact this could be a minor security vector by displaying the code that is being run on the site inappropriately

@swissspidy
Copy link
Member

The capability checked for by the plugin is activate_plugins, see

'activate_plugins',
and
if ( current_user_can( 'activate_plugins' ) ) {
$actions[] = sprintf(
'<a href="%1$s">%2$s</a>',
esc_url( admin_url( "tools.php?page=plugin-check&plugin={$plugin_file}" ) ),
esc_html__( 'Check this plugin', 'plugin-check' )
);
}

@mukeshpanchal27
Copy link
Member

@swissspidy, the ticket is open against the legacy plugin. You can find it here: https://github.com/WordPress/plugin-check/blob/legacy-plugin/admin/admin.php#L17-L19.

@swissspidy
Copy link
Member

Well in that case I suppose we can close the issue, given that it doesn't exist in the new version.

@shawfactor
Copy link
Author

The plugin in the .org repository uses manage_options and I was told to come here to raise a ticket to fix that…

@shawfactor
Copy link
Author

shawfactor commented Oct 18, 2023

In any case activate_plugins is the wrong capability to check against. Logically it should be a capability only super admins have on multisite like install_plugins. Otherwise there is a minor security risk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants