Commit Graph

11 Commits

Author SHA1 Message Date
qybaihe d66b9af1f2 feat(sidecar): auto-wire WASM JS-loader hook into known Node ESM loaders + REA catalog hygiene
Extend the 2026-11-16 Node CJS auto-wire so a same-directory Node.js
ESM loader (.mjs or ESM .js) whose static import/export-from specifiers
are Node builtins only also receives the already-landed WASM
bla.sidecar.v1 load-time hook (carrier: "module"). Record
wasm-sidecar-entangle and clear wasm-sidecar-host-verify-only only when
that hook was actually written. Browser fetch-only loaders and ESM
files that statically import user modules or .wasm stay untouched.

Honesty: jsModuleHasHoistedDependencyGraph no longer treats Node
builtin-only imports as a user hoisted graph.

Catalog REA tip 05be423ac inspection/walk ceilings (DWARF, ELF
debug-link/DT_NEEDED, Maven/Gradle, NuGet, Android OTA/boot) as
honesty-only REA_INTERNAL_LIMITS — not densify trip targets.
2026-11-18 02:08:36 +08:00
qybaihe 645993f96d chore(release): bla-agents v3.4.2
Cut 3.4.2 for the WASM JS-loader hook auto-wire (record
wasm-sidecar-entangle / clear wasm-sidecar-host-verify-only only when a
same-directory Node CJS loader was actually injected) and the REA
26d88826c catalog hygiene (SQLITE_WORKER_HEAP_BYTES). Also includes the
post-3.4.1 main work already on de982cb.
2026-11-17 02:29:33 +08:00
qybaihe 1eb0978b73 feat(sidecar): auto-wire WASM JS-loader hook into known Node CJS loaders + REA catalog hygiene
When sidecarEntangle is on, protectTarget and hardenProject inject the
already-landed WASM JS-loader hook into a same-directory Node.js CommonJS
loader that already uses fs and WebAssembly.instantiate/compile/
instantiateStreaming and mentions the .wasm basename (known names only:
<stem>.cjs/.js, loader.*, index.*). Browser, ESM, minified, already-
entangled, and unranked app entries such as license.cjs are left
untouched so baked self-seal digests stay valid. Record
wasm-sidecar-entangle and clear wasm-sidecar-host-verify-only only when
that hook was actually written. Default remains OFF.

Catalog REA tip 26d88826c SQLITE_WORKER_HEAP_BYTES (256 MiB) as honesty-
only; no new 1:1 densify counters in the +208 delta.
2026-11-17 02:28:40 +08:00
qybaihe c677256c0f feat(sidecar): optional WASM JS-loader hook for bla.sidecar.v1 strip⇒fail + REA catalog hygiene
Add generateSidecarWasmLoaderSnippet / prependWasmSidecarLoaderHook /
entangleWasmLoaderWithSidecars / computeWasmSidecarCodeIdentity so a host JS
loader can wrap WebAssembly.instantiate, compile, and instantiateStreaming
and fail closed when a protected module's bla.sidecar.v1 custom section is
stripped or sibling sidecars are altered. Unrelated WASM passes through.
The hook is host-opt-in; wasm-sidecar-entangle stays unrecorded and the
wasm-sidecar-host-verify-only honesty gap remains until a protect/harden
path actually injects the hook. sidecarEntangle stays default OFF.

Catalogue REA #11144 / #11181 javascript.member_mutation_alias_states as
REA_INTERNAL_LIMITS (recoverable budget, not a densify trip target).
2026-11-16 02:09:38 +08:00
qybaihe 06f29ce97c feat(sidecar): SQLite schema-comment note strip⇒fail + REA catalog hygiene
When sidecarEntangle is opted in, plant an unused bla_sidecar_v1 VIEW
(SELECT '<json>' AS "bla.sidecar.v1" WHERE 0) binding sibling sidecars
(generate/bind/entangle/verifySqliteSidecarSchemaComment). User tables,
rows, query results, WAL/FK, and application_id/user_version stay
unchanged. Host-verify only — do not record sqlite-sidecar-entangle
until a load-time hook lands; defenseScore annotates
sqlite-sidecar-host-verify-only (soft-cap 93). Default remains OFF.

Also catalogues REA #4445 NativeAOT work-budget scaling
(NATIVE_AOT_BASE_WORK_UNITS + 8 units/byte; a relaxation, not a new
densify target) and REA #9756 ANDROID_NATIVE_SPLIT_TYPES / _TYPE_CHARS
(report allowance only).
2026-11-15 02:26:02 +08:00
qybaihe 3e53a1e5b6 feat(sidecar): ASAR main JS preamble strip⇒fail + bla-agents@3.2.4
Complete opt-in ASAR sidecar entanglement with an in-archive Electron main
JS preamble (generateSidecarAsarMainJsPreamble / selectAsarMainJsMember /
entangleAsarMainJsWithSidecars) that re-measures decoy members via
fs-patched readFileSync. Digest labels stay asar-root-relative for parity
with .bla/sidecar.v1.json; protect + harden wire when sidecarEntangle is
on (default OFF). REA +12 since e9b6c87c1 had no new 1:1 densify budgets.
2026-11-11 02:25:01 +08:00
qybaihe 38d26d5219 feat(sidecar): ASAR archive-note strip⇒fail + bla-agents@3.2.2
Plant in-archive `.bla/sidecar.v1.json` when sidecarEntangle is on, binding
enclave/hardware-tee-bridge.js (protect + harden ASAR post-pass). Host-side
verifyAsarSidecarArchiveNote closes strip/alter. Default remains OFF.
2026-11-10 02:13:49 +08:00
qybaihe cabdbb24ca feat(firmware): UF2 not-main-flash/file-container decoys vs REA #8230
Counter REA Uf2ArtifactReader by appending well-formed not-main-flash
and file-container decoy blocks (canary/diagnostic bait, decoy families,
numbering gaps) while preserving original UF2 blocks byte-exact so
bootloaders still flash the real payload. Wire detector/protector/auditor,
identity UF2_* limits, verify:rea (incl. url-scheme family catalog), and
tests. Release bla-agents@1.6.2.
2026-11-01 02:14:23 +08:00
Timo Zhang 70356d2cfb feat: port PR #36 — Electron protocol blackout, signed/standalone native preservation, HTML multi-script isolation, CrackMe v5.2 (#37)
Ports the meaningful defensive hardening from feat/electron-protocol-signed-native-html (4869d57 / PR #36) onto current main without regressing P0 (#23–#25):

- Counter REA 47fa6ab37 Electron custom URL protocol analyzer + 26th url-scheme obligation family
- detectNativeEofAppendHazard (Mach-O LC_CODE_SIGNATURE, PE Authenticode, PyInstaller, Deno, ZIP-SFX) with byte-exact preservation + .bunfs-snapshot sidecar
- HTML multi-script isolation, non-JS <script> preservation, auditor script extraction + chaff manifest recognition
- Windows SARIF drive-letter / 8.3 short-path / System32 tar / .gitattributes binary extensions
- CrackMe v5.2 (CRLF normalize + V8 Function.prototype.toString anti-virtualization)
- Cross-platform tests in tests/v160-electron-native-html-crossplatform.test.ts

Kept package/identity at 1.5.3; CHANGELOG under Unreleased. Dropped PR #36's version bump to 1.6.0, release doc, and duplicate Windows CI (already on main via P0).
2026-11-01 00:32:52 +08:00
qybaihe 71cf950485 feat(android,dex): counter REA #8154 with external-invoke decoy multidex (v1.5.2)
Plant a byte-valid classesN.dex whose decoy callers each invoke-static
android.util.Log.d, saturating MAX_EXTERNAL_XREF_BYTES (~1 MiB) on unsigned
APKs. Developer root manifest and existing DEX export surface preserved.
verify:rea now walks bridge/**/*.java (72 checks).
2026-10-31 02:16:13 +08:00
qybaihe c77c468f73 feat(android,r8): counter REA #7456/#7472 with mapping poison + JNI decoy .so (v1.4.6)
Register PROGUARD_MAPPING_* / ANDROID_JNI_* / MAX_NATIVE_EXPORT_ROWS in identity.
Add android-r8.ts (residual conflicts past candidates:8, malformed past 16, ELF64
AArch64 ET_DYN with real Java_* dynsym). Wire into unsigned APK + DEX trailer.
verify:rea now 54 checks (Object.freeze-aware). Tests 206/206 on Node 24.
2026-10-28 02:12:47 +08:00