Skip to content

sec(rest-api): prevent exposing author email address to unauthenticated users in fb_author_info #548

Open

Description

@shamiulbishal

Describe the Bug

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:

$author_email = get_the_author_meta('email', $author_id);

return array(
    'name' => $author_name,
    'avatar' => $author_avatar,
    'bio' => $author_bio,
    'archive_url' => $author_archive_url,
    'email' => $author_email,
    'latest_post_date' => $latest_post_date,
);

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

  1. Make an unauthenticated GET request to /wp-json/wp/v2/posts.
  2. Inspect the fb_author_info object on any returned post.
  3. 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.

Affected Block or Component

Post Grid / Carousel

WordPress Version

6.7

PHP Version

8.2

Activity

  1. added
    type: security
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: security

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions