mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
|
|
@ -0,0 +1,23 @@
|
|||
// Phase 04 fixture: Spring controller method calls a helper that holds
|
||||
// the sink. The callgraph-aware spec-derivation path must rewrite the
|
||||
// harness entry to the controller method `runCommand`, not the helper
|
||||
// `execHelper`.
|
||||
|
||||
package fixture;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class SinkController {
|
||||
private void execHelper(String cmd) throws Exception {
|
||||
Runtime.getRuntime().exec(cmd); // sink: command injection
|
||||
}
|
||||
|
||||
@PostMapping("/run")
|
||||
public String runCommand(@RequestBody String cmd) throws Exception {
|
||||
execHelper(cmd);
|
||||
return "ok";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue