Skip to content

Commit

Permalink
Mask all POST data that has a key which contains pass
Browse files Browse the repository at this point in the history
  • Loading branch information
the-djmaze committed Feb 27, 2024
1 parent 28d8bec commit 275ad40
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,16 @@ public function ServiceJson() : string

$this->oActions->logWrite('Action: '.$sMethodName, \LOG_INFO, 'JSON');

$aPost = $_POST ?? null;
if ($aPost) {
$this->oActions->SetActionParams($aPost, $sMethodName);
foreach ($aPost as $key => $value) {
if (false !== \stripos($key, 'Password')) {
$aPost[$key] = '*******';
if ($_POST) {
$this->oActions->SetActionParams($_POST, $sMethodName);
foreach ($_POST as $key => $value) {
// password & passphrase
if (false !== \stripos($key, 'pass')) {
// $_POST[$key] = '*******';
$this->oActions->logMask($value);
}
}
$this->oActions->logWrite(Utils::jsonEncode($aPost), \LOG_INFO, 'POST');
$this->oActions->logWrite(Utils::jsonEncode($_POST), \LOG_INFO, 'POST');
} else if (3 < \count($this->aPaths) && $this->oHttp->IsGet()) {
$this->oActions->SetActionParams(array(
'RawKey' => empty($this->aPaths[3]) ? '' : $this->aPaths[3]
Expand Down

0 comments on commit 275ad40

Please sign in to comment.