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

Post type should be public on Recent Post #1364

Open
rizaardiyanto1412 opened this issue Jan 30, 2024 · 0 comments
Open

Post type should be public on Recent Post #1364

rizaardiyanto1412 opened this issue Jan 30, 2024 · 0 comments
Labels
unconfirmed bug This needs more testing. Can often be used when a member of the public posts.

Comments

@rizaardiyanto1412
Copy link

The code in advanced-gutenberg-pro/lib/vendor/publishpress/publishpress-blocks/assets/blocks/recent-posts/block.php needs to be adjusted due to a broken access control issue.

You allow any post type to be provided to the Recent Posts block, however it does not check whether that post type is meant to be public or not. As a Contirbutor user, someone could choose to embed the recent published posts of any post type that they'd like regardless if they actually have access to read posts.

You could add code like:

if ( ! is_post_type_viewable( $post_type ) ) { /* maybe return an empty string or an error message */ }

This would check whether the post type specified is viewable or not. If it isn't, then you could return a blank string or an error message perhaps.

https://secure.helpscout.net/conversation/2495159321

@rizaardiyanto1412 rizaardiyanto1412 added the unconfirmed bug This needs more testing. Can often be used when a member of the public posts. label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug This needs more testing. Can often be used when a member of the public posts.
Projects
None yet
Development

No branches or pull requests

3 participants