Skip to content

fix: guard callback replay reentrancy - #52

Open
mcollina wants to merge 2 commits into
ShogunPanda:mainfrom
mcollina:security/sec-04-callback-reentrancy
Open

mcollina wants to merge 2 commits into
ShogunPanda:mainfrom
mcollina:security/sec-04-callback-reentrancy

Conversation

@mcollina

Copy link
Copy Markdown
Contributor

Protect callback replay from same-parser reentrancy and destruction.

Callback dispatch now uses bounded immutable snapshots of event bytes and callback activation state. Parser methods and FFI setters reject mutation while replay is active; nested parses consume zero bytes. Destruction requested from a callback stops the remaining batch and is performed only after replay has unwound.

The WebAssembly wrapper also captures JavaScript callback exceptions and rethrows them after Rust has cleaned up replay state. Native and mirrored WASM regressions cover nested mutation, deferred destruction, immutable callback delivery, and exception cleanup.

Validation includes the full Rust suite, fuzz checks, Rust/C++ references, both WASM variants, and all 101 WASM tests.

This fixes SEC-04 from #38. Callback ABI and explicit-method callback delivery remain isolated to their focused PRs.

This branch has not been deployed

No deployments
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