Skip to content

Commit 34bd2a9

Browse files
committed
fix(security): add error logging to JsonException catch blocks
1 parent bde6a7c commit 34bd2a9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

system/Security/Security.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,7 @@ private function removeTokenInRequest(IncomingRequest $request): void
295295
try {
296296
$json = json_decode($body, flags: JSON_THROW_ON_ERROR);
297297
} catch (JsonException) {
298+
log_message('error', 'Invalid JSON in request body during CSRF token removal');
298299
$json = null;
299300
}
300301

@@ -346,6 +347,7 @@ private function getPostedToken(IncomingRequest $request): ?string
346347
try {
347348
$json = json_decode($body, flags: JSON_THROW_ON_ERROR);
348349
} catch (JsonException) {
350+
log_message('error', 'Invalid JSON in request body during CSRF token retrieval');
349351
$json = null;
350352
}
351353

0 commit comments

Comments
 (0)