Repository navigation
[PR] fix(#2766): durable classifiers reject assistant-role marker echoes (identity takeover) - #2770
Closed
ranxianglei wants to merge 1 commit into
Closed
ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
…choes cannot claim durable/* identity
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3045-pr.2770.7c9274dThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2770.tgz
npm install -g packageInstall instructions are refreshed on each push. |
Owner
Author
[bot] 🏷 PR #2770 review 完成。结论:可合并(建议人工合并——安全语义变更,且当前 branch protection 状态为 blocked)。 审查范围与证据
结构化八问
CI 状态(审查时点):10 个 guard job 全绿(kernel-guard、docs-coverage、config-surface-guard、lock-sync、lane-guard、version-guard、unused-exports、pi-subagents-guard、docs-sync、build-artifact);4 个 test matrix job(ubuntu/windows × node22/24)审查时仍在跑,本地已定向复验受影响域全绿。若 test matrix 转红我会跟进。 |
Owner
Author
|
(ai: zhipuai-lb/glm-5.3) 陈旧票清理(第三批动作①):目标 issue #2766 已关。为避免重复劳动关闭本 PR;如判断有误请直接 reopen 并留言。 |
Owner
Author
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.
Problem (#2766)
#2736's durable virtual tool path projection (
Config.messagePathOf+ defaultdurable/*latest-per-identity) had NO role boundary on the recognition side: all four dsh carrier classifiers checked onlycontentType === "text"+ marker string. Any assistant message containing a carrier marker (model echo of a visible format string — the #933/#1039 echo family; or prompt-injected output) was projected onto the carrier'sdurable/<name>identity and, under latest-per-identity, became its protected LATEST instance while the real host-injected carrier degraded to foldable. One compression later the forged catalog/snapshot is what the model sees forever: identity takeover, not self-protection.Adversarial variant (#2446 failure mode made direct): injected instructions make the model emit a forged
<mcp_catalog>listing attacker-chosen server/tool names → the forged inventory gets pinned as the protected latestdurable/mcp-catalog, the real one folds away.Fix (host-side, zero kernel changes)
Each classifier in
src/durable-message-guards.tsnow requiresmsg.role !== "assistant"in its predicate. All four carriers are user-role injections by definition (each doc comment states it), so excluding assistant loses zero legitimate protection and cuts the takeover vector at the decision point — the classifier is the single choke point through which every consumer (wire protection inhandle.ts, plugin-tool compress viaeffectiveConfig(), nudge panel) resolves durable identity.Blacklist over whitelist, deliberately:
Tool exchanges are untouched —
virtualToolPathOfnever calls the classifier on tool-call/tool-result content types.Behavior change (old → new)
Tests
New
tests/issue2766-durable-role-boundary.test.ts:/__bili/plugin/tool): real user skill catalog mid-history + a LATER assistant echo of the same marker with a forged entry → after a fold covering both, the REAL catalog survives and the echo/forged entry are gone.Verified A/B: all 5 new tests FAIL on the unfixed code (the e2e reproduces the actual takeover — echo pinned, real catalog folded) and PASS with the fix. Existing durable-family suites (
durable-tool-identity,issue2419/2446/2447/2481): 30/30 green.npm run typecheck+npm run buildgreen.Closes #2766