Update Owner.java

Signed-off-by: AulaEmpresaLKS <129507941+AulaEmpresaLKS@users.noreply.github.com>
This commit is contained in:
AulaEmpresaLKS 2025-03-31 11:55:48 +02:00 committed by GitHub
parent e90e323130
commit 473c3a694e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -138,19 +138,4 @@ public class Owner extends Person {
.append("telephone", this.telephone) .append("telephone", this.telephone)
.toString(); .toString();
} }
/**
* Método dummy para forzar que SonarQube detecte la siguiente ISSUE:
* "Change this code to not construct SQL queries directly from user-controlled data".
*
* NOTA: Este método NO se utiliza en la lógica del negocio y solo está presente
* para que el análisis estático detecte el patrón vulnerable.
*
* @param userInput entrada controlada por el usuario
* @return Consulta SQL construida de forma insegura
*/
public String buildVulnerableQuery(String userInput) {
String vulnerableQuery = "SELECT * FROM Users WHERE email = '" + userInput + "'";
return vulnerableQuery;
}
} }