AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.
Rust agent-memoryai-agentsbm25claude-codeclicode-searchcursordatabaseelasticsearchfull-text-searchhybrid-searchjsonllocal-firstmcpmcp-servermodel-context-protocolragrustsearch-enginevector-search
Empirical note: does a throwing __wakeup stop a __destruct gadget?
Ran the WP_HTML_Token gadget shape in real PHP (Docker: 7.4.33, 8.0.30, 8.3.32)
with a control. Script: sink-census/gadget_wakeup_test.php.
docker run --rm -v "$PWD":/app php:8.3-cli php /app/gadget_wakeup_test.php
Setup
Guarded= WP_HTML_Token's shape: dangerous__destruct(call_user_func($this->on_destroy, $this->bookmark_name)) + a throwing__wakeup.NoGuard= the control: identical dangerous__destruct, no__wakeup.- Payloads set
on_destroy='GADGET'(a marker) and are unserialized directly and nested inside a plainContainer.
Result (identical on 7.4 / 8.0 / 8.3)
| case | class | outcome |
|---|---|---|
| A | NoGuard, direct | GADGET FIRED (__destruct ran call_user_func) |
| D | NoGuard, nested | GADGET FIRED |
| B | Guarded, direct | __wakeup throws → gadget did NOT fire |
| C | Guarded, nested | __wakeup throws → gadget did NOT fire |
Conclusion (verified, not from memory)
- A throwing
__wakeupsuppresses__destruct. When__wakeupthrows duringunserialize, PHP treats the object as failed and skips the destructor — direct and nested, all tested versions. The "__destructsurvives a__wakeupthrow" folklore is false for PHP ≥ 7.4 (may have held in PHP 5). WP_HTML_Tokenis genuinely defused by its__wakeupguard.- The control fired, proving the gadget is real and the guard is what stops it.
⇒ a dangerous
__destructwithout a throwing__wakeupis a live gadget.
Consequence for the gadget hunt
The exposed gadget inventory = classes with a dangerous magic method (esp.
__destruct/__toString/__call) that lack a throwing __wakeup guard (or
route through __unserialize, which this test did not cover). Build that list next.