mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-09 19:45:13 +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/ssrf/SsrfJavaPositive.java
vendored
Normal file
21
tests/fixtures/realistic/ssrf/SsrfJavaPositive.java
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Phase 14 fixture (Java positive) — attacker-controlled URL passed to
|
||||
// `HttpClient.send`. The `HttpClient.newHttpClient()` factory call tags
|
||||
// the local `client` SSA value as `TypeKind::HttpClient`, so the
|
||||
// `client.send` callee resolves through the type-qualified rewrite to
|
||||
// `HttpClient.send` against the existing flat SSRF rule.
|
||||
import java.net.URI;
|
||||
import java.net.http.HttpClient;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class SsrfJavaPositive {
|
||||
public String proxy(HttpServletRequest req) throws Exception {
|
||||
String target = req.getParameter("url");
|
||||
URI uri = URI.create(target);
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
HttpRequest httpReq = HttpRequest.newBuilder().uri(uri).build();
|
||||
HttpResponse<String> resp = client.send(httpReq, HttpResponse.BodyHandlers.ofString());
|
||||
return resp.body();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue