Skip to content

Commit e0c2aac

Browse files
Merge pull request #373 from Data-Research-Analysis/alert-autofix-91
Potential fix for code scanning alert no. 91: Insecure randomness
2 parents bf37e5f + 1cab28c commit e0c2aac

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • frontend/pages/projects/[projectid]/data-sources/connect

frontend/pages/projects/[projectid]/data-sources/connect/excel.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ async function createDataSource(classification = null) {
531531
let cacheInvalidated = false; // Track if cache has been invalidated
532532
533533
// Generate unique upload session ID to group all sheets together
534-
const uploadSessionId = `upload_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`;
534+
const secureRandomSuffix = globalThis.crypto.getRandomValues(new Uint32Array(1))[0].toString(36).padStart(7, '0').slice(0, 7);
535+
const uploadSessionId = `upload_${Date.now()}_${secureRandomSuffix}`;
535536
console.log('[Excel Upload] Starting upload session:', uploadSessionId);
536537
537538
// Show initial progress

0 commit comments

Comments
 (0)