Support » Plugin: WP User Frontend » Flaw / Potential Security Issue with WordPress User Front End

  • Resolved gpspake


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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' ) { ?>
    <?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' ) { ?>
    <?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.

    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?


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Flaw / Potential Security Issue with WordPress User Front End’ is closed to new replies.