diff --git a/CHANGELOG.md b/CHANGELOG.md index 120e1df27d1..4c15af79440 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- Matrix/commands: skip DM pairing-store reads on room traffic now that room control-command authorization ignores pairing-store entries, keeping the room path narrower without changing room auth behavior. - fix(gateway): enforce localRoots containment on webchat audio embedding path [AI-assisted]. (#67298) Thanks @pgondhi987. - fix(matrix): block DM pairing-store entries from authorizing room control commands [AI-assisted]. (#67294) Thanks @pgondhi987. - Docker/build: verify `@matrix-org/matrix-sdk-crypto-nodejs` native bindings with `find` under `node_modules` instead of a hardcoded `.pnpm/...` path so pnpm v10+ virtual-store layouts no longer fail the image build. (#67143) thanks @ly85206559. diff --git a/extensions/matrix/src/matrix/monitor/handler.test.ts b/extensions/matrix/src/matrix/monitor/handler.test.ts index 9599c87008d..2cc1da533b5 100644 --- a/extensions/matrix/src/matrix/monitor/handler.test.ts +++ b/extensions/matrix/src/matrix/monitor/handler.test.ts @@ -446,10 +446,11 @@ describe("matrix monitor handler pairing account scope", () => { }); it("blocks room control commands from DM-only paired senders", async () => { + const readAllowFromStore = vi.fn(async () => ["@user:example.org"]); const { handler, finalizeInboundContext, recordInboundSession } = createMatrixHandlerTestHarness({ isDirectMessage: false, - readAllowFromStore: vi.fn(async () => ["@user:example.org"]), + readAllowFromStore, roomsConfig: { "!room:example.org": { requireMention: false }, }, @@ -473,6 +474,7 @@ describe("matrix monitor handler pairing account scope", () => { expect(recordInboundSession).not.toHaveBeenCalled(); expect(finalizeInboundContext).not.toHaveBeenCalled(); + expect(readAllowFromStore).not.toHaveBeenCalled(); }); it("processes room messages mentioned via displayName in formatted_body", async () => { diff --git a/extensions/matrix/src/matrix/monitor/handler.ts b/extensions/matrix/src/matrix/monitor/handler.ts index c711aa7b1b9..68b13e4d069 100644 --- a/extensions/matrix/src/matrix/monitor/handler.ts +++ b/extensions/matrix/src/matrix/monitor/handler.ts @@ -586,7 +586,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam senderNamePromise ??= getMemberDisplayName(roomId, senderId).catch(() => senderId); return await senderNamePromise; }; - const storeAllowFrom = await readStoreAllowFrom(); + const storeAllowFrom = isDirectMessage ? await readStoreAllowFrom() : []; const roomUsers = roomConfig?.users ?? []; const accessState = resolveMatrixMonitorAccessState({ allowFrom,