File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,11 +416,20 @@ export function VersionDisplay({ onOpenReleaseNotes }: VersionDisplayProps = {})
416416 setShowUpdateConfirmation ( true ) ;
417417 } ;
418418
419+ // Helper to generate secure random string
420+ function getSecureRandomString ( length : number ) : string {
421+ const array = new Uint8Array ( length ) ;
422+ window . crypto . getRandomValues ( array ) ;
423+ // Convert to base36 string (alphanumeric)
424+ return Array . from ( array , b => b . toString ( 36 ) ) . join ( '' ) . substr ( 0 , length ) ;
425+ }
426+
419427 const handleConfirmUpdate = ( ) => {
420428 // Close the confirmation modal
421429 setShowUpdateConfirmation ( false ) ;
422430 // Start the actual update process
423- const sessionId = `update_${ Date . now ( ) } _${ Math . random ( ) . toString ( 36 ) . substr ( 2 , 9 ) } ` ;
431+ const randomSuffix = getSecureRandomString ( 9 ) ;
432+ const sessionId = `update_${ Date . now ( ) } _${ randomSuffix } ` ;
424433 const startTime = Date . now ( ) ;
425434
426435 setIsUpdating ( true ) ;
You can’t perform that action at this time.
0 commit comments