mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Addressed user detail harvesting issue
Altered access & usage of the /search/users/select endpoint with the following changes: - Removed searching of email address to prevent email detail discovery via hunting via search queries. - Required the user to be logged in and have permission to manage users or manage permissions on items in some way. - Removed the user migration option on user delete unless they have permission to manage users. For #3108 Reported in https://huntr.dev/bounties/135f2d7d-ab0b-4351-99b9-889efac46fca/ Reported by @haxatron
This commit is contained in:
@@ -130,6 +130,21 @@ class UserManagementTest extends TestCase
|
||||
$resp->assertSee('new_owner_id');
|
||||
}
|
||||
|
||||
public function test_migrate_option_hidden_if_user_cannot_manage_users()
|
||||
{
|
||||
$editor = $this->getEditor();
|
||||
|
||||
$resp = $this->asEditor()->get("settings/users/{$editor->id}/delete");
|
||||
$resp->assertDontSee('Migrate Ownership');
|
||||
$resp->assertDontSee('new_owner_id');
|
||||
|
||||
$this->giveUserPermissions($editor, ['users-manage']);
|
||||
|
||||
$resp = $this->asEditor()->get("settings/users/{$editor->id}/delete");
|
||||
$resp->assertSee('Migrate Ownership');
|
||||
$resp->assertSee('new_owner_id');
|
||||
}
|
||||
|
||||
public function test_delete_with_new_owner_id_changes_ownership()
|
||||
{
|
||||
$page = Page::query()->first();
|
||||
|
Reference in New Issue
Block a user