Skip to content

Secure validation and witnesses, restore standalone builds, optimize renaming - #6

Merged
ruvnet merged 1 commit into
mainfrom
fix/secure-validation-witness-benchmarks
Sep 10, 2026
Merged

ruvnet merged 1 commit into
mainfrom
fix/secure-validation-witness-benchmarks

Conversation

@ruvnet

@ruvnet ruvnet commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

Problem and outcome

The decompiler executed supplied JavaScript inside Node VM contexts during validation, treated export shapes or simultaneous failures as equivalence, and generated witnesses before reconstruction changed output bytes. Remote requests and weight tensor dimensions were unbounded. A fresh Rust checkout did not build because its manifest depended on an absent parent workspace.

This change removes input execution, fixes artifact verification, bounds remote and model inputs, repairs standalone builds, and reduces repeated string allocation in renaming.

Changes

  • Static validation only: changed code returns functionallyEquivalent: null; runnable mode preserves bytes and rejects unproven edits.
  • Witness v2 binds source hash, ordered module names and final content hashes. Strict schema and topology checks, explicit source/module verification, final metrics, and exact-byte output.
  • Fixed HTTPS registry/CDN hosts, redirect revalidation, 32 MiB streamed body limit, 30 second total deadline, maximum five redirects.
  • Output traversal and symlink rejection with exclusive file creation. Caller-owned output directories remain required.
  • Rust weights bounded to 256 MiB; checked dimension arithmetic, tensor rank/count limits, exact model shapes, duplicate and nonfinite rejection.
  • Standalone Cargo manifest and lockfile, published RuVector MinCut 2.0.6 dependency, corrected patterns path/cache and native example location, private temporary directory cleanup.
  • Dashboard dependency refresh including React Router 7.18.3; audit findings reduced from 11 affected packages to zero.
  • Ordered slices and one join replace repeated whole-string copying in both rename APIs.
  • CI for Node 22/24, dashboard build/audit, Rust locked tests, optional neural compilation and benchmark compilation.

Measurements

Node v24.19.0, Linux x64, AMD EPYC 9V74. Two warmups, seven measured runs, baseline commit c6ca63020687487bf0c07dc43714f10d1996d0b4. Harness asserts exact baseline and independently expected output equality.

Synthetic input Bulk rename baseline median Updated median Speedup
22 KB 16.31 ms 1.78 ms 9.17x
110 KB 2602.10 ms 5.56 ms 467.92x
220 KB 10742.24 ms 11.91 ms 902.04x

These are edit-dense microbenchmarks, not whole-decompiler speedups or accuracy results. Single-name replacement improved 1.49x to 1.72x on the same fixtures. The Rust parser measured 14.568 to 14.812 ms for 1 MB and 13,720 declarations; no Rust speedup is claimed.

Local validation

  • Existing Node suite: 93 passing assertions, zero failures; baseline had three failures from the stale patterns path.
  • 14 new Node security regression cases pass.
  • Rust: 44 unit tests, 17 integration tests and one doc test pass.
  • cargo check --locked --features neural passes.
  • Dashboard TypeScript and production Vite build pass.
  • npm audit: zero vulnerabilities; cargo audit: zero vulnerabilities, one informational bincode maintenance warning.
  • Ruflo 3.25.6 deep scan of Node source: zero pattern findings; secret scan: none detected.
  • Published Git tree is identical to the locally tested tree: ce245b91c4c4d5593a967836f869d7b16ca6c767.

Research and review evidence

Full review, threat model, scanner triage, audit provenance, benchmarks and reproduction

ADR-138

Research covers CASCADE, JsDeObsBench, JSIMPLIFIER and the August 2026 BinMirror paper. The former unsupported accuracy comparison has been removed: no common held out evaluation establishes a SOTA ranking. Cryptographic hashes are integrity records, not semantic or authenticity proofs.

Compatibility and residual risks

Legacy Node witnesses must be regenerated. Arbitrary URL inputs now fail; pass separately downloaded local files instead. Existing output files are never overwritten and failed writes can leave partial output. Runnable mode withholds heuristic transformations. General readability reconstruction still lacks binding-aware AST guarantees and may change behavior.

Local inputs and regex processing require service-level worker quotas. A caller-owned directory is necessary against concurrent filesystem manipulation. The copied monorepo CLI is not fully packaged in this checkout. ONNX/GPU inference and external behavioral corpora were not executed. Transitive bincode maintenance requires upstream migration.

Merge and rollback

User requested implementation, detailed PR and merge. Merge only after the applicable checks pass and the remote head is verified. Revert the PR as a unit for rollback; do not silently reenable unsafe input execution or downgrade witness verification.

Remote CI result

Security and correctness run 34432853315 passed on head ee15b1bc0f66f515d3086d502d2db6388c8647ed: Node 22, Node 24 and Rust jobs all succeeded, including audits, builds and benchmark compilation.

@ruvnet
ruvnet merged commit 05c2291 into main Sep 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant