blitzstrike 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/bench/corpus/java-cmd-vuln.md +8 -0
  3. package/bench/corpus/java-deser-vuln.md +8 -0
  4. package/bench/corpus/java-sqli-prep.md +9 -0
  5. package/bench/corpus/java-sqli-vuln.md +9 -0
  6. package/bench/corpus/java-ssrf-vuln.md +9 -0
  7. package/bench/corpus/java-xss-vuln.md +8 -0
  8. package/bench/corpus/java-xxe-vuln.md +10 -0
  9. package/bench/corpus/js-cmd-spawn.md +8 -0
  10. package/bench/corpus/js-cmd-vuln.md +8 -0
  11. package/bench/corpus/js-eval-vuln.md +8 -0
  12. package/bench/corpus/js-pathtraversal-vuln.md +8 -0
  13. package/bench/corpus/js-redirect-vuln.md +8 -0
  14. package/bench/corpus/js-sqli-param.md +8 -0
  15. package/bench/corpus/js-ssrf-vuln.md +8 -0
  16. package/bench/corpus/{js-xss-sanitized.md → js-xss-escape.md} +1 -1
  17. package/bench/corpus/js-xss-vuln.md +8 -0
  18. package/bench/corpus/php-cmd-authgated.md +8 -0
  19. package/bench/corpus/php-cmd-byref.md +11 -0
  20. package/bench/corpus/php-cmd-escaped.md +9 -0
  21. package/bench/corpus/php-cmd-escapeshellcmd.md +9 -0
  22. package/bench/corpus/php-cmd-intval.md +9 -0
  23. package/bench/corpus/php-cmd-passthru.md +9 -0
  24. package/bench/corpus/php-cmd-shell-exec.md +9 -0
  25. package/bench/corpus/php-cmd-transitive.md +10 -0
  26. package/bench/corpus/{php-command-injection-vuln.md → php-cmd-vuln.md} +1 -1
  27. package/bench/corpus/php-codeexec-assert.md +9 -0
  28. package/bench/corpus/php-codeexec-vuln.md +9 -0
  29. package/bench/corpus/php-fileupload-name.md +9 -0
  30. package/bench/corpus/php-fileupload-sanitized.md +9 -0
  31. package/bench/corpus/php-fileupload-vuln.md +9 -0
  32. package/bench/corpus/php-filewrite-vuln.md +9 -0
  33. package/bench/corpus/php-include-intval.md +9 -0
  34. package/bench/corpus/php-include-require.md +9 -0
  35. package/bench/corpus/php-include-vuln.md +9 -0
  36. package/bench/corpus/php-include-whitelist.md +10 -0
  37. package/bench/corpus/php-redirect-safe.md +9 -0
  38. package/bench/corpus/php-redirect-vuln.md +9 -0
  39. package/bench/corpus/php-sqli-authgated.md +9 -0
  40. package/bench/corpus/php-sqli-esc.md +9 -0
  41. package/bench/corpus/php-sqli-filter.md +9 -0
  42. package/bench/corpus/php-sqli-getvar.md +9 -0
  43. package/bench/corpus/php-sqli-interproc.md +10 -0
  44. package/bench/corpus/php-sqli-whereraw.md +9 -0
  45. package/bench/corpus/php-ssrf-curl.md +11 -0
  46. package/bench/corpus/php-ssrf-vuln.md +9 -0
  47. package/bench/corpus/php-ssrf-wpremote.md +9 -0
  48. package/bench/corpus/php-unserialize-vuln.md +9 -0
  49. package/bench/corpus/php-xss-attr.md +9 -0
  50. package/bench/corpus/php-xss-authgated.md +8 -0
  51. package/bench/corpus/php-xss-eschtml.md +9 -0
  52. package/bench/corpus/php-xss-htmlentities.md +9 -0
  53. package/bench/corpus/php-xss-return.md +9 -0
  54. package/bench/corpus/php-xss-ternary.md +9 -0
  55. package/bench/corpus/php-xss-vuln.md +9 -0
  56. package/bench/corpus/php-xxe-vuln.md +9 -0
  57. package/bench/corpus/php-zipslip-vuln.md +10 -0
  58. package/bench/corpus/py-cmd-subprocess.md +9 -0
  59. package/bench/corpus/{py-command-injection-vuln.md → py-cmd-vuln.md} +3 -3
  60. package/bench/corpus/py-deser-json.md +9 -0
  61. package/bench/corpus/py-deser-vuln.md +9 -0
  62. package/bench/corpus/py-eval-vuln.md +8 -0
  63. package/bench/corpus/py-pathtraversal-vuln.md +8 -0
  64. package/bench/corpus/py-sqli-param.md +9 -0
  65. package/bench/corpus/py-sqli-vuln.md +9 -0
  66. package/bench/corpus/py-ssrf-vuln.md +9 -0
  67. package/bench/corpus/py-xss-vuln.md +8 -0
  68. package/dist/index.js +369 -97
  69. package/package.json +1 -1
  70. package/bench/corpus/java-command-injection-vuln.md +0 -7
  71. package/bench/corpus/php-file-upload-vuln.md +0 -9
  72. package/bench/corpus/py-command-injection-sanitized.md +0 -9
package/CHANGELOG.md CHANGED
@@ -5,6 +5,49 @@ All notable changes to Blitz Strike are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [1.0.37] — 2026-09-13
9
+
10
+ ### Added
11
+
12
+ - **Phase 4 — Differential security analysis** (`src/differential.ts`):
13
+ - `analyzeDifferential(old, new, language)` — compares two code versions and
14
+ surfaces only security-sensitive changes:
15
+ - **new vulnerability** (source→sink path present only in new code — authoritative, engine-backed)
16
+ - **fixed vulnerability** (path present only in old code)
17
+ - **new sink** / **new source** (line-level hints)
18
+ - **sanitizer removed** / **authorization removed** (high-severity signals)
19
+ - `analyzeDifferentialFiles(old_path, new_path)` — file-based comparison.
20
+ - `analyzeGitDiff(repo, base, head)` — runs across a git commit range.
21
+ - New MCP tool `diff_analyze` (supports file-pair, code-pair, or git-diff mode).
22
+
23
+ ## [1.0.36] — 2026-09-13
24
+
25
+ ### Added
26
+
27
+ - **Phase 3 — Benchmark expansion** (`scripts/generate-corpus.py` + 70-fixture corpus):
28
+ - Corpus grown 10 → **70 fixtures** (49 vulnerable + 21 patched/safe), covering
29
+ 11 sink types × 4 languages (PHP/JS/Python/Java) × vulnerable/patched pairs.
30
+ - Benchmark now scores **detection 1.0 / FP 0 / FN 0 / precision 1.0**.
31
+ - Benchmark PHP fixtures now run through **EAGLE-EYE 2.0** (`analyzeDataFlow2`),
32
+ so return/byref/ternary/transitive cases are measured.
33
+
34
+ ### Fixed (engine gaps exposed by the expanded corpus)
35
+
36
+ - **PHP**: `include`/`require`/`include_once`/`require_once` and `eval` are
37
+ statement nodes (not calls) — now handled as sinks.
38
+ - **PHP**: `sinkClassOf` now prefixes `$` to property-lookup bases, so
39
+ `$wpdb->get_var`/`$wpdb->get_results` are classified correctly.
40
+ - **PHP**: method chains (`DB::table()->whereRaw()->get()`) — nested sinks are
41
+ now detected by recursing into the chain base.
42
+ - **PHP**: `in_array`/`preg_match`/`ctype_*`/`is_numeric` whitelist guards are
43
+ recognized as input-validation gates (sinks inside them are suppressed).
44
+ - **PHP**: `wp_safe_redirect` is the *safe* redirect (removed from the redirect sink).
45
+ - **Universal adapters**: added SSRF sinks (JS `http.get`/`axios`, Python
46
+ `requests.*`, Java `new URL`/`openConnection`), path-traversal (JS
47
+ `fs.readFile`), and XXE (Java `DocumentBuilder`/`SAXParser`).
48
+ - **Universal adapters**: parameterized SQL (`?` placeholder + params) and
49
+ Python `subprocess` list-form (no shell) are now recognized as safe.
50
+
8
51
  ## [1.0.35] — 2026-09-13
