[wp-trac] [WordPress Trac] #5272: WordPress allows anonymous user to see slug for private post by guessing post number

WordPress Trac noreply at wordpress.org
Fri Jan 29 00:25:07 UTC 2021


#5272: WordPress allows anonymous user to see slug for private post by guessing
post number
--------------------------------------+-----------------------------
 Reporter:  tzafrir                   |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  5.7
Component:  Security                  |     Version:  2.3.1
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------

Comment (by peterwilsoncc):

 In [attachment:"5272.diff"]

 * Actually fixes issue reported in #51776 (this required half a fix of
 #52373 but it returns ugly links rather than pretty permalinks)
 * `redirect_canonical()` changes pretty much the same as last time but I
 think the logic is clearer.
 * New function `wp_force_ugly_post_permalink()` in `link-template.php` to
 unify the check in each of the three permalink generating functions:
 pages, posts and attachments
 * New functions `is_post_status_viewable()` and
 `is_post_publicly_viewable()` to assist with cleaning up logic (fixes
 #49380)

 Props very much due to @TimothyBlynJacobs for assisting with review on the
 PR.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/5272#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list