Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API discloses usernames #10

Open
paulo-graca opened this issue Sep 13, 2022 · 0 comments · May be fixed by #11
Open

API discloses usernames #10

paulo-graca opened this issue Sep 13, 2022 · 0 comments · May be fixed by #11

Comments

@paulo-graca
Copy link

Please check this page:
https://vulners.com/hackerone/H1:356047

A way to reproduce it, is to access your site trough:
https://example.com/wp-json/wp/v2/users

Even with author pages disabled, the usernames list is disclosed and accessible. A presented solution for that is to add a filter:

add_filter( 'rest_endpoints', function( $endpoints ){
    if ( isset( $endpoints['/wp/v2/users'] ) ) {
        unset( $endpoints['/wp/v2/users'] );
    }
    if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) {
        unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
    }
    return $endpoints;
});

I've tried and it worked on my side. Can you consider to add it to your pluggin?

paulo-graca added a commit to paulo-graca/disable-author-pages that referenced this issue Sep 13, 2022
@paulo-graca paulo-graca linked a pull request Sep 13, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant