diff -Nur --no-dereference phpki-ng.old/phpki-ng-0.84/ns_revoke_query.php phpki-ng/phpki-ng-0.84/ns_revoke_query.php --- phpki-ng.old/phpki-ng-0.84/ns_revoke_query.php 2022-11-18 14:43:19.940000000 -0500 +++ phpki-ng/phpki-ng-0.84/ns_revoke_query.php 2022-12-14 16:49:46.524000000 -0500 @@ -16,13 +16,16 @@ # include('./config.php'); include(STORE_DIR.'/config/config.php'); - -$serial = escapeshellcmd(trim($_SERVER['QUERY_STRING'])); +$serial=trim($_SERVER['QUERY_STRING']); +if ( ! is_numeric($serial) ) { + # if it is not a numerical serial, then it is not revoked! + print '0'; + exit; +} +$serial = escapeshellcmd($serial); #header("Content-type: application/x-netscape-revocation"); -# old Reg Ex doesnt work, new should do the work -#$regexp = "^R\t.*\t.*\t$serial\t.*\t.*$"; -$regexp = "^R.*$serial.*$"; +$regexp = "^R\t.*\t.*\t$serial\t.*\t.*$"; $configIndex = $config['index']; if (exec("egrep '$regexp' '$configIndex'")) {