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
20
tests/fixtures/realistic/sqli_xlang/SqliJavaParamSafe.java
vendored
Normal file
20
tests/fixtures/realistic/sqli_xlang/SqliJavaParamSafe.java
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
// Phase 15 negative — JPA parameterised query. `setParameter` is a
|
||||
// SQL_QUERY sanitizer in `labels/java.rs`, but the deciding factor for
|
||||
// this fixture is that the SQL template fed to `entityManager
|
||||
// .createQuery` is a constant — no taint reaches the sink. Bind
|
||||
// values are constants too, mirroring phase 07's safe-parameterised
|
||||
// approach.
|
||||
package com.example;
|
||||
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.Query;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class SqliJavaParamSafe {
|
||||
public Object lookup(HttpServletRequest request, EntityManager entityManager) {
|
||||
String _unused = request.getParameter("name");
|
||||
Query q = entityManager.createQuery("SELECT u FROM User u WHERE u.id = :id");
|
||||
q.setParameter("id", 1L);
|
||||
return q.getResultList();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue