[wp-trac] [WordPress Trac] #65123: Having a malformed post type query in $_GET or $_POST yields a critical error

WordPress Trac noreply at wordpress.org
Fri Apr 24 13:58:07 UTC 2026


#65123: Having a malformed post type query in $_GET or $_POST yields a critical
error
--------------------------+------------------------------
 Reporter:  hheuzebrutc   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Permalinks    |     Version:  6.9.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by mindctrl):

 Hi @hheuzebrutc, welcome to Trac and thanks for the report!

 I am able to reproduce the fatal error.


 I'm not sure how common this is, but `attachment` is supposed to be a
 string, as it's used to fetch an attachment by slug/post_name. It looks
 like type validation is handled mostly in `WP_Query::parse_query()`, but
 `attachment` isn't checked properly. We probably need an `is_scalar`
 check, like what is done with `subpost` (which, if provided, gets assigned
 to `attachment`).

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


More information about the wp-trac mailing list