9
52
 
10
53
  ### Added
@@ -0,0 +1,8 @@
1
+ - id: java-cmd-vuln
2
+ - language: java
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```java
6
+ String cmd = request.getParameter("cmd");
7
+ Runtime.getRuntime().exec(cmd);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: java-deser-vuln
2
+ - language: java
3
+ - vulnerable: true
4
+ - sink_type: deserialization
5
+ ```java
6
+ ObjectInputStream ois = new ObjectInputStream(request.getInputStream());
7
+ ois.readObject();
8
+ ```
@@ -0,0 +1,9 @@
1
+ - id: java-sqli-prep
2
+ - language: java
3
+ - vulnerable: false
4
+ - sink_type: sql_execution
5
+ ```java
6
+ String id = request.getParameter("id");
7
+ PreparedStatement ps = conn.prepareStatement("SELECT * FROM t WHERE id=?");
8
+ ps.setString(1, id);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: java-sqli-vuln
2
+ - language: java
3
+ - vulnerable: true
4
+ - sink_type: sql_execution
5
+ ```java
6
+ String id = request.getParameter("id");
7
+ Statement st = conn.createStatement();
8
+ st.executeQuery("SELECT * FROM t WHERE id=" + id);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: java-ssrf-vuln
2
+ - language: java
3
+ - vulnerable: true
4
+ - sink_type: http_request
5
+ ```java
6
+ String url = request.getParameter("url");
7
+ URL u = new URL(url);
8
+ u.openConnection();
9
+ ```
@@ -0,0 +1,8 @@
1
+ - id: java-xss-vuln
2
+ - language: java
3
+ - vulnerable: true
4
+ - sink_type: html_render
5
+ ```java
6
+ String x = request.getParameter("x");
7
+ response.getWriter().write(x);
8
+ ```
@@ -0,0 +1,10 @@
1
+ - id: java-xxe-vuln
2
+ - language: java
3
+ - vulnerable: true
4
+ - sink_type: xml_processing
5
+ ```java
6
+ InputStream in = request.getInputStream();
7
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
8
+ DocumentBuilder db = dbf.newDocumentBuilder();
9
+ db.parse(in);
10
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-cmd-spawn
2
+ - language: javascript
3
+ - vulnerable: false
4
+ - sink_type: command_execution
5
+ ```javascript
6
+ const c = req.query.cmd;
7
+ spawn("ls", [c]);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-cmd-vuln
2
+ - language: javascript
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```javascript
6
+ const c = req.query.cmd;
7
+ exec("ls " + c);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-eval-vuln
2
+ - language: javascript
3
+ - vulnerable: true
4
+ - sink_type: code_execution
5
+ ```javascript
6
+ const c = req.body.code;
7
+ eval(c);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-pathtraversal-vuln
2
+ - language: javascript
3
+ - vulnerable: true
4
+ - sink_type: file_operations
5
+ ```javascript
6
+ const f = req.query.file;
7
+ fs.readFile("/data/" + f);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-redirect-vuln
2
+ - language: javascript
3
+ - vulnerable: true
4
+ - sink_type: redirect
5
+ ```javascript
6
+ const u = req.query.url;
7
+ res.redirect(u);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-sqli-param
2
+ - language: javascript
3
+ - vulnerable: false
4
+ - sink_type: sql_execution
5
+ ```javascript
6
+ const id = req.query.id;
7
+ db.query("SELECT * FROM t WHERE id=?", [id]);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: js-ssrf-vuln
2
+ - language: javascript
3
+ - vulnerable: true
4
+ - sink_type: http_request
5
+ ```javascript
6
+ const u = req.query.url;
7
+ http.get(u, cb);
8
+ ```
@@ -1,4 +1,4 @@
1
- - id: js-xss-sanitized
1
+ - id: js-xss-escape
2
2
  - language: javascript
3
3
  - vulnerable: false
4
4
  - sink_type: html_render
@@ -0,0 +1,8 @@
1
+ - id: js-xss-vuln
2
+ - language: javascript
3
+ - vulnerable: true
4
+ - sink_type: html_render
5
+ ```javascript
6
+ const x = req.query.x;
7
+ res.send(x);
8
+ ```
@@ -0,0 +1,8 @@
1
+ - id: php-cmd-authgated
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ if (is_user_logged_in()) { system($_GET["c"]); }
8
+ ```
@@ -0,0 +1,11 @@
1
+ - id: php-cmd-byref
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ function fill(&$out) { $out = $_GET["cmd"]; }
8
+ $c = "";
9
+ fill($c);
10
+ system($c);
11
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-cmd-escaped
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ $cmd = $_GET["cmd"];
8
+ system(escapeshellarg($cmd));
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-cmd-escapeshellcmd
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ $c = $_GET["c"];
8
+ system(escapeshellcmd($c));
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-cmd-intval
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ $n = $_GET["n"];
8
+ system("ping -c " . intval($n));
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-cmd-passthru
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ $cmd = $_GET["cmd"];
8
+ passthru($cmd);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-cmd-shell-exec
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ $cmd = $_GET["cmd"];
8
+ shell_exec($cmd);
9
+ ```
@@ -0,0 +1,10 @@
1
+ - id: php-cmd-transitive
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: command_execution
5
+ ```php
6
+ <?php
7
+ function a($v) { b($v); }
8
+ function b($v) { system($v); }
9
+ a($_GET["cmd"]);
10
+ ```
@@ -1,4 +1,4 @@
1
- - id: php-command-injection-vuln
1
+ - id: php-cmd-vuln
2
2
  - language: php
3
3
  - vulnerable: true
4
4
  - sink_type: command_execution
@@ -0,0 +1,9 @@
1
+ - id: php-codeexec-assert
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: code_execution
5
+ ```php
6
+ <?php
7
+ $code = $_GET["code"];
8
+ assert($code);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-codeexec-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: code_execution
5
+ ```php
6
+ <?php
7
+ $code = $_GET["code"];
8
+ eval($code);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-fileupload-name
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: file_operations
5
+ ```php
6
+ <?php
7
+ $f = $_FILES["f"];
8
+ move_uploaded_file($f["tmp_name"], $f["name"]);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-fileupload-sanitized
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: file_operations
5
+ ```php
6
+ <?php
7
+ $f = $_FILES["u"];
8
+ move_uploaded_file($f["tmp_name"], "/uploads/" . sanitize_file_name($f["name"]));
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-fileupload-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: file_operations
5
+ ```php
6
+ <?php
7
+ $f = $_FILES["u"];
8
+ move_uploaded_file($f["tmp_name"], "/uploads/" . $f["name"]);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-filewrite-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: file_operations
5
+ ```php
6
+ <?php
7
+ $data = $_POST["data"];
8
+ file_put_contents("/tmp/log.txt", $data);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-include-intval
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: file_inclusion
5
+ ```php
6
+ <?php
7
+ $id = $_GET["id"];
8
+ include("/pages/" . intval($id) . ".php");
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-include-require
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: file_inclusion
5
+ ```php
6
+ <?php
7
+ $m = $_GET["m"];
8
+ require($m . ".php");
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-include-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: file_inclusion
5
+ ```php
6
+ <?php
7
+ $page = $_GET["page"];
8
+ include($page . ".php");
9
+ ```
@@ -0,0 +1,10 @@
1
+ - id: php-include-whitelist
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: file_inclusion
5
+ ```php
6
+ <?php
7
+ $page = $_GET["page"];
8
+ $allow = ["home", "about"];
9
+ if (in_array($page, $allow)) { include($page . ".php"); }
10
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-redirect-safe
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: redirect
5
+ ```php
6
+ <?php
7
+ $url = $_GET["url"];
8
+ wp_safe_redirect($url);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-redirect-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: redirect
5
+ ```php
6
+ <?php
7
+ $url = $_GET["url"];
8
+ header("Location: " . $url);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-sqli-authgated
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: sql_execution
5
+ ```php
6
+ <?php
7
+ function del($id) { if (current_user_can("x")) { global $wpdb; $wpdb->query("DELETE FROM t WHERE id=$id"); } }
8
+ del($_GET["id"]);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-sqli-esc
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: sql_execution
5
+ ```php
6
+ <?php
7
+ $id = $_GET["id"];
8
+ $q = $wpdb->query("SELECT * FROM t WHERE id=" . esc_sql($id));
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-sqli-filter
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: sql_execution
5
+ ```php
6
+ <?php
7
+ $id = filter_var($_GET["id"], FILTER_VALIDATE_INT);
8
+ $wpdb->query("SELECT * FROM t WHERE id=$id");
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-sqli-getvar
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: sql_execution
5
+ ```php
6
+ <?php
7
+ $id = $_GET["id"];
8
+ $wpdb->get_var("SELECT name FROM t WHERE id=$id");
9
+ ```
@@ -0,0 +1,10 @@
1
+ - id: php-sqli-interproc
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: sql_execution
5
+ ```php
6
+ <?php
7
+ function run_q($id) { global $wpdb; $wpdb->query("SELECT * FROM t WHERE id=$id"); }
8
+ $id = $_GET["id"];
9
+ run_q($id);
10
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-sqli-whereraw
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: sql_execution
5
+ ```php
6
+ <?php
7
+ $id = $_GET["id"];
8
+ DB::table("t")->whereRaw("id = $id")->get();
9
+ ```
@@ -0,0 +1,11 @@
1
+ - id: php-ssrf-curl
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: http_request
5
+ ```php
6
+ <?php
7
+ $u = $_GET["u"];
8
+ $ch = curl_init();
9
+ curl_setopt($ch, CURLOPT_URL, $u);
10
+ curl_exec($ch);
11
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-ssrf-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: http_request
5
+ ```php
6
+ <?php
7
+ $url = $_GET["url"];
8
+ file_get_contents($url);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-ssrf-wpremote
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: http_request
5
+ ```php
6
+ <?php
7
+ $url = $_GET["url"];
8
+ wp_remote_get($url);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-unserialize-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: deserialization
5
+ ```php
6
+ <?php
7
+ $data = $_COOKIE["data"];
8
+ unserialize($data);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xss-attr
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ $v = $_GET["v"];
8
+ echo esc_attr($v);
9
+ ```
@@ -0,0 +1,8 @@
1
+ - id: php-xss-authgated
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ if (current_user_can("edit")) { echo $_GET["x"]; }
8
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xss-eschtml
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ $name = $_GET["name"];
8
+ echo esc_html($name);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xss-htmlentities
2
+ - language: php
3
+ - vulnerable: false
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ $v = $_GET["v"];
8
+ echo htmlentities($v);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xss-return
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ function id($x) { return $x; }
8
+ echo id($_GET["q"]);
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xss-ternary
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ $t = isset($_GET["t"]) ? $_GET["t"] : "safe";
8
+ echo $t;
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xss-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: html_render
5
+ ```php
6
+ <?php
7
+ $name = $_GET["name"];
8
+ echo $name;
9
+ ```
@@ -0,0 +1,9 @@
1
+ - id: php-xxe-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: xml_processing
5
+ ```php
6
+ <?php
7
+ $xml = $_POST["xml"];
8
+ simplexml_load_string($xml);
9
+ ```
@@ -0,0 +1,10 @@
1
+ - id: php-zipslip-vuln
2
+ - language: php
3
+ - vulnerable: true
4
+ - sink_type: archive_extraction
5
+ ```php
6
+ <?php
7
+ $dest = $_GET["dest"];
8
+ $zip = new ZipArchive();
9
+ $zip->extractTo($dest);
10
+ ```
@@ -0,0 +1,9 @@
1
+ - id: py-cmd-subprocess
2
+ - language: python
3
+ - vulnerable: false
4
+ - sink_type: command_execution
5
+ ```python
6
+ import subprocess
7
+ cmd = request.args.get("cmd")
8
+ subprocess.run(["ls", cmd])
9
+ ```