refactor: use random_int() for email change verification codes (#9226)

This commit is contained in:
Andras Bacsai authored and GitHub committed 2026-03-28 15:18:00 +01:00
commit 3b2e6e11f1
4 files changed
+128 -2

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
<?php
/**
* Architecture tests to prevent use of insecure PRNGs in application code.
*
* mt_rand() and rand() are not cryptographically secure. Use random_int()
* or random_bytes() instead for any security-sensitive context.
*
* @see GHSA-33rh-4c9r-74pf
*/
arch('app code must not use mt_rand')
->expect('App')
->not->toUse(['mt_rand', 'mt_srand']);
arch('app code must not use rand')
->expect('App')
->not->toUse(['rand', 'srand']);