Skip to content

Commit 2deb2a2

Browse files
committed
fix: switch from uuid1 to uuid4 for better randomness
1 parent eefc219 commit 2deb2a2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

flask_appbuilder/filemanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def get_save_format(self, filename, image):
224224

225225

226226
def uuid_namegen(file_data):
227-
return str(uuid.uuid1()) + "_sep_" + file_data.filename
227+
return str(uuid.uuid4()) + "_sep_" + file_data.filename
228228

229229

230230
def get_file_original_name(name):

flask_appbuilder/security/sqla/manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def add_register_user(
326326
method=current_app.config.get("FAB_PASSWORD_HASH_METHOD", "scrypt"),
327327
salt_length=current_app.config.get("FAB_PASSWORD_HASH_SALT_LENGTH", 16),
328328
)
329-
register_user.registration_hash = str(uuid.uuid1())
329+
register_user.registration_hash = str(uuid.uuid4())
330330
try:
331331
self.session.add(register_user)
332332
self.session.commit()

0 commit comments

Comments
 (0)