## https://sploitus.com/exploit?id=96CF0386-DDF7-516A-8058-A2E4134E88A6
# β‘ JGD
### JavaGadgetDigger β Solving the Last Mile of Deserialization Vulnerability Discovery
[](https://python.org)
[](LICENSE)
[](https://openjdk.org)
π **[δΈζη](README.zh-CN.md)**
---
## What is JGD?
An **autonomous agent** that takes any JAR directory and produces:
1. **Known public chains** β four-state determination (PRESENT / VERSION / ASSEMBLE / FIRE)
2. **Novel unpublished chains** β discovered via static + dynamic analysis with adversarial LLM auditing
3. **Weaponized PoCs** β serialized payloads with RCE closure demo (benign marker file)
All decisions are internalized: `JARs in β chains out`, zero intermediate user input.
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Input: any JAR directory Output: chains + PoCs β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Known ββββΆβ Bridge ββββΆβ Chain ββββΆβ PoC β β
β β Chains β β Discoveryβ β Pairing β β Weapon β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β β β β β
β signature bytecode dynamic benign β
β + version + CHA graph + contract payload β
β gates + dispatch synthesis + fire β
β edges + 3 carriers test β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## π Discovered Novel Chains
### T1 β Novel Entry (ds confirmed: absent from all public corpora)
| Chain | Bridge Class | Carrier | JDK | Status |
|-------|-------------|---------|-----|--------|
| **objlongpair-hashmap** | `org.apache.activemq.artemis.api.core.ObjLongPair` | HashMap rehash | 17+ | β
RCE_CLOSED |
```
HashMap.readObject() β rehash β hash(key)
β ObjLongPair.hashCode() β Objects.hash(first, second)
β Arrays.hashCode() β first.hashCode() [Object field β isInstance always true]
β EqualsBean.hashCode() β beanHashCode()
β ObjectBean.toString() β ToStringBean.toString()
β Templates.getOutputProperties() β TemplatesImpl.newTransformer()
β TemplatesImpl.defineClass() β payload static block β RCE
```
> **Novelty**: Entry-side confirmed T1 by adversarial audit β absent from ysoserial,
> GadgetInspector, and all public CVE writeups. Orthogonal to all known ROME entry
> paradigms (direct ROME key / BAVE / HotSwappableTargetSource / XString).
### T2 β New Carriers (ds confirmed CONFIRM)
| Chain | Bridge Class | Library | Carrier | JDK | Status |
|-------|-------------|---------|---------|-----|--------|
| **mutableobj-bave** | `cn.hutool.core.lang.mutable.MutableObj` | hutool-core | BAVE toString | β€11 | β
RCE_CLOSED |
| **antlr4-pair-bave** | `org.antlr.v4.runtime.misc.Pair` | antlr4-runtime | BAVE toString | β€11 | β
RCE_CLOSED |
| **federationconfiguration-hashmap** | `FederationConfiguration` | Artemis | HashMap rehash | 17+ | β
RCE_CLOSED |
| **federationaddresspolicy** | `FederationAddressPolicyConfiguration` | Artemis | HashMap rehash | 17+ | β
RCE_CLOSED |
| **federationqueuepolicy** | `FederationQueuePolicyConfiguration` | Artemis | HashMap rehash | 17+ | β
RCE_CLOSED |
| **broadcastgroupconfiguration** | `BroadcastGroupConfiguration` | Artemis | HashMap rehash | 17+ | β
RCE_CLOSED |
### T3 β Variants
| Chain | Bridge Class | Library | Notes |
|-------|-------------|---------|-------|
| **ewah-hashmap** | `EWAHCompressedBitmap` | JavaEWAH (Lucene/ES) | Shallow dispatch, limited value |
π Full dispatch stacks (click to expand)
**ObjLongPair (T1, JDK 17):**
```
HashMap.put β HashMap.hash
β ObjLongPair.hashCode(ObjLongPair.java:55)
β Objects.hash β Arrays.hashCode
β EqualsBean.hashCode β EqualsBean.beanHashCode
β ObjectBean.toString β ToStringBean.toString β Method.invoke
β TemplatesImpl.defineClass β payload static block
```
**MutableObj (T2, JDK 11):**
```
BAVE.readObject β val.toString()
β MutableObj.toString β value.toString()
β ObjectBean.toString β ToStringBean.toString
β Templates.getOutputProperties β newTransformer β defineClass β RCE
```
## π Quick Start
### CLI Mode (batch audit)
```bash
# Install dependencies (Python 3.10+, JDK 11 & 17, ECJ compiler)
pip install chromadb # optional, for RAG persistence
# Point at any JAR directory and get chains + PoCs
python3 audit_target.py --target /path/to/jars --name "your-product"
```
### TUI Mode (interactive visualization)
```bash
python3 tui.py # English
python3 tui.py --lang zh # δΈζ
```
### Key Bindings (TUI)
| Key | Action |
|-----|--------|
| `β` `β` / `j` `k` | Navigate chains |
| `Enter` | Toggle detail view |
| `t` | Switch language (EN/CN) |
| `q` | Quit |
## π Project Structure
```
jgd/
βββ audit_target.py # Product CLI entry point
βββ tui.py # Interactive TUI
βββ jgd/ # Core agent modules (25)
β βββ verify_agent.py # Bridge discovery + ds adversarial audit
β βββ chain_complete.py # Chain pairing + exhaustion proof
β βββ poc_gen.py # Weaponized PoC generation
β βββ known_chains.py # Public chain four-state determination
β βββ matrix_agent.py # Multi-JDK probe orchestration
β βββ bcdisasm.py # Pure-Python bytecode disassembler
β βββ bridge_fix.py # Operand-stack symbolic execution
β βββ chroma_store.py # RAG with corpus-scoped collections
β βββ llm.py # Dual-model (GLM Γ DeepSeek)
β βββ scope.py # Corpus fingerprint isolation
β βββ profiler.py # Node-level performance profiling
β βββ conductor.py # Acceptance-gated terminal verdict
β βββ ...
βββ examples/
β βββ chains.json # All discovered chains (machine-readable)
β βββ chains.md # Human-readable chain catalog
βββ tests/
β βββ test_smoke.py # Third-party reproducible test suite
βββ ARCHITECTURE.md # 25-module graph + design decisions
βββ CHANGELOG.md # Design decision history (R6-R52)
βββ SECURITY.md # Authorized-use policy + disclosure
βββ CONTRIBUTING.md # Five development principles
βββ LICENSE # MIT
```
## π¬ How It Works
### 1. Public Chain Determination (guaranteed)
- Class signature matching against curated corpus
- Version gates (e.g., CC 3.2.2 blocks functors, CC4 4.6 NotSerializable, BAVE JDK17 narrows val to String)
- Dynamic assembly + fire verification using target's own JARs
### 2. Novel Chain Discovery (domain-exhaustive)
- **Static**: Operand-stack symbolic execution detects receiver-bridges + argument-bridges
- **Graph**: Real-time corpus-fingerprinted call graph + CHA dispatch edges
- **Dynamic**: Batch-parallel JVM probes (3 carriers Γ field-contract synthesis Γ multi-JDK)
- **Observability**: Marker reachability + exception stack frames + marker caller-stack capture
### 3. Adversarial Auditing
- **Finder β Verifier**: GLM selects candidates, DeepSeek audits independently
- **DSH acceptance gate**: Terminal verdicts rejected until DS acceptance passes
- **"Claims β Evidence" standard**: Every fix requires measurement evidence
### 4. Weaponized PoC Generation
- Chains auto-derived from mining artifacts (`derive_chains`)
- Field-type-aware bridge assembly (`make_bridge` with Object/interface-Proxy)
- Tail candidate loop until RCE closure (`R42 completeness cycle`)
- Benign payload: writes `/tmp` marker file only
## β‘ Performance
| Metric | Value |
|--------|-------|
| Full pipeline (31 jars) | ~90s end-to-end |
| Pair throughput | 1500+ pairs / 9 min (batch + 4 workers) |
| PoC generation (3 chains) | 20.3s (2.7Γ speedup with parallel) |
| Memory per JVM | β€ 256 MB (-Xmx256m, 28% headroom) |
| OOM count across full corpus | 0 |
## π‘οΈ Honest Capability Boundaries
| Claim | Status |
|-------|--------|
| Public chains: guaranteed detection | β
Mechanical (finite signature set) |
| Novel chains: domain-exhaustive | β
Within declared scope (ledger-verifiable) |
| Novel chains: universally exhaustive | β Undecidable (Rice's theorem) |
| PoC: always complete output | β
Tail candidate loop until RCE closure |
## π Documentation
- [ARCHITECTURE.md](ARCHITECTURE.md) β 25-module graph, design decisions
- [CHANGELOG.md](CHANGELOG.md) β 47-round evolution history (R6-R52)
- [examples/chains.md](examples/chains.md) β Human-readable chain catalog
- [SECURITY.md](SECURITY.md) β Authorized-use policy, responsible disclosure
## β οΈ Disclaimer
For **lawful security research, education, and authorized penetration testing only**.
All PoC payloads write a benign marker file (`/tmp/jgd_poc_fired`) β no destructive action.
## π License
[MIT](LICENSE) β Copyright (c) 2026 JGD Contributors