Skip to content

Conversation

@google-labs-jules
Copy link

This commit fixes multiple Cross-Site Scripting (XSS) vulnerabilities. A shared safeDisplay function was created to sanitize output using htmlspecialchars. This function was then applied to all identified locations where user-provided data, including transaction messages, smart contract parameters, and URL search parameters, is displayed back to the user. This prevents malicious scripts from being executed in the user's browser.


PR created automatically by Jules for task 14936323345649994863 started by @attogram

Introduced a new `safeDisplay` function to sanitize user input before it is displayed on the page. This function uses `htmlspecialchars` to prevent XSS attacks.

Applied the `safeDisplay` function to all identified locations where user-provided data is displayed, including transaction messages and search inputs.
Introduced a new `safeDisplay` function in `apps.functions.php` to sanitize output using `htmlspecialchars`.

This change applies the `safeDisplay` function to multiple locations to prevent reflected XSS attacks:
- Sanitized the `$_GET['search']` parameter in `apps/explorer/accounts.php`.
- Sanitized `$_REQUEST` parameters 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.
Introduced a new `safeDisplay` function in `apps.functions.php` to sanitize output using `htmlspecialchars`.

This change applies the `safeDisplay` function to multiple locations to prevent reflected XSS attacks:
- Sanitized the `$_GET['search']` parameter in `apps/explorer/accounts.php`.
- Sanitized `$_REQUEST` parameters 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant