From 929931310faec447ee01ac56949e19497fc61e9e Mon Sep 17 00:00:00 2001 From: PlexicusAI Date: Fri, 7 Feb 2025 11:20:12 +0000 Subject: [PATCH] Cross-site Scripting --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 5600588..36caf90 100644 --- a/index.php +++ b/index.php @@ -33,7 +33,7 @@ if(isset($_GET['id'])) { // El siguiente código es vulnerable a XSS ya que imprime directamente en el HTML el contenido de una variable que puede ser manipulada por el usuario sin ninguna sanitización. if(isset($_GET['mensaje'])) { $mensaje = $_GET['mensaje']; // Input del usuario susceptible a XSS - echo "
$mensaje
"; // Vulnerable a XSS + echo "
" . htmlentities($mensaje, ENT_QUOTES, 'UTF-8') . "
"; // Sanitize user input to prevent XSS } // Cerrar conexión -- 2.45.2