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
21
tests/fixtures/realistic/sqli_xlang/SqliJavaHibernateNamedSession.java
vendored
Normal file
21
tests/fixtures/realistic/sqli_xlang/SqliJavaHibernateNamedSession.java
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Hibernate `session.createNativeQuery` SQLi via arbitrary-named
|
||||
// receiver bound from `sessionFactory.openSession()`. The flat
|
||||
// `session.createNativeQuery` matcher in `labels/java.rs` only fires
|
||||
// when the receiver is literally named `session`; for any other name
|
||||
// (`sess` here) the type-qualified `HibernateSession.createNativeQuery`
|
||||
// rule fires via the `TypeKind::HibernateSession` fact attached to the
|
||||
// SSA value returned by `sessionFactory.openSession()`.
|
||||
package com.example;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.hibernate.Session;
|
||||
import org.hibernate.SessionFactory;
|
||||
|
||||
public class SqliJavaHibernateNamedSession {
|
||||
public void lookup(HttpServletRequest request, SessionFactory sf) {
|
||||
String name = request.getParameter("name");
|
||||
String sql = String.format("SELECT * FROM users WHERE name = '%s'", name);
|
||||
Session sess = sf.openSession();
|
||||
sess.createNativeQuery(sql);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue