From 802cb47abb4af18fdbe1357b2bb0281c80695b4a Mon Sep 17 00:00:00 2001 From: htomasz Date: Wed, 8 Apr 2026 20:50:41 +0200 Subject: [PATCH] Potential fix for code scanning alert no. 25: Insecure randomness Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- vultron/vultron-zebrania-card.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vultron/vultron-zebrania-card.js b/vultron/vultron-zebrania-card.js index 1468682..9f4599f 100644 --- a/vultron/vultron-zebrania-card.js +++ b/vultron/vultron-zebrania-card.js @@ -1,7 +1,13 @@ class VultronZebraniaCard extends HTMLElement { constructor() { super(); - this._uid = 'vz-' + Math.random().toString(36).substr(2, 9); + this._uid = 'vz-' + ( + globalThis.crypto?.randomUUID + ? globalThis.crypto.randomUUID() + : Array.from(globalThis.crypto.getRandomValues(new Uint8Array(16))) + .map((b) => b.toString(16).padStart(2, '0')) + .join('') + ); this._sortOrder = null; this._cachedSignature = null; this._currentZebrania = [];