Prevents EPP server from logging sensitive data

This commit is contained in:
Pinga 2025-03-14 18:54:04 +02:00
parent 8ed1d1811a
commit a8b95dd087

View file

@ -471,6 +471,8 @@ function createTransaction($db, $clid, $clTRID, $clTRIDframe) {
$dateForClTransaction = microtime(true); $dateForClTransaction = microtime(true);
$clmicrosecond = sprintf("%06d", ($dateForClTransaction - floor($dateForClTransaction)) * 1000000); $clmicrosecond = sprintf("%06d", ($dateForClTransaction - floor($dateForClTransaction)) * 1000000);
$clTRIDframe = preg_replace('/(<(?:pw|newPW|domain:pw|domain:ext|contact:pw|contact:ext)>)(.*?)(<\/(?:pw|newPW|domain:pw|domain:ext|contact:pw|contact:ext)>)/iu', '${1}*****${3}', $clTRIDframe);
if (empty($clTRID)) { if (empty($clTRID)) {
// If $clTRID is empty, generate a random string prefixed with "client-not-provided-" // If $clTRID is empty, generate a random string prefixed with "client-not-provided-"
$clTRID = 'client-not-provided-' . bin2hex(random_bytes(8)); // Generates a 16 character hexadecimal string $clTRID = 'client-not-provided-' . bin2hex(random_bytes(8)); // Generates a 16 character hexadecimal string
@ -506,6 +508,8 @@ function updateTransaction($db, $cmd, $obj_type, $obj_id, $code, $msg, $svTRID,
$dateForSvTransaction = microtime(true); $dateForSvTransaction = microtime(true);
$svmicrosecond = sprintf("%06d", ($dateForSvTransaction - floor($dateForSvTransaction)) * 1000000); $svmicrosecond = sprintf("%06d", ($dateForSvTransaction - floor($dateForSvTransaction)) * 1000000);
$svTRIDframe = preg_replace('/(<(?:pw|newPW|domain:pw|domain:ext|contact:pw|contact:ext)>)(.*?)(<\/(?:pw|newPW|domain:pw|domain:ext|contact:pw|contact:ext)>)/iu', '${1}*****${3}', $svTRIDframe);
// Execute the statement // Execute the statement
if (!$stmt->execute([ if (!$stmt->execute([
$cmd, $cmd,