Skip to content

Commit e93e9c8

Browse files
Arildm-noclaude
andcommitted
fix(wopi): increase guest UserId hash length to 16 chars
Addresses review feedback: bumps substr length from 8 to 16 hex chars (64-bit) for Birthday Paradox mitigation on guest UserId generation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0c4e9cf commit e93e9c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Controller/WopiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public function getSettings(
485485
}
486486

487487
$isPublic = empty($wopi->getEditorUid());
488-
$guestUserId = 'Guest-' . substr(hash('sha256', $wopi->getToken()), 0, 8);
488+
$guestUserId = 'Guest-' . substr(hash('sha256', $wopi->getToken()), 0, 16);
489489
$userId = !$isPublic ? $wopi->getEditorUid() : $guestUserId;
490490

491491
$userConfig = $this->settingsService->generateSettingsConfig($type, $userId);

0 commit comments

Comments
 (0)