From 0d85db2de5bd15c7a8730567f5ed7a367ea845a2 Mon Sep 17 00:00:00 2001 From: PlexicusAI Date: Fri, 7 Feb 2025 12:58:02 +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..5a9b339 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 output to prevent XSS } // Cerrar conexión