From ca42f91cbdbf65bc15aa6ca58b804cef8dc068a6 Mon Sep 17 00:00:00 2001 From: anupamme Date: Mon, 24 Aug 2026 12:24:03 +0000 Subject: [PATCH] harden: executing non-constant commands in Account.php Executing non-constant commands Addresses php.lang.security.exec-use.exec-use --- include/class/Account.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/class/Account.php b/include/class/Account.php index 9b3776cb..33b04ac5 100755 --- a/include/class/Account.php +++ b/include/class/Account.php @@ -31,8 +31,8 @@ public static function generateAcccount() $in = sys_get_temp_dir() . "/phpcoin.in.pem"; $out = sys_get_temp_dir() . "/phpcoin.out.pem"; file_put_contents($in, $pvkey); - $cmd = "openssl ec -in $in -out $out >/dev/null 2>&1"; - shell_exec($cmd); + $proc = proc_open(['openssl', 'ec', '-in', $in, '-out', $out], [], $pipes); + if (is_resource($proc)) proc_close($proc); $pvkey = file_get_contents($out); unlink($in); unlink($out);