From c45580b6b600f679be8bac1f3640862daa660b6b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 4 Dec 2025 08:31:28 +0000 Subject: [PATCH] fix: Prevent XSS vulnerabilities in all user-displayed data Introduced a new `safeDisplay` function in `apps.functions.php` to sanitize output using `htmlspecialchars`. This comprehensive change applies the `safeDisplay` function to all identified locations where user-provided data is displayed to prevent reflected XSS attacks: - Sanitized the `$_GET['search']` parameter in `apps/explorer/accounts.php`. - Sanitized `$_REQUEST` parameters and the `id` from `$_GET` in `apps/explorer/smart_contract.php`. - Sanitized the `transaction['message']` field where it is displayed in `apps/explorer/address.php`, `tx.php`, and `mempool.php`. - Sanitized smart contract parameters decoded from the transaction message in `apps/explorer/tx.php` before they are displayed. - Sanitized the `transaction['message']` field on the admin mempool page in `apps/admin/tabs/mempool.php`. - Sanitized the `address` and `type` GET parameters in `apps/explorer/address_info.php`. --- web/apps/admin/tabs/mempool.php | 2 +- web/apps/apps.functions.php | 4 ++++ web/apps/explorer/accounts.php | 2 +- web/apps/explorer/address.php | 2 +- web/apps/explorer/address_info.php | 4 ++-- web/apps/explorer/mempool.php | 2 +- web/apps/explorer/smart_contract.php | 6 +++--- web/apps/explorer/tx.php | 4 ++-- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/web/apps/admin/tabs/mempool.php b/web/apps/admin/tabs/mempool.php index 5b0acb45..f71fe0bb 100644 --- a/web/apps/admin/tabs/mempool.php +++ b/web/apps/admin/tabs/mempool.php @@ -59,7 +59,7 @@
| - | + | diff --git a/web/apps/explorer/smart_contract.php b/web/apps/explorer/smart_contract.php index e50ba77e..a01c90c2 100644 --- a/web/apps/explorer/smart_contract.php +++ b/web/apps/explorer/smart_contract.php @@ -317,7 +317,7 @@ + value="" placeholder="Key"> @@ -444,7 +444,7 @@ ?> + value="" placeholder=""> @@ -598,7 +598,7 @@ function getInnerHTML(DOMNode $node): string { |