#66001 closed defect (bug) (reported-upstream)
Accessing /wp-admin/admin-post.php?page=font-library while logged loads Site Editor
| Reported by: | slaFFik | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1.1 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description (last modified by )
Hey there,
When you try to load this page wp-admin/admin-post.php?page=font-library for any WordPress site (while being logged out), you can get various errors. That may be PHP warnings, or partially loaded Site Editor and its Font Editor interface.
Examples:
- https://wordpress.com/wp-admin/admin-post.php?page=font-library
- https://wordpress.tv/wp-admin/admin-post.php?page=font-library
- https://www.taylorswift.com/wp-admin/admin-post.php?page=font-library
- https://magazine.atavist.com/wp-admin/admin-post.php?page=font-library&p=54656
etc.
This also understandably generates a bunch of console errors in the browser.
Depending on how plugins have been coded, they may expose some admin-specific information in the HTML of the page (because they may output JSON, including some putting various keys there).
Similar behavior with some other pages, like this one: /wp-admin/admin-post.php?page=options-connectors
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Reproduction report. Confirmed on a clean trunk install with no plugins active.
Environment
Steps
/wp-admin/admin-post.php?page=font-library.Results
The response is HTTP 200 with about 21 KB of rendered HTML: the font library app container, block editor scripts, module preloads for the
font-listandfonts-homeroutes, and REST preload data. A PHP deprecation notice fromwp-admin/includes/plugin.php:2156also leaks into the page title. A request toadmin-post.phpwithout thepageparameter returns an empty body as expected.Cause
wp_font_library_intercept_render()inwp-includes/build/pages/font-library/page.phpis hooked toadmin_initand renders the full page whenever$_GET['page']equalsfont-library, then exits. It has no capability check, while the menu registration inwp-admin/menu.phpgates the Fonts page behindedit_theme_options. Sinceadmin-post.phpfiresadmin_initfor logged-out requests to supportadmin_post_nopriv_actions, the interceptor runs for anonymous visitors on an endpoint it was never meant to handle. The generatedoptions-connectorspage uses the same pattern, which matches the second example in the description.These files are generated by the Gutenberg build and copied into core during the build step, so the fix needs to land in the generator in the Gutenberg repository rather than in
wp-includes/build/. The guard itself would be a capability check matching the menu registration, plus limiting the interceptor to its own screen instead of everyadmin_init.