mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +02:00
[pitboss] phase 14: Track B — Java harness emitter shapes
This commit is contained in:
parent
7628c48930
commit
bd1bd0ce84
36 changed files with 1793 additions and 155 deletions
22
tests/dynamic_fixtures/java/spring_controller/Vuln.java
Normal file
22
tests/dynamic_fixtures/java/spring_controller/Vuln.java
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Phase 14 — Spring `@RestController`, vulnerable.
|
||||
//
|
||||
// Controller declares an `@Autowired CommandRunner` field so the
|
||||
// Phase 09 Java import-extractor sees the Spring annotation surface.
|
||||
// The harness instantiates the controller via reflection and invokes
|
||||
// `run(payload)`; the field stays null at runtime (no Spring DI), so
|
||||
// the handler constructs the helper on demand.
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/run")
|
||||
public class Vuln {
|
||||
@Autowired
|
||||
private CommandRunner runner;
|
||||
|
||||
public String run(String payload) throws Exception {
|
||||
System.out.print("__NYX_SINK_HIT__\n");
|
||||
CommandRunner r = (runner != null) ? runner : new CommandRunner();
|
||||
String out = r.run("echo hello " + payload);
|
||||
System.out.print(out);
|
||||
return out;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue