WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
[resolved] Flaw / Potential Security Issue with WordPress User Front End (4 posts)

  1. gpspake
    Member
    Posted 1 year ago #

    Users who are not permitted to publish or edit published posts can, infact view and edit published posts via the WPUF dashboard.

    If WPUF is configured so that new posts are submitted as pending, then posts are not published until an admin approves the content and publishes the posts from the wp backend. However, once the post has been published the person who initially submitted the post can view, edit, and delete the post via the WPUF dashboard and, potentially, replace all of the content with unapproved content before an admin has an opportunity see it. This is the case even if the user has not been granted capabilities to publish or edit published posts. This creates a liability that undoubtedly prevents many from being able to use the plugin.

    The posts that appear in the WPUF dashboard should be determined by the capabilities that have been granted to the user.

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. gpspake
    Member
    Posted 1 year ago #

    I Fixed It! And I'd like to take a sec to bask in my accomplishment as I am new to php and this, while simple, is probably my greatest coding feat to date. quite rewarding. So...drumroll please.

    To prevent the edit and delete links from appearing in the dashboard for published posts, you only need to amend two lines in wpuf-dashboard.php...

    Change line 154 from
    <?php if ( wpuf_get_option( 'enable_post_edit' ) == 'yes' ) { ?>
    to
    <?php if ( wpuf_get_option( 'enable_post_del' ) == 'yes' && !in_array( $post->post_status, array('publish') ) ) { ?>

    and change line 164 from
    <?php if ( wpuf_get_option( 'enable_post_del' ) == 'yes' ) { ?>
    to
    <?php if ( wpuf_get_option( 'enable_post_del' ) == 'yes' && !in_array( $post->post_status, array('publish') ) ) { ?>

    Now, this prevents the edit and delete buttons from appearing for published posts for all users. If you would like admins to be able to see the links you would have to alter it some more but anyone who needs to be editing published posts most likely already has back end access.

    I hope this helps someone out there and gets more people to download this great plugin.

    Thanks Tareq and I'll hope you'll consider this issue in future updates.

  3. professor99
    Member
    Posted 1 year ago #

    Hi gpspake,

    Thanks heaps for investigating this and publishing the fix.

    Version 4.0 of my development release should of fixed this. Could you check if this achieves the same functionality?

    Thanks
    TheProfessor

  4. gpspake
    Member
    Posted 1 year ago #

    Professor99 Thanks, I'll check it as soon as I get a chance.

    You may have fixed this, but I should probably note that, with my code, even after a post is published and the edit/delete links have disappeared, it can still be accessed directly through the url. The nonce probably prevents this to some extent but I will revisit this before we go live.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.