Increase the length of the secret to 32 characzers
authorAlexander Ebert <ebert@woltlab.com>
Sat, 18 May 2024 11:22:34 +0000 (13:22 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 8 Jun 2024 10:19:39 +0000 (12:19 +0200)
wcfsetup/install/files/lib/data/file/FileEditor.class.php
wcfsetup/setup/db/install.sql

index 940edce3412eada391c81664c6f1720e56d0ff51..44cd5ee69bb570a4cdf591321a3da1fa91fe2499 100644 (file)
@@ -81,7 +81,7 @@ class FileEditor extends DatabaseObjectEditor
             'fileSize' => $fileTemporary->fileSize,
             'fileHash' => $fileTemporary->fileHash,
             'fileExtension' => File::getSafeFileExtension($mimeType, $fileTemporary->filename),
-            'secret' => \bin2hex(\random_bytes(10)),
+            'secret' => \bin2hex(\random_bytes(16)),
             'objectTypeID' => $fileTemporary->objectTypeID,
             'mimeType' => $mimeType,
             'width' => $width,
index 49feacfa9c3f16baecdc598914e9da92869f30ce..907af402e7f08f7fce9de933a32cff9269037e96 100644 (file)
@@ -605,7 +605,7 @@ CREATE TABLE wcf1_file (
        fileSize BIGINT NOT NULL,
        fileHash CHAR(64) NOT NULL,
        fileExtension VARCHAR(10) NOT NULL,
-       secret CHAR(20) NOT NULL,
+       secret CHAR(32) NOT NULL,
        objectTypeID INT,
        mimeType VARCHAR(255) NOT NULL,
        width INT,