fix(core): reject control-bearing BiDi locator text - #171
Conversation
Close the locateNodes result-item gap by requiring the exact node remote type and a usable sharedId within the registry identifier budget before an untrusted adapter value can be retained as a later handle. Co-authored-by: Seongho Bae <[email protected]>
Require fail-closed rejection of whitespace and control injection in accessibility roles, accessible names, BiDi sharedIds, and registry external identifiers before production support exists. Co-authored-by: Seongho Bae <[email protected]>
Fail closed on whitespace or control characters in exact accessibility roles, accessible-name locators, BiDi sharedIds, and registry external identifiers so untrusted protocol text cannot become a later handle. Co-authored-by: Seongho Bae <[email protected]>
Require a fail-closed composition that revalidates the exact current session/context/origin/document epoch, rejects over-budget or non-node items, and translates admitted sharedIds into ObservedNodeHandle values before production support exists. Co-authored-by: Seongho Bae <[email protected]>
Correct a missing comma so the intended missing-production compile failure is not hidden by a test-harness syntax error. Co-authored-by: Seongho Bae <[email protected]>
Revalidate the exact current session, context, origin, and document epoch, admit every untrusted result item first, then translate shared node identities through the registry into ObservedNodeHandle values. Co-authored-by: Seongho Bae <[email protected]>
There was a problem hiding this comment.
Review at exact head 5ee16f1ea72342dde6461f74f0677e21bcc8d623
Draft successor to #138, stacked on #127 (65f51937ff2af64d9c157666e7c3b7df89cbb89a). The two #138 blocking defects are closed. Do not merge this Draft. Do not treat this comment as approval of the stack.
Closed from #138
WebDriverBiDiAccessibilityQuery::newnow rejects whitespace and controls in roles, and rejects controls plus whitespace-only accessible names. Ordinary spaces in names such asTask textand작업 텍스트remain valid.WebDriverBiDiRemoteNodeReference::newandvalidate_external_identifiernow reject empty, over-budget, control, and whitespacesharedIdvalues together.bind_current_nodesis the missing composition: current session/context/origin/epoch first, then result-count budget, then per-itemnode+sharedIdadmission, then registrybind_nodeintoObservedNodeHandle. Stale epoch, unknown session, exhausted identifiers, non-node items, and over-budget results fail closed.
Residual (non-blocking for this slice)
- Composition tests do not yet drive control-bearing or omitted
sharedIdthroughbind_current_nodes. Constructor tests already reject those values; add the composition cases on the next slice so a later reorder cannot bind before admission. docs/doctoring.mdstill says a later admission boundary may translate handles. This head implements that boundary. Keep the no-I/O and untrusted-handle sentences; change the translation sentence to present tense.bind_current_nodesstill does not consumeQueryNodes/SemanticObservationor a non-cloneable protocol-use proof. That is the next bounded product slice, not a silent authority merge.
Next buyer-visible slice
Compose BrowserProtocolOperation::QueryNodes dispatch with bind_current_nodes so an untrusted locateNodes result cannot become ObservedNodeHandle values without proving SemanticObservation on the exact current session, context, origin, and document epoch. Still no browser I/O. Keep Draft until the #127 stack can land.
Passing or in-progress checks on this Draft are not merge permission.
Sent by Cursor Automation: Fix Issues
|
Superseded by #174 after fresh exact ancestry verification. Current #174 head |


Successor to #138 on exact prerequisite #127 head
65f51937ff2af64d9c157666e7c3b7df89cbb89a.Buyer/security gap
#138 admitted accessibility locator text and BiDi
sharedIdvalues after empty and UTF-8 budget checks only, and left admitted remote values unbound to current document authority. This branch keeps the typed operation-to-capability binding, fail-closes control/whitespace protocol text, and translates a reviewedlocateNodesresult intoObservedNodeHandlevalues only while the exact session, context, origin, and document epoch remain current.TDD sequence
601628b/ syntax-fixedce0af01established missing-production REDs for control-bearing locator text and forbind_current_nodes.496f556rejects whitespace/controls in exact roles, control/whitespace-only names, BiDisharedId, and registry external identifiers. Ordinary spaces in accessible names such asTask textand작업 텍스트remain valid.5ee16f1admits every untrusted result item first, then binds admittedsharedIdvalues through the registry. Over-budget results, non-node items, stale epochs, unknown sessions, and exhausted node-identifier space fail closed.Exact-current proof
On unchanged exact head
5ee16f1in this workspace:cargo test --locked -p originweave-core --all-targetssucceeded;cargo clippy --locked -p originweave-core --all-targets -- -D warningssucceeded;RUSTDOCFLAGS='-D warnings' cargo doc --locked -p originweave-core --no-depssucceeded;cargo fmt --all --checksucceeded;This does not transfer #138 or #127 check, review, coverage, or merge evidence. Keep Draft while #127 and its prerequisite stack remain active. Workspace verification is not GitHub CI, production-coverage, or independent approval evidence.
Truth boundary
This still does not serialize a BiDi command, authenticate Chromium, observe a live accessibility tree, authorize typed input, or prove a post-condition. A later adapter must sample the query result from a trusted transport and revalidate the returned handles immediately before action.
Do not merge this Draft.