You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sec(rest-api): prevent exposing author email address to unauthenticated users in fb_author_info #548
In includes/RestApi/Blocks/PostGrid.php (lines 3798–3841), get_post_author_info() registers the fb_author_info REST field on all public post types and includes the author's private email address in the public REST response:
Because wp/v2/posts (and other public post type endpoints) are publicly readable without authentication, any unauthenticated visitor querying /wp-json/wp/v2/posts receives the user_email of every post author inside fb_author_info.email. By default, WordPress Core hides user_email from public REST responses unless the requester has list_users / edit_users capabilities.
Steps to Reproduce
Make an unauthenticated GET request to /wp-json/wp/v2/posts.
Inspect the fb_author_info object on any returned post.
Observe that fb_author_info.email exposes the author's account email address.
Expected Behavior
get_post_author_info() should either omit email from public responses or only include it when current_user_can('list_users') (or current_user_can('edit_posts')), preventing unauthenticated disclosure of user email addresses.
Activity