Fix #1987: A forged VERB_PROJECTION mark lets a plugin delete a neighbour's command through VerbRegistry.unregister - #1995
Open
philcunliffe wants to merge 1 commit into
Open
philcunliffe wants to merge 1 commit into
philcunliffe wants to merge 1 commit into
Conversation
…e delete a neighbour's or a core command (issue #1987) retractCommand routed a deletion on isVerbProjection(commandRegistry.get(name)) alone, and the mark that test reads is an enumerable symbol on a record ctx.commands.get hands back live: a plugin lifted it off a real projection with Object.getOwnPropertySymbols, stamped it onto a neighbour's command, squatted a verb of that name (no projection is made, the name is taken) and released it, and the kernel deleted the neighbour's command for it. Measured through the real dispatch(): the same lines took 'acme sync' and 'status' off the registry, after which the squatter registered both names and its bodies ran. Retraction now requires a second fact the kernel recorded: the released verb's registrar, read before its ledger entry is deleted, has to agree with CommandRegistry.ownerOf(name). Both bindings are written only inside registeringAs brackets, so no plugin write moves a name from one answer to the other. The mark stays, answering what the command is (a projection, not a plugin command sharing the name); the per-registry projection ledger LLP 0264 paragraph-verb refuses is still not kept, because core retracting core and the host displacement path compare undefined === undefined and keep working. A command registry without ownerOf (a host's own, injected) retracts on the mark alone, the tolerance the surrounding branches already extend, and the refusing branch warns (verb.retract.registrar_mismatch) like the tolerated ones do. LLP 0427, extending LLP 0424 #consequences, records the revisit of the "forging it buys nothing" premise that bullet called for. This is the second and last spelling of issue #1980: PR #1988 closed the direct route, and the forge was the one route that survived it. Fixes #1987 Fixes #1980 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature or issue
A plugin could lift the
VERB_PROJECTIONsymbol off a live command record withObject.getOwnPropertySymbols, stamp it onto a record it does not own, squat a verb of that name and release it, andretractCommanddeleted what then read as its own projection: measured through the realdispatch(), the forge removed a neighbour'sacme syncand core'sstatus, after which the squatter registered both names and its bodies ran (issue #1987). This was the second and last spelling of issue #1980; PR #1988 closed the direct route, so both issues close here.Solution
retractCommandnow requires a second, kernel-recorded fact besides the mark: the released verb's recorded registrar (read before its ledger entry is deleted) must equalCommandRegistry.ownerOf(name). Both bindings are written only insideregisteringAsbrackets, so no plugin write can move a name from one answer to the other; a mismatch warns (verb.retract.registrar_mismatch) and refuses.undefined === undefinedand keep working; a host-injected registry withoutownerOfretracts on the mark alone, the tolerance the surrounding branches already extend. LLP 0427 records the revisit of the "forging it buys nothing" premise that LLP 0424 #consequences called for.dispatch()for both measured victims (fail before, pass after), plus a plugin releasing its own verb (aliases retracted with it) and core retracting core.CPU and memory pass: one
Map.getand oneownerOflookup per verb release, and releases are rare; nothing per-record or per-dispatch, no allocation outside the refusal path, no growth with data volume or uptime. No CPU or memory concern.Code: +62 / -17 lines
Fixes #1987
Fixes #1980