From 088d777ec807421cbc5f77279c7014ab0d65d4ba Mon Sep 17 00:00:00 2001 From: Pinaki Bhattacharjee Date: Thu, 1 Aug 2024 01:17:12 +0530 Subject: [PATCH] Insecure randomness --- .../tests/cypress/cypress/e2e/mutations/dataset_ownership.js | 2 +- .../tests/cypress/cypress/e2e/mutations/ingestion_source.js | 2 +- .../tests/cypress/cypress/e2e/mutations/managing_secrets.js | 2 +- .../tests/cypress/cypress/e2e/settings/managing_groups.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/smoke-test/tests/cypress/cypress/e2e/mutations/dataset_ownership.js b/smoke-test/tests/cypress/cypress/e2e/mutations/dataset_ownership.js index 452e2eb3408d31..9c42d8395e543c 100644 --- a/smoke-test/tests/cypress/cypress/e2e/mutations/dataset_ownership.js +++ b/smoke-test/tests/cypress/cypress/e2e/mutations/dataset_ownership.js @@ -1,4 +1,4 @@ -const test_id = Math.floor(Math.random() * 100000); +const test_id = crypto.getRandomValues(new Uint32Array(1))[0]; const username = `Example Name ${test_id}`; const email = `example${test_id}@example.com`; const password = "Example password"; diff --git a/smoke-test/tests/cypress/cypress/e2e/mutations/ingestion_source.js b/smoke-test/tests/cypress/cypress/e2e/mutations/ingestion_source.js index 8707f090acad36..269553d7afa006 100644 --- a/smoke-test/tests/cypress/cypress/e2e/mutations/ingestion_source.js +++ b/smoke-test/tests/cypress/cypress/e2e/mutations/ingestion_source.js @@ -1,4 +1,4 @@ -const number = Math.floor(Math.random() * 100000); +const number = crypto.getRandomValues(new Uint32Array(1))[0]; const accound_id = `account${number}`; const warehouse_id = `warehouse${number}`; const username = `user${number}`; diff --git a/smoke-test/tests/cypress/cypress/e2e/mutations/managing_secrets.js b/smoke-test/tests/cypress/cypress/e2e/mutations/managing_secrets.js index dd331fbcbd5ae2..00e21b3a0bf884 100644 --- a/smoke-test/tests/cypress/cypress/e2e/mutations/managing_secrets.js +++ b/smoke-test/tests/cypress/cypress/e2e/mutations/managing_secrets.js @@ -1,4 +1,4 @@ -const number = Math.floor(Math.random() * 100000); +const number = crypto.getRandomValues(new Uint32Array(1))[0]; const accound_id = `account${number}`; const warehouse_id = `warehouse${number}`; const username = `user${number}`; diff --git a/smoke-test/tests/cypress/cypress/e2e/settings/managing_groups.js b/smoke-test/tests/cypress/cypress/e2e/settings/managing_groups.js index 247a9c8b9b2739..9a86f7e966e315 100644 --- a/smoke-test/tests/cypress/cypress/e2e/settings/managing_groups.js +++ b/smoke-test/tests/cypress/cypress/e2e/settings/managing_groups.js @@ -1,4 +1,4 @@ -const test_id = Math.floor(Math.random() * 100000); +const test_id = crypto.getRandomValues(new Uint32Array(1))[0]; const username = `Example Name ${test_id}`; const email = `example${test_id}@example.com`; const password = "Example password";