Critical bug fixes and recall improvements (#68)

This commit is contained in:
Eli Peter 2026-05-11 12:42:39 -04:00 committed by GitHub
parent 7d0e7320e2
commit 55247b7fcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
352 changed files with 60069 additions and 900 deletions

View file

@ -0,0 +1,16 @@
// Phase 15 Hibernate `session.createNativeQuery` interpolation SQLi
// positive. `session.createNativeQuery` is a flat SQL_QUERY sink in
// `labels/java.rs`; the `String.format` call interpolates the user-
// controlled name into the SQL string with no parameterisation.
package com.example;
import javax.servlet.http.HttpServletRequest;
import org.hibernate.Session;
public class SqliJavaHibernateNative {
public Object lookup(HttpServletRequest request, Session session) {
String name = request.getParameter("name");
String sql = String.format("SELECT * FROM users WHERE name = '%s'", name);
return session.createNativeQuery(sql).getResultList();
}
}