Lauri Ojansivu
be6ebb2503
Fix CodeQL js/biased-cryptographic-random in schema upgrade randomId.
...
256 is not a multiple of the 55-character id alphabet, so the plain
byte % 55 mapping skewed generated document ids toward the first
characters. randomId now uses rejection sampling: bytes at or above the
largest multiple of the alphabet size (220) are discarded and resampled,
so every character is equally likely. Ids stay Meteor-style 17-char and
exact-length for custom lengths. Resolves code scanning alert #422 .
Tests: tests/schemaUpgradeSteps.test.cjs gains a rejection-sampling
guard (negative case pins that out-of-range bytes are never wrapped).
Thanks to xet7.
2026-07-17 04:52:30 +03:00
..
2026-06-18 04:14:59 +03:00
2026-07-16 20:01:10 +03:00
2026-06-23 16:50:24 +03:00
2026-07-17 03:27:33 +03:00
2026-05-27 20:51:44 +03:00
2026-07-17 03:34:23 +03:00
2026-07-17 03:21:02 +03:00
2026-07-17 03:34:23 +03:00
2026-07-16 17:40:24 +03:00
2026-07-17 03:07:59 +03:00
2026-07-17 01:43:53 +03:00
2026-07-05 23:22:16 +03:00
2026-07-13 09:16:33 +03:00
2026-07-11 01:53:07 +03:00
2026-07-11 00:14:49 +03:00
2026-07-11 00:14:49 +03:00
2026-07-17 03:41:20 +03:00
2026-07-09 09:45:53 +03:00
2026-07-09 09:45:53 +03:00
2026-07-17 03:07:59 +03:00
2026-07-17 03:34:23 +03:00
2026-07-08 23:57:39 +03:00
2026-07-17 03:07:59 +03:00
2026-07-09 02:14:07 +03:00
2026-06-23 08:50:29 +03:00
2026-07-16 17:40:24 +03:00
2026-07-17 03:34:23 +03:00
2026-07-05 23:12:16 +03:00
2026-06-13 17:19:51 +03:00
2026-07-06 11:19:15 +03:00
2026-07-11 00:14:49 +03:00
2026-07-05 22:23:36 +03:00
2026-07-06 13:49:44 +03:00
2026-07-17 03:07:59 +03:00
2026-07-09 09:45:53 +03:00
2026-07-17 03:21:02 +03:00
2026-07-16 17:40:24 +03:00
2026-07-09 02:14:07 +03:00
2026-07-16 17:40:24 +03:00
2026-07-16 18:54:28 +03:00
2026-07-17 03:21:02 +03:00
2026-07-17 03:34:52 +03:00
2026-06-23 16:47:00 +03:00
2026-07-05 22:54:13 +03:00
2026-07-09 02:14:07 +03:00
2026-07-06 18:27:38 +03:00
2026-07-09 09:45:53 +03:00
2026-07-09 02:14:07 +03:00
2026-07-16 19:12:59 +03:00
2026-07-16 17:40:24 +03:00
2026-06-22 15:46:43 +03:00
2026-07-16 17:40:24 +03:00
2026-07-13 09:16:33 +03:00
2026-07-17 03:34:23 +03:00
2026-07-13 09:16:33 +03:00
2026-07-17 03:30:07 +03:00
2026-07-17 03:07:59 +03:00
2026-07-06 16:02:56 +03:00
2026-07-17 03:36:07 +03:00
2026-07-09 09:45:53 +03:00
2026-07-09 02:14:07 +03:00
2026-07-17 03:34:23 +03:00
2026-07-17 03:07:59 +03:00
2026-07-16 10:17:13 +02:00
2026-07-17 03:07:59 +03:00
2026-07-13 09:16:33 +03:00
2026-07-17 03:07:59 +03:00
2026-07-09 09:45:53 +03:00
2026-06-23 16:48:59 +03:00
2026-07-06 15:22:22 +03:00
2026-07-06 11:35:56 +03:00
2026-07-06 01:25:39 +03:00
2026-07-09 09:45:53 +03:00
2026-07-09 02:14:07 +03:00
2026-07-17 03:07:59 +03:00
2026-05-27 20:51:44 +03:00
2026-07-17 04:52:30 +03:00
2026-07-17 03:07:59 +03:00
2026-07-09 10:09:32 +03:00
2026-06-23 16:36:14 +03:00
2026-07-11 00:14:49 +03:00
2026-07-06 10:55:29 +03:00
2026-07-17 03:07:59 +03:00
2026-07-17 03:07:59 +03:00
2026-07-17 03:07:59 +03:00
2026-07-09 02:14:07 +03:00
2026-07-06 15:12:21 +03:00
2026-07-17 03:34:23 +03:00
2026-07-06 10:33:15 +03:00
2026-07-09 02:14:07 +03:00
2026-06-23 08:50:29 +03:00
2026-07-09 02:14:07 +03:00
2026-07-13 09:16:33 +03:00
2026-07-09 09:45:53 +03:00
2026-07-09 02:14:07 +03:00
2026-07-16 17:40:24 +03:00
2026-07-17 03:36:50 +03:00
2026-07-06 10:43:26 +03:00
2026-07-17 03:36:50 +03:00
2026-07-17 03:36:50 +03:00
2026-07-17 04:52:30 +03:00
2026-07-09 09:45:53 +03:00
2026-07-16 17:40:24 +03:00
2026-07-09 02:14:07 +03:00
2026-07-06 01:26:05 +03:00
2026-07-13 09:16:33 +03:00
2026-07-13 09:16:33 +03:00
2026-07-17 03:21:02 +03:00
2026-07-17 03:21:28 +03:00
2026-07-09 09:45:53 +03:00
2026-07-16 18:46:09 +03:00
2026-07-17 03:34:23 +03:00
2026-07-17 03:44:38 +03:00
2026-07-08 23:43:26 +03:00
2026-07-09 09:45:53 +03:00
2026-07-17 03:12:43 +03:00
2026-06-13 17:19:51 +03:00
2026-06-13 20:15:04 +03:00
2026-06-13 17:19:51 +03:00
2026-07-16 20:01:10 +03:00
2026-07-17 03:53:09 +03:00
2026-07-06 11:50:28 +03:00
2026-07-09 09:45:53 +03:00
2025-12-22 23:18:01 +02:00
2026-06-12 20:15:56 +03:00