Repository navigation
feat(artifacts): inventory and extract Deno compile executables - #8527
Conversation
Adds Deno standalone artifact support for Mach-O, ELF, and PE carriers, exposing virtual files, entry points, recorded options, and file digests without running the executable. Extraction uses the existing safe output tree, preserves symlink targets as metadata, and assigns indexed paths to unsafe or oversized names. Environment-file values and certificate bytes remain in local Evidence; npm snapshots are reported by length without decoding. The documentation describes supported layouts, parsing limits, and refusal behavior.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Critical impact] The reviewed changes appear safe to merge. SummaryAdds read-only inventory and extraction for Deno compile executables across Mach-O, ELF, and PE carriers.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Admitted local file] --> B[Shared format probes]
B --> C[Locate named Deno carrier]
C --> D[Check ownership and parent bounds]
D --> E[Parse section and stored file ranges]
E --> F[Inventory with paths and hashes]
F --> G[Extract through SafeOutputTree]
Reviews (33) · Last reviewed commit: "test(deno): cover mismatched Mach-O segm..." · Reviewed by Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f434c1348
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The backward trailer search stopped at the first confirmed sentinel, so an Intel app storing another Intel Deno executable as a virtual file reported the inner app. Search to the slice start, drop sentinels inside a confirmed payload, and fail closed on side-by-side trailers that differ. Correct the docs on retained environment values and generated regions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8a8986692
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…thful Report unknown coverage when the virtual filesystem cannot be listed, keep resolved specifiers when another remote ID is missing, and percent-encode characters in remote paths that a Windows destination would refuse. Reject a directory at the PE resource language level, and correct the guide's description of colliding generated regions.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94d848d262
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Uppercase every percent escape in a generated remote path, so specifiers that differ only in escape case reach the path registry as one name and the second gets an indexed path instead of colliding on a case-insensitive disk.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e9b4c5a56b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…encode reserved remote path characters The Intel trailer scan rejected an overlong sentinel before reading its marker, so a truncated enclosing app vanished and the nested app was reported. Read the marker first and fail closed when a confirmed overlong trailer encloses another trailer. encodeURIComponent leaves `*` alone and the sanitizer covered only part of the Windows reserved set. remoteDestination now encodes the whole set once as uppercase percent hex; source_path keeps the original. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KuWHGvzJkrhCqjtEHUwqyH
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5cae36cf9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…osing trailers resolve A damaged Intel asset stored before a valid one inside a valid app made the backward trailer search fail before it reached the outer trailer. Hold that failure until the search ends and drop it when a confirmed enclosing trailer holds the sentinel as data.
… a found name namedResourceTargets skipped a type branch whose names directory, or a name entry whose string, could not be read. A duplicate RT_RCDATA entry pointing out of bounds therefore vanished once another branch matched, and locatePeResourcePayloads returned only the readable ranges while parsePeResources rejected the same tree. The walk now records unresolved branches. hasPeResourceName still reports false for a tree that never reaches the name, but once locatePeResourcePayloads finds the name it raises a format failure if any branch was left unresolved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b82fdc148
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A non-Deno x86_64 Mach-O that stores an Intel Deno executable in __DATA had the asset's trailer promoted to the root application, because the backward sentinel search never checked who owned the bytes it scanned. locateMachOSlice now records the file ranges of every segment other than __SUI and __LINKEDIT (libsui extends __LINKEDIT over the trailer), and the Intel search skips any sentinel inside one of them. A slice whose load commands do not frame stays with native inventory, since ownership cannot be shown there.
…ing slice The universal Mach-O locator skipped any slice whose load commands could not be read or framed, and any slice with a FAT range issue. When another slice confirmed Deno, that slice was reported as the whole image, so a sibling declaring a different Deno application went unexamined. locateMachOSlice now reports why part of a slice was not examined (unreadable or unframed load commands, a truncated slice, or the Intel sentinel allowance). locateMachO collects those reasons for every declared and hidden slice and fails closed once any slice confirms a Deno section. With none confirmed, the image stays with native inventory as before.
Resolve the docs/index.md guide table conflict by taking main's table (duplicate native row removed, wxapkg added) and keeping the Deno compile link on the JavaScript row. Main now requires every format metadata kind to declare how artifact comparison treats it, so add deno-standalone and deno-standalone-entry to declarationsByKind as not compared, matching bun-standalone.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Run `deno --version` through the verifier command owner with a deadline instead of raw execFile, and close the owner when the version is refused.
The locator took a universal slice's CPU type from its FAT row, so a row that called an x86_64 slice arm64 skipped that slice's Intel trailer and let the arm64 payload stand for the whole image. Each slice's header is now checked against its row with validateFatSliceIdentity. A mismatch leaves the slice unread, so a universal image whose other slice confirms Deno fails closed. The Intel fixture header now states CPU_SUBTYPE_X86_64_ALL so its FAT rows can match it exactly.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 83fbfe8398
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A trailer length word of 2^53 or more was dropped before its d3n0l4nd marker was read, so an enclosing app with that length was skipped and a nested app's range stood for the whole image. The marker is now read first, and a marker-confirmed trailer whose length runs past the slice, safe or not, joins the deferred truncated candidates and fails closed unless an enclosing trailer holds it as data.
A note table shorter than one note header made a read of its trailing bytes but counted no note, so many distinct tiny tables could force one sequential read each past the 256-note allowance. Every nonempty table now counts at least one entry, both in the up-front estimate and while scanning, so an image past the allowance records the limit instead of reading every table. The trailing-byte check moves into its own helper.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b294add43
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… note A zero e_shnum with a nonzero e_shoff moves the section count into section zero, so the section table was skipped and its SHT_NOTE tables were never compared. Record it as damage, as PN_XNUM already is, so a confirmed SUI note fails closed instead of reporting full coverage.
…s known A trailer length word below 8 was dropped before its d3n0l4nd marker was read, so an enclosing app with a length of 0 to 7 was skipped and a nested app's trailer was selected as the root. The marker is now read first, and a marker-confirmed trailer too short to hold it is kept as malformed and fails closed unless an enclosing trailer holds it as data.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c9e676f26e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A duplicate typeId root entry whose target is a data entry was skipped without marking the walk unresolved, so locatePeResourcePayloads returned the readable named resource as complete. Route non-directory type branches through the same unresolved path as unreadable names directories so the Deno reader fails closed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6c9c9a040
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
denoSectionRange admitted the declared offset and size of a confirmed __SUI,d3n0l4nd record without checking its section type, so a S_ZEROFILL, S_GB_ZEROFILL or S_THREAD_LOCAL_ZEROFILL section could be read as a file payload while MachoImage reports it as not file backed. Reject zero-fill types with the shared isMachoZeroFillSection predicate before assigning a physical range.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7da05e8ac0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
denoSectionRange checked a confirmed __SUI,d3n0l4nd record only against the slice and file bounds, so a section reaching past its segment's fileoff/filesize was still read as a complete payload while MachoImage reports the same section as not file backed. Reject a section outside its enclosing segment's file extent before admitting the physical range.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 46563857d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09fef1051d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3edc7091e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e169872ba
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (deno.status === "present") | ||
| return { kind: "deno-standalone", source, probe: deno }; |
There was a problem hiding this comment.
Honor .NET bundle ownership before promoting Intel trailers
For an x86_64 Mach-O .NET single-file bundle containing an uncompressed Intel Deno helper, this return runs before dotnetBundle() and replaces the bundle with the helper's application. Fresh evidence beyond the repaired CArchive case: in an isolated v6 bundle fixture, findDotnetBundleHeader and readDotnetBundle validate App.dll and helper, yet the Deno locator selects the helper's helper.ts payload; the current probe excludes only native segment and CArchive ranges. Inspection and extraction consequently omit the .NET application's members. Resolve the enclosing .NET bundle's ownership through its shared parser before admitting these trailer candidates.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Summary
deno compileexecutables are a common way to ship JavaScript and TypeScript, but REA treats them as an ordinary native binary, so the embedded application stays hidden behind the runtime.This lets
inspect-artifactinventory adeno compileexecutable andextract-artifactwrite its embedded files through the existing safe output tree. Neither runs the executable or the Deno runtime. No issue is linked. This is a proposed new artifact format.Problem and expected behavior
Use case: an analyst holds a binary built with
deno compileand wants its entry point, permissions, embedded files and remote modules without running it.Observable outcome:
root_formatisdeno-standalonefor Mach-O section, Intel Mach-O trailer, ELF note and PE resource carriers.source_path. A missing remote ID leaves the other resolved specifiers in place.Change and scope
Layout parsing lives in
src/artifacts/deno/andsrc/artifacts/DenoStandaloneArtifactReader.ts, with carrier location, section layout, virtual filesystem walking and admission split into owners. The layout follows Denocli/lib/standalone/binary.rsandvirtual_fs.rsat 2.9.8, with libsui 0.16.4 section placement.Existing artifact owners change only to register the format:
artifactFormats.ts,ArtifactEmbeddedFormatProbes.ts,ArtifactPaths.ts,ArtifactReader.ts,ArtifactReaderAdmission.ts,inventory/,extraction/ArtifactExtraction.ts, the graph and format metadata contracts, andsrc/native/pe/PeResourceLayout.ts.A decision for maintainers:
Metadata.env_vars_from_env_fileholds values from a compile-time--env-file, andca_dataholds certificate bytes. Following AGENTS.md, local Evidence retains them, and inventory limitations say so. Anyone sharing Evidence from such a binary shares those values. If REA prefers to withhold them by default, this is a small change inDenoSectionLayout.ts.Duplicate section declarations must match. Unequal lengths are rejected before hashing, work stops at the first mismatch, and aggregate reads are bounded by the carrier size. Remote module and VFS fallback paths avoid every occupied path without an artificial retry ceiling.
An Intel trailer can be a virtual file inside another Intel Deno executable, so the search runs to the slice start and resolves to the enclosing app. Side-by-side trailers with different bytes fail closed, and a confirmed trailer that reaches the 64-sentinel allowance is refused. Nested carriers are covered by synthetic fixtures only. A directory at the PE resource language level under a confirmed resource is rejected, matching
PeResourceParser.Not included: running the target, decoding npm snapshots, or downloading remote modules.
Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.
Contract and boundary impact
inspect-artifact,extract-artifactandinspect_artifactaccept the new format. No new tool.deno-standaloneformat metadata and member roles. Embedded environment values and CA bytes are retained in local Evidence as described above.docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): onepackage.jsonverifier script. No build output is committed.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/artifacts/deno/, plus inventory and extraction boundary tests.npm run verify:deno:standalonecompiles with Deno 2.9.8, including--env-file,--self-extractingand three cross targets, then inspects and extracts each without running it.docs/verification/deno-standalone-2026-10-31.mdholds the record.{ "root_format": "deno-standalone", "carrier": "mach-o", "embedding": "mach-o-section", "entrypoint_key": "main.ts", "env_var": { "name": "REA_DENO_TOKEN", "value": "super-secret-value", "value_byte_length": 18 }, "long_module_logical_path": "deno-vfs/1", "damaged_native_elf_root_format": "elf", "extraction_verified": true, "target_executed": false, "crosses": [ { "target": "x86_64-unknown-linux-gnu", "carrier": "elf", "embedding": "elf-note", "extracted": true }, { "target": "x86_64-pc-windows-msvc", "carrier": "pe", "embedding": "pe-resource", "extracted": true }, { "target": "x86_64-apple-darwin", "carrier": "mach-o", "embedding": "mach-o-intel-trailer", "extracted": true } ] }super-secret-valueis a fixture literal.unsupported. Remote modules, npm snapshots andca_dataare covered by synthetic fixtures only, because the verifier binaries do not contain them. npm snapshot bytes are reported by length and not decoded. The Windows remote path behavior is checked throughSafeOutputTreeinwin32mode on macOS, not on a Windows host. If any specifier is invalid UTF-8, all specifiers in the table stay unresolved.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
For evidence-bearing changes:
Demo
Validation performed
Latest review follow-up: 89 Deno source tests and check:fast passed. Validation uses constructed artifacts; no real-target/provider verification was run for this follow-up.
Mach-O parent admission:
npm run test:local -- src/artifacts/deno/DenoStandaloneArtifactReader.test.ts src/artifacts/ArtifactEmbeddedFormatProbes.test.tspassed (92 tests), andnpm run check:fastpassed. A synthetic out-of-file parent segment failed before the fix and is rejected afterward. Real Deno binaries were not revalidated.Deno carrier ownership:
npm run check:fastpassed;npm run test:local -- src/artifacts/deno/DenoStandaloneArtifactReader.test.ts src/artifacts/ArtifactEmbeddedFormatProbes.test.tspassed (91 tests). Synthetic regressions demonstrate that a PyInstaller-owned Intel trailer cannot claim the outer image and that a Mach-O section outside its virtual segment extent is rejected; both failed before the fix.Run on this commit on macOS with Node 24.22.1 and npm 11.16.0:
npm run test:localon the changed source tests: 198 passed.npm run test:focusedon the changed acceptance and boundary tests: 30 passed.npm run verify:deno:standalone: passed with Deno 2.9.8.typecheck,lint,lint:typed(0 errors),format:check,metadata:check,verify:architecture-guards,verify:test-discovery,knip:productionanddocs:check: passed.npm run checkstops atknipon one unused exported type atsrc/process/DarwinHelperCache.ts:465. This PR does not touch that file, and it failed the same way onmainin this environment.Compatibility, safety, and release
deno compileexecutable that used to inventory as a native binary now hasroot_formatdeno-standalone. A damaged section keeps the native format.package.jsonscript. No new runtime dependency.--env-filestay in local Evidence, as called out above.Author readiness
Human owner: @mvanhorn
Before merge
type(scope): outcome.AI was used for assistance.