JAVA-001 / Beginner
SQL injection through JPQL/HQL string concatenation
Why is this a problem?
Input becomes query syntax, allowing conditions to be bypassed and data to be leaked.
How to fix it
java
em.createQuery("select u from User u where u.name = :name", User.class)
.setParameter("name", name).getResultList();