Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
85c9f88
feat(rust): read cargo-auditable dependencies from WebAssembly modules
yu0809 Oct 18, 2026
9bac2e3
fix(rust): bound the WebAssembly section walk
yu0809 Oct 18, 2026
cda31a6
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Oct 18, 2026
162590b
Merge origin/main into feat/rust-wasm-auditable
kaoru0822-kitauji Oct 21, 2026
345f0f4
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Oct 21, 2026
d2fd725
fix(rust): accept WebAssembly Evidence in retained dependency views
yu0809 Oct 21, 2026
bdb41d2
fix(rust): name the WebAssembly section-walk allowance in recovery
yu0809 Oct 21, 2026
6ce932e
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Oct 25, 2026
084ad35
fix(rust): require WebAssembly container facts in reports
yu0809 Oct 25, 2026
a86deb1
Merge morluto/rea main into feat/rust-wasm-auditable
yu0809 Nov 17, 2026
8865878
docs(rust): record the WebAssembly dependency-metadata feature
yu0809 Nov 17, 2026
e88658c
fix(rust): bind section names to containers and share the LEB128 reader
yu0809 Nov 17, 2026
bb745a3
fix(rust): classify a cut-off WebAssembly integer by its boundary
yu0809 Nov 17, 2026
3753f11
fix(rust): report a duplicate WebAssembly dependency section first
yu0809 Nov 17, 2026
fb270a2
Merge remote-tracking branch 'origin/main' into feat/rust-wasm-auditable
cursoragent Nov 18, 2026
b6510e5
test(rust): assert WebAssembly container facts instead of limitation …
cursoragent Nov 18, 2026
d8b8f22
fix(rust): state container word size as 32 | 64 | null
cursoragent Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(rust): read cargo-auditable dependencies from WebAssembly modules
cargo-auditable embeds the same zlib-compressed `.dep-v0` JSON in a
WebAssembly custom section for wasm32 targets, but inspect_rust_binary
rejected every module as an unsupported target because only ELF, PE and
thin Mach-O containers were recognized.

Walk the section framing of version 1 core modules to locate the
`.dep-v0` custom-section payload and the data section, where rustc keeps
its constant /rustc/<hash>/ paths. Rust lookups now read one
format-neutral layout, so native and WebAssembly images share a single
dependency-section owner. WebAssembly declares no container word size, so
`bits` is null for that format only; the Evidence subject format is
`file`, as for inspect_wasm_artifact.

Truncated sections, invalid LEB128 sizes, custom-section names that run
past their section or are not UTF-8, duplicate `.dep-v0` sections and a
second data section are malformed. Components, such as wasm32-wasip2
output, embed core modules and are refused as unsupported, like universal
Mach-O containers, rather than inspected through one selected module.
  • Loading branch information
yu0809 committed Oct 18, 2026
commit 85c9f88835a0c2e7a37976159b925d362509b88d
11 changes: 6 additions & 5 deletions .agents/skills/reverse-engineer-anything/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,12 @@ explicit path or endpoint and do not need it.
remain explicit. See the
[Go binary guide](https://github.com/morluto/rea/blob/main/docs/go-binaries.md).
- Embedded cargo-auditable Rust dependency metadata: `inspect_rust_binary`
with the explicit local ELF, PE, or thin Mach-O file. This built-in
target-free inspection requires no Rust installation or disassembler. Preserve
package order, dependency indices, and the section file range. A missing
`.dep-v0` section is null metadata, not proof the binary has no dependencies.
A rustc commit hash is an inference from a read-only `/rustc/<40-hex>/` path.
with the explicit local ELF, PE, thin Mach-O, or WebAssembly core-module
file. This built-in target-free inspection requires no Rust installation or
disassembler. Preserve package order, dependency indices, and the section file
range. A missing `.dep-v0` section is null metadata, not proof the binary has
no dependencies. A rustc commit hash is an inference from a
`/rustc/<40-hex>/` path in read-only data or a WebAssembly data section.
See the
[Rust binary guide](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ source and type recovery remain a separate native-analysis question.

## Rust dependency metadata

Use `inspect_rust_binary` for an explicit local ELF, PE, or thin Mach-O when
the question concerns the cargo-auditable crate list embedded in `.dep-v0`
(Mach-O: `__DATA,.dep-v0`). No `open_binary`, Rust installation, or target
execution is required. The CLI equivalent is `inspect-rust-binary PATH`.
Preserve artifact SHA-256, package order, dependency indices, and the section
file range. A missing section is null metadata, not proof the binary has no
dependencies. An omitted package kind stays null. A rustc commit hash is
inferred from a read-only `/rustc/<40-hex>/` path and does not by itself
identify the compiler. See [Rust binaries](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md).
Use `inspect_rust_binary` for an explicit local ELF, PE, thin Mach-O, or
WebAssembly core module when the question concerns the cargo-auditable crate
list embedded in `.dep-v0` (Mach-O: `__DATA,.dep-v0`; WebAssembly: a custom
section). No `open_binary`, Rust installation, or target execution is
required. The CLI equivalent is `inspect-rust-binary PATH`. Preserve artifact
SHA-256, package order, dependency indices, and the section file range. A
missing section is null metadata, not proof the binary has no dependencies. An
omitted package kind stays null. WebAssembly reports a null word size, and
components such as `wasm32-wasip2` output are unsupported. A rustc commit hash
is inferred from a `/rustc/<40-hex>/` path in read-only data or a WebAssembly
data section and does not by itself identify the compiler. See [Rust binaries](https://github.com/morluto/rea/blob/main/docs/rust-binaries.md).

## SQLite snapshots

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Additional tools and host support depend on the target:
| Native binaries | Pseudocode, assembly, strings, symbols, calls and references | Hopper, Ghidra or IDA; [native analysis](docs/native-investigation.md) |
| Offline ELF layout | Sections, segments, original symbols/relocations and static mitigation candidates | Caller-supplied pwntools on Linux x64; [binary diagnostics](docs/binary-diagnostics.md) |
| Go binaries | Embedded compiler version, modules, replacements and build settings | Built-in static ELF/PE/thin Mach-O inspection; no Go installation required |
| Rust binaries | Embedded cargo-auditable crate names, versions, sources and dependency edges | Built-in static ELF/PE/thin Mach-O inspection; [Rust binaries](docs/rust-binaries.md) |
| Rust binaries | Embedded cargo-auditable crate names, versions, sources and dependency edges | Built-in static ELF/PE/thin Mach-O/WebAssembly module inspection; [Rust binaries](docs/rust-binaries.md) |
| WASM artifact | Validation, sections, exact import/export WAT forms and decoded WAT | Caller-supplied WABT 1.0.42; `inspect_wasm_artifact` |
| EVM bytecode | Dispatch selectors, byte offsets, inferred arguments and mutability | Local raw/hex carrier on Linux x64; [offline EVM guide](docs/evm-bytecode.md) |
| SQLite databases | Tables, columns, indexes, views, triggers and selected ordinary-table rows | Local database/WAL snapshot; Node.js 24.x >=24.15 or 26+ with native SQLite limits |
Expand Down
2 changes: 1 addition & 1 deletion docs/readme/README_el.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ npx rea-agents@latest setup
| Δυαδικά αρχεία με κώδικα μηχανής | Ψευδοκώδικα, κώδικα assembly, συμβολοσειρές, σύμβολα, κλήσεις και αναφορές | Hopper, Ghidra ή IDA· [ανάλυση κώδικα μηχανής](../native-investigation.md) |
| Δομή ELF χωρίς εκτέλεση | Ενότητες, τμήματα, αρχικά σύμβολα/εγγραφές μετεγκατάστασης και ενδείξεις πιθανών μέτρων προστασίας από στατική ανάλυση | pwntools που παρέχει ο χρήστης σε Linux x64· [διαγνωστικά δυαδικών αρχείων](../binary-diagnostics.md) |
| Δυαδικά αρχεία Go | Ενσωματωμένη έκδοση μεταγλωττιστή, modules, αντικαταστάσεις και ρυθμίσεις μεταγλώττισης | Ενσωματωμένη στατική εξέταση ELF/PE/thin Mach-O· δεν απαιτείται εγκατάσταση του Go |
| Δυαδικά αρχεία Rust | Ενσωματωμένα ονόματα, εκδόσεις, πηγές και σχέσεις εξάρτησης των crates από το cargo-auditable | Ενσωματωμένη στατική εξέταση ELF/PE/thin Mach-O· [δυαδικά αρχεία Rust](../rust-binaries.md) |
| Δυαδικά αρχεία Rust | Ενσωματωμένα ονόματα, εκδόσεις, πηγές και σχέσεις εξάρτησης των crates από το cargo-auditable | Ενσωματωμένη στατική εξέταση ELF/PE/thin Mach-O/WebAssembly· [δυαδικά αρχεία Rust](../rust-binaries.md) |
| Αρχείο WASM | Έλεγχο εγκυρότητας, ενότητες, ακριβείς μορφές εισαγωγών/εξαγωγών σε WAT και αποκωδικοποιημένο WAT | WABT 1.0.42 που παρέχει ο χρήστης· `inspect_wasm_artifact` |
| Bytecode EVM | Selectors επιλογής συνάρτησης, μετατοπίσεις σε bytes, εκτιμώμενα ορίσματα και δυνατότητα μεταβολής της κατάστασης | Τοπική είσοδος σε ακατέργαστα bytes ή δεκαεξαδική μορφή σε Linux x64· [οδηγός EVM χωρίς εκτέλεση](../evm-bytecode.md) |
| Βάσεις δεδομένων SQLite | Πίνακες, στήλες, ευρετήρια, όψεις, triggers και επιλεγμένες γραμμές κανονικών πινάκων | Τοπικό στιγμιότυπο βάσης δεδομένων/WAL· Node.js 24.x >=24.15 ή 26+ με εγγενή όρια SQLite |
Expand Down
2 changes: 1 addition & 1 deletion docs/readme/README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ REA에는 Node.js 22.x(>=22.19), 24.x(>=24.11) 또는 26+와 npm이 필요합니
| 네이티브 바이너리 | 의사 코드, 어셈블리, 문자열, 심볼, 호출, 참조 | Hopper, Ghidra 또는 IDA; [네이티브 분석](../native-investigation.md) |
| 오프라인 ELF 레이아웃 | 섹션, 세그먼트, 원본 심볼/재배치 정보, 정적 분석으로 얻은 보안 완화 기법 후보 | Linux x64에서 호출자가 제공하는 pwntools; [바이너리 진단](../binary-diagnostics.md) |
| Go 바이너리 | 내장된 컴파일러 버전, 모듈, `replace` 지시어, 빌드 설정 | REA 내장 ELF/PE/thin Mach-O 정적 검사; Go 설치 불필요 |
| Rust 바이너리 | cargo-auditable이 내장한 크레이트 이름, 버전, 소스, 의존성 관계 | REA 내장 ELF/PE/thin Mach-O 정적 검사; [Rust 바이너리](../rust-binaries.md) |
| Rust 바이너리 | cargo-auditable이 내장한 크레이트 이름, 버전, 소스, 의존성 관계 | REA 내장 ELF/PE/thin Mach-O/WebAssembly 정적 검사; [Rust 바이너리](../rust-binaries.md) |
| WASM 아티팩트 | 유효성 검사, 섹션, import/export의 정확한 WAT 형식, 디코딩된 WAT | 호출자 제공 WABT 1.0.42; `inspect_wasm_artifact` |
| EVM 바이트코드 | 디스패치 선택자, 바이트 오프셋, 추론한 인자와 상태 변경 가능 여부 | Linux x64의 로컬 원시 바이트/16진수 입력 파일; [오프라인 EVM 가이드](../evm-bytecode.md) |
| SQLite 데이터베이스 | 테이블, 열, 인덱스, 뷰, 트리거, 선택한 일반 테이블의 행 | 로컬 데이터베이스/WAL 스냅샷; Node.js 24.15 이상의 24.x 또는 26 이상(네이티브 SQLite 한도 적용) |
Expand Down
2 changes: 1 addition & 1 deletion docs/readme/README_ml.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ REA-യ്ക്ക് Node.js 22.x (>=22.19), 24.x (>=24.11), അല്ലെ
| Native binaries | Pseudocode, assembly, strings, symbols, calls, references | Hopper, Ghidra അല്ലെങ്കിൽ IDA; [native analysis](../native-investigation.md) |
| Offline ELF layout | Sections, segments, യഥാർത്ഥ symbols/relocations, static mitigation candidates | Linux x64-ൽ caller നൽകുന്ന pwntools; [binary diagnostics](../binary-diagnostics.md) |
| Go binaries | ഉൾച്ചേർത്ത compiler version, modules, replacements, build settings | Built-in static ELF/PE/thin Mach-O പരിശോധന; Go installation ആവശ്യമില്ല |
| Rust binaries | ഉൾച്ചേർത്ത cargo-auditable crate പേരുകൾ, versions, sources, dependency edges | Built-in static ELF/PE/thin Mach-O പരിശോധന; [Rust binaries](../rust-binaries.md) |
| Rust binaries | ഉൾച്ചേർത്ത cargo-auditable crate പേരുകൾ, versions, sources, dependency edges | Built-in static ELF/PE/thin Mach-O/WebAssembly പരിശോധന; [Rust binaries](../rust-binaries.md) |
| WASM artifact | Validation, sections, കൃത്യമായ import/export WAT രൂപങ്ങൾ, decoded WAT | Caller നൽകുന്ന WABT 1.0.42; `inspect_wasm_artifact` |
| EVM bytecode | Dispatch selectors, byte offsets, അനുമാനിച്ച arguments, mutability | Linux x64-ൽ local raw/hex carrier; [offline EVM guide](../evm-bytecode.md) |
| SQLite databases | Tables, columns, indexes, views, triggers, തിരഞ്ഞെടുത്ത സാധാരണ table rows | Local database/WAL snapshot; native SQLite പരിമിതികളോടെ Node.js 24.x >=24.15 അല്ലെങ്കിൽ 26+ |
Expand Down
2 changes: 1 addition & 1 deletion docs/readme/README_tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ REA; Node.js 22.x (>=22.19), 24.x (>=24.11) veya 26+ ve npm gerektirir. Ek araç
| Yerel makine kodu içeren ikili dosyalar | Sözde kod, assembly kodu, dizeler, semboller, çağrılar ve referanslar | Hopper, Ghidra veya IDA; [yerel kod analizi](../native-investigation.md) |
| Çevrimdışı ELF yapısı | Bölümler, segmentler, özgün semboller/yeniden konumlandırmalar ve statik analizden olası güvenlik önlemleri | Linux x64 üzerinde çağıranın sağladığı pwntools; [ikili dosya tanılama](../binary-diagnostics.md) |
| Go ikili dosyaları | Gömülü compiler sürümü, modüller, replacement'lar ve build ayarları | Yerleşik statik ELF/PE/thin Mach-O incelemesi; Go kurulumu gerekmez |
| Rust ikili dosyaları | Gömülü cargo-auditable crate adları, sürümleri, kaynakları ve bağımlılık ilişkileri | Yerleşik statik ELF/PE/thin Mach-O incelemesi; [Rust ikili dosyaları](../rust-binaries.md) |
| Rust ikili dosyaları | Gömülü cargo-auditable crate adları, sürümleri, kaynakları ve bağımlılık ilişkileri | Yerleşik statik ELF/PE/thin Mach-O/WebAssembly incelemesi; [Rust ikili dosyaları](../rust-binaries.md) |
| WASM artefaktı | Doğrulama, bölümler, tam import/export WAT biçimleri ve decode edilmiş WAT | Çağıranın sağladığı WABT 1.0.42; `inspect_wasm_artifact` |
| EVM bayt kodu | Yönlendirme seçicileri, bayt ofsetleri, çıkarımla belirlenen argümanlar ve durum değiştirilebilirliği | Linux x64 üzerinde yerel ham bayt/onaltılık girdi; [çevrimdışı EVM rehberi](../evm-bytecode.md) |
| SQLite veritabanları | Tablolar, sütunlar, index'ler, view'lar, trigger'lar ve seçilen sıradan tablo satırları | Yerel database/WAL snapshot'ı; native SQLite sınırlarıyla Node.js 24.x >=24.15 veya 26+ |
Expand Down
37 changes: 29 additions & 8 deletions docs/rust-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

`inspect_rust_binary` / `inspect-rust-binary` answers which crate names,
versions, sources, and dependency edges are embedded by cargo-auditable in one
selected local executable or library. It reads the file without running it and
requires no Rust installation, active binary target, Hopper, Ghidra, or IDA.
selected local executable, library, or WebAssembly module. It reads the file
without running it and requires no Rust installation, active binary target,
Hopper, Ghidra, or IDA.

```bash
rea inspect-rust-binary /absolute/path/to/application --json
Expand All @@ -25,8 +26,10 @@ The inline Evidence result contains the artifact path, SHA-256, byte length,
container format, architecture, word size, and byte order. When a `.dep-v0`
section is present, `auditable_metadata` contains:

- `section_name`, `.dep-v0` for ELF and PE or `__DATA,.dep-v0` for thin Mach-O;
- `file_offset` and `section_bytes`, the exact file range of the compressed section;
- `section_name`, `.dep-v0` for ELF, PE, and WebAssembly or `__DATA,.dep-v0`
for thin Mach-O;
- `file_offset` and `section_bytes`, the exact file range of the compressed
section; for WebAssembly, the custom-section payload after its name;
- `compressed_bytes` and `uncompressed_bytes`;
- `format_version`, the embedded integer, or `null` when the field is omitted;
- `packages`, in the section's original order, with `name`, `version`, `source`,
Expand All @@ -40,9 +43,27 @@ runtime, and that default is not stored in the section. An omitted dependency
list is an empty array. An omitted `root` flag is false.

`rustc_commit` is present only when a `/rustc/<40-hex>/` path is found in
read-only data. Its `evidence_kind` is `inferred`. The hash is not a claim that
that compiler produced the binary. Several distinct hashes leave a single
commit unknown.
read-only data, or in the data section of a WebAssembly module. Its
`evidence_kind` is `inferred`. The hash is not a claim that that compiler
produced the binary. Several distinct hashes leave a single commit unknown.

## WebAssembly modules

cargo-auditable stores the same zlib-compressed JSON in a WebAssembly custom
section named `.dep-v0`. For a version 1 core module, such as
`wasm32-unknown-unknown` or `wasm32-wasip1` output, the reader walks the
section framing without validating, instantiating, or executing the module.
The report's `format` and `architecture` are `wasm` and its `byte_order` is
`little`. `bits` is `null`: WebAssembly declares no container word size, and
memory address types are not inspected. The Evidence subject format is
`file`, as for `inspect_wasm_artifact`.

A section or custom-section name that extends past its enclosing range, a size
that is not a 32-bit LEB128 integer, a custom-section name that is not UTF-8, a
second `.dep-v0` section, or a second data section is malformed. WebAssembly
components, such as `wasm32-wasip2` output, embed core modules. Like universal
Mach-O containers, they are unsupported rather than inspected through one
selected module.

## Limits and failures

Expand All @@ -64,7 +85,7 @@ Embedded names and versions are file content. They do not authenticate the
packages or the compiler.

Universal Mach-O containers are unsupported. Select a thin slice first. ELF,
PE, and thin Mach-O are the supported containers.
PE, thin Mach-O, and WebAssembly core modules are the supported containers.

Package and dependency counts are checked against the minimum required JSON
representation before graph allocation or schema cloning. Oversized graphs
Expand Down
10 changes: 9 additions & 1 deletion src/application/rust/RustBinaryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ import { completeProviderEvidence } from "../ProviderOperationExecution.js";

const OPERATION = "inspect_rust_binary";

/** Evidence subjects name native containers; a WebAssembly module is a file, as for WABT. */
const SUBJECT_FORMATS = {
elf: "elf",
pe: "pe",
macho: "mach-o",
wasm: "file",
} as const;

const architectureForSubject = (architecture: string) => {
switch (architecture) {
case "386":
Expand Down Expand Up @@ -94,7 +102,7 @@ const evidenceFor = (
{
path: value.artifact.path,
sha256: value.artifact.sha256,
format: value.format === "macho" ? "mach-o" : value.format,
format: SUBJECT_FORMATS[value.format],
...(architecture === undefined ? {} : { architecture }),
},
provider,
Expand Down
Loading