Cybersecurity-Projects/PROJECTS/beginner/deserialization-gadget-lab/test
CarterPerez-dev b6b5c03d74 feat(rube): M6 boundary detector, implemented against criteria written before the code
Implements the detector Codex specified while it had no implementation to look
at, so neither model defined and graded the same thing.

Parser-level budgets rather than post-parse checks. Codex's architectural point
was that inspecting after parsing is too late because the allocation already
happened, so Limits and Budget enforce byte size, depth, node count, registered
objects, symbol definitions, collection entries, scalar bytes and object links
DURING recursive descent. The size ceiling is checked before the parser is
constructed and non-String input is rejected without ever calling to_s.

Three policies, STRICT_ALLOWLIST as the default, on the reasoning that people
keep defaults far longer than they intend. No enforcing mode accepts an
allowed_sinks option, because permitting a class-and-sink pair still authorizes
a callback during load. OBSERVE_AND_LOG refuses to construct without a
reporter. Allowlisting a class does NOT exempt its sinks, and that is a test.

No method is named safe?, trusted?, sanitized? or safe_load, and a test asserts
their absence. Those names claim a guarantee this cannot make.

The gate demonstrates the documented bypass rather than asserting it. Under
DENY_SINKS_ONLY the detector ACCEPTS the CVE-2026-41316 payload, and the gate
then loads that accepted snapshot on vulnerable erb and confirms the canary
fires. Our own detector, in a shipped mode, admits a payload that achieves code
execution. That is the limitation notice being true rather than decorative, and
if it ever stops being demonstrable the gate fails.

The notice ships verbatim and names the bypass concretely: a payload carrying
no sink tag can still reach dangerous code, the published chain produces zero
sink tags because ERB defines no marshal_load, and an application that
allowlists ERB will accept it.

106 tests, 235 assertions across four suites. Five gates: check, matrix,
exploit, detector, target.
2026-07-26 11:36:43 -04:00
..
marshal feat(rube): M6 boundary detector, implemented against criteria written before the code 2026-07-26 11:36:43 -04:00
support feat(rube): M4 payload builder - working CVE-2026-41316 chain with version-predicted gate 2026-07-26 10:07:16 -04:00
chains_test.rb feat(rube): M4 payload builder - working CVE-2026-41316 chain with version-predicted gate 2026-07-26 10:07:16 -04:00
control_check.rb refactor(rube): strip narration from control and matrix output 2026-07-26 10:05:01 -04:00
scanner_test.rb feat(rube): M3 gadget scanner - reflection-based sink discovery with reachability filter 2026-07-26 09:57:03 -04:00
test_helper.rb feat(rube): M1 Marshal stream parser - inspect payloads without deserializing 2026-07-26 09:32:14 -04:00