mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-18 20:15:14 +02:00
Critical bug fixes and recall improvements (#68)
This commit is contained in:
parent
7d0e7320e2
commit
55247b7fcd
352 changed files with 60069 additions and 900 deletions
16
tests/fixtures/realistic/sqli_xlang/SqliJavaHibernateNative.java
vendored
Normal file
16
tests/fixtures/realistic/sqli_xlang/SqliJavaHibernateNative.java
vendored
Normal 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();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue