Skip to content

fix(silent-reply): classify 🧵 sessionKeys as internal to stop spurious rewrites - #73400

Closed
zqchris wants to merge 3 commits into
openclaw:mainfrom
zqchris:fix/silent-reply-thread-classify
Closed

zqchris wants to merge 3 commits into
openclaw:mainfrom
zqchris:fix/silent-reply-thread-classify

Conversation

@zqchris

@zqchris zqchris commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

classifySilentReplyConversationType evaluates session-key kind in priority order. The current ordering puts :group: / :channel: first, then :direct: / :dm:, then surface fallback. It does not handle :thread: at all.

OpenClaw-internal subagent / ACP / cron-spawned threads anchor under their parent session — e.g. agent:main:telegram:direct:435427284:thread:435427284:300118 (a Telegram topic-bound subagent thread) or agent:main:cron:job-id:run:run-id:thread:dreaming-narrative-light (dreaming narrative subagent run).

These keys match .includes(":direct:") first and get classified as direct conversations, then run through the silent-reply rewrite path. Result: internal thread replies that intentionally stayed silent get overwritten with one of SILENT_REPLY_REWRITE_TEXTS ("All quiet on my side.", "Standing by.", etc.), surfacing as random filler text on internal turns.

The fix: check for :thread: before the :direct: / :dm: branch so any threaded session is classified as internal regardless of its parent surface.

Diff

3 lines of source plus 2 regression tests:

// src/shared/silent-reply-policy.ts
if (normalizedSessionKey.includes(":group:") || normalizedSessionKey.includes(":channel:")) {
  return "group";
}
+ if (normalizedSessionKey.includes(":thread:")) {
+   return "internal";
+ }
if (normalizedSessionKey.includes(":direct:") || normalizedSessionKey.includes(":dm:")) {
  return "direct";
}

Test plan

  • pnpm test src/shared/silent-reply-policy.test.ts — 9/9 passing on this branch (was 8/8, +1 covering the threaded-under-direct case and a cron-thread case)
  • pnpm check:changed clean
  • Reviewer can verify no :thread: substring legitimately appears in any direct/group sessionKey scheme that would cause this to misclassify a real conversation as internal — happy to discuss if there's a counter-example.

@aisle-research-bot

aisle-research-bot Bot commented Apr 28, 2026 •

Copy link
Copy Markdown

🔒 Aisle Security Analysis

We found 1 potential security issue(s) in this PR:

# Severity Title
1 🔵 Low Thread marker parsing too permissive allows forcing internal conversation type via crafted sessionKey
1. 🔵 Thread marker parsing too permissive allows forcing `internal` conversation type via crafted sessionKey
Property Value
Severity Low
CWE CWE-20
Location src/shared/silent-reply-policy.ts:75-84

Description

classifySilentReplyConversationType now treats any session key with a parsed threadId as internal. However parseThreadSessionSuffix() accepts the last occurrence of ":thread:" anywhere in the string and treats everything after it as the thread id.

  • Input: params.sessionKey (potentially caller-controlled) is passed to parseThreadSessionSuffix.
  • Parsing: parseThreadSessionSuffix uses lastIndexOf(":thread:") and does not require the marker to be a true suffix (end-of-string) nor the thread id to be a single segment.
  • Result: an attacker can append or embed :thread:<anything> (including additional markers like :direct:) to cause threadId to be non-empty and force classification to internal.
  • Impact: silent-reply behavior becomes attacker-influenced (silent-reply rewrites suppressed) and any other downstream logic keyed on this conversation type may be affected.

Vulnerable code (classification):

const { threadId } = parseThreadSessionSuffix(params.sessionKey);
if (threadId) {
  return "internal";
}

Permissive parsing:

const threadIndex = lowerRaw.lastIndexOf(":thread:");
const threadIdRaw = markerIndex === -1 ? undefined : raw.slice(markerIndex + marker.length);
const threadId = normalizeOptionalString(threadIdRaw);

Recommendation

Make parseThreadSessionSuffix enforce a strict suffix shape, and only treat a key as threaded when it matches exactly <base>:thread:<id> at the end.

For example:

export function parseThreadSessionSuffix(sessionKey: string | undefined | null) {
  const raw = normalizeOptionalString(sessionKey);
  if (!raw) return { baseSessionKey: undefined, threadId: undefined };

  ​// Require marker at end, and restrict threadId to a single segment.
  const m = raw.match(/^(.*):thread:([^:]+)$/i);
  if (!m) return { baseSessionKey: raw, threadId: undefined };

  return { baseSessionKey: m[1], threadId: m[2] };
}

Additionally consider rejecting/ignoring session keys that contain multiple :thread: markers or where baseSessionKey becomes empty unexpectedly.


Analyzed PR: #73400 at commit 2e94e3c

Last updated on: 2026-04-28T09:10:53Z

@greptile-apps

greptile-apps Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a classification priority bug in classifySilentReplyConversationType where :thread: session keys (subagent / ACP / cron-spawned threads) were matching the :direct: branch first and incorrectly receiving SILENT_REPLY_REWRITE_TEXTS rewrites. The fix — inserting a :thread: → "internal" guard before the :direct: / :dm: check — is correct and well-tested for the described cases. The only gap is that the :group: / :channel: check still runs before :thread:, so group-anchored thread keys would be classified as "group" rather than "internal", which is inconsistent with the stated invariant but has no practical impact given that group and internal share identical default policy/rewrite settings.

Confidence Score: 4/5

Safe to merge — the fix correctly addresses the stated bug with no regressions.

The change is minimal, targeted, and backed by regression tests. The only finding is a P2 incompleteness around group-anchored threads, which carries no observable behavioral difference under current defaults.

No files require special attention; the P2 gap is in src/shared/silent-reply-policy.ts lines 71–79.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: src/shared/silent-reply-policy.ts
Line: 71-79

Comment:
**Group-anchored threads still classified as "group", not "internal"**

The PR description states the fix ensures threads are classified as internal "regardless of parent surface," but the `:group:` / `:channel:` check still runs *before* the new `:thread:` check. A session key like `agent:main:discord:group:123:thread:456` would still return `"group"` rather than `"internal"`.

Under current defaults, `group` and `internal` share identical policy (`allow`) and rewrite (`false`) settings, so there's no observable difference today. But the stated invariant ("any `:thread:` → internal") isn't fully enforced, and a test for this case is absent. If group-anchored threads should also stay silent/unmodified as internal sessions, the `:thread:` guard needs to move above the `:group:` / `:channel:` branch as well.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "docs(changelog): note silent-reply :thre..." | Re-trigger Greptile

Comment on lines 71 to 79
if (normalizedSessionKey.includes(":group:") || normalizedSessionKey.includes(":channel:")) {
return "group";
}
if (normalizedSessionKey.includes(":thread:")) {
return "internal";
}
if (normalizedSessionKey.includes(":direct:") || normalizedSessionKey.includes(":dm:")) {
return "direct";
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Group-anchored threads still classified as "group", not "internal"

The PR description states the fix ensures threads are classified as internal "regardless of parent surface," but the :group: / :channel: check still runs before the new :thread: check. A session key like agent:main:discord:group:123:thread:456 would still return "group" rather than "internal".

Under current defaults, group and internal share identical policy (allow) and rewrite (false) settings, so there's no observable difference today. But the stated invariant ("any :thread: → internal") isn't fully enforced, and a test for this case is absent. If group-anchored threads should also stay silent/unmodified as internal sessions, the :thread: guard needs to move above the :group: / :channel: branch as well.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/shared/silent-reply-policy.ts
Line: 71-79

Comment:
**Group-anchored threads still classified as "group", not "internal"**

The PR description states the fix ensures threads are classified as internal "regardless of parent surface," but the `:group:` / `:channel:` check still runs *before* the new `:thread:` check. A session key like `agent:main:discord:group:123:thread:456` would still return `"group"` rather than `"internal"`.

Under current defaults, `group` and `internal` share identical policy (`allow`) and rewrite (`false`) settings, so there's no observable difference today. But the stated invariant ("any `:thread:` → internal") isn't fully enforced, and a test for this case is absent. If group-anchored threads should also stay silent/unmodified as internal sessions, the `:thread:` guard needs to move above the `:group:` / `:channel:` branch as well.

How can I resolve this? If you propose a fix, please make it concise.

@clawsweeper

clawsweeper Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR adds trusted structured thread-session classification for silent replies, propagates Telegram/runtime thread trust through dispatch, delivery, prompt, and outbound paths, and adds tests plus a changelog entry.

Reproducibility: yes. Current main has a source-level reproduction: a Telegram direct topic session key such as agent:main:telegram:direct:123:thread:123:42 classifies as direct, and the Telegram no-visible-response fallback can route exact NO_REPLY through direct rewrite settings.

Next step before merge
This is an active contributor PR with no blocking review finding; the remaining work is maintainer review, rebase if needed, and merge handling rather than an automated repair PR.

Security
Cleared: No concrete security or supply-chain regression was found; the diff is limited to TypeScript policy/Telegram plumbing, tests, and changelog text with no workflow, dependency, lockfile, or secret-handling changes.

Review details

Best possible solution:

Land the trusted provider/runtime thread assertion model with its regression coverage and changelog entry after normal maintainer review and any needed rebase.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main has a source-level reproduction: a Telegram direct topic session key such as agent:main:telegram:direct:123:thread:123:42 classifies as direct, and the Telegram no-visible-response fallback can route exact NO_REPLY through direct rewrite settings.

Is this the best way to solve the issue?

Yes. The PR head is the narrow maintainable direction because it avoids unconditional 🧵 substring classification and requires structured thread trust before applying internal silent-reply policy.

What I checked:

  • Current main classifier misses thread keys: On current main, classifySilentReplyConversationType checks :group:/:channel: first, then :direct:/:dm:, and has no 🧵 handling, so a key like agent:main:telegram:direct:123🧵123:42 resolves as direct. (src/shared/silent-reply-policy.ts:69, 4655ee803d27)
  • Current Telegram creates direct thread session keys: Telegram DM topic handling builds thread session keys with resolveThreadSessionKeys({ baseSessionKey, threadId: ${chatId}:${dmThreadId} }), matching the direct-plus-thread shape in the PR report. (extensions/telegram/src/bot-message-context.ts:392, 4655ee803d27)
  • Current fallback can rewrite NO_REPLY visibly: The Telegram no-visible-response fallback creates an outbound NO_REPLY plan using the policy session key; with direct classification, the default direct rewrite path can turn the silent token into filler text. (extensions/telegram/src/bot-message-dispatch.ts:1303, 4655ee803d27)
  • PR avoids broad substring trust: At PR head, the classifier only returns internal for structured thread keys when trustThreadSessionKey is true, addressing the earlier low-severity bot concern about unconditional 🧵 substring classification. (src/shared/silent-reply-policy.ts:108, 42f1627d7909)
  • PR propagates Telegram thread trust: The new Telegram helper validates the parsed thread suffix against provider chat/thread candidates, and dispatch stamps TrustedThreadSessionKey plus an internal silentReplyContext for trusted policy sessions. (extensions/telegram/src/bot/thread-policy.ts:29, 42f1627d7909)
  • PR CI check-runs are green: GitHub check-runs fetched for PR head returned 100 runs and no non-success conclusions after excluding neutral/skipped statuses. (42f1627d7909)

Likely related people:

  • Takhoffman: Commit 1303b03 introduced silent-reply policy by conversation type across the classifier, config resolver, outbound planner, Telegram dispatch, and tests. (role: introduced behavior; confidence: high; commits: 1303b032412b; files: src/shared/silent-reply-policy.ts, src/config/silent-reply.ts, src/infra/outbound/payloads.ts)
  • steipete: Recent shared turn-kernel work touched the Telegram message context, Telegram dispatch, and auto-reply dispatch paths involved in this policy propagation. (role: recent maintainer; confidence: medium; commits: 9a9cd0c0abdf; files: extensions/telegram/src/bot-message-context.ts, extensions/telegram/src/bot-message-dispatch.ts, src/auto-reply/dispatch.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against 4655ee803d27.

@zqchris
zqchris force-pushed the fix/silent-reply-thread-classify branch from 2e94e3c to ddf53b9 Compare May 1, 2026 06:27
@zqchris
zqchris force-pushed the fix/silent-reply-thread-classify branch from ddf53b9 to 91304d0 Compare May 1, 2026 06:44
@zqchris zqchris mentioned this pull request May 1, 2026
7 of 25 tasks
@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: L and removed size: M labels May 1, 2026
@zqchris
zqchris force-pushed the fix/silent-reply-thread-classify branch from b93d2c7 to 42f1627 Compare May 1, 2026 07:42
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 2, 2026
…penclaw#73241, openclaw#73400

Second hardening pass after the first round triggered new findings on
Aisle's re-scan. PR openclaw#73406 (auto-reply voice silent) was meanwhile
landed by the maintainer in upstream commit 28bf71d — that one will
drop out at the next rebase via patch-id match, no source change here.

PR openclaw#73241 (BB http hardening) — 1 HIGH + 2 MEDIUM:

- monitor-processing.sanitizeForLog: redact common secret-bearing
  patterns (`?password=`, `?token=`, `?api_key=`, `?secret=`,
  `Authorization: Bearer / Basic …`) before the value reaches the log
  sink. BlueBubbles uses query-string auth by default, so attachment
  download failures and similar errors can carry the API password in
  the captured request URL (CWE-532).
- history.fetchBlueBubblesMessageByGuid: validate the derived bareGuid
  (length ≤128, charset `[A-Za-z0-9._:-]+`, non-empty) before issuing
  the request. A trailing `/` would otherwise produce an empty bareGuid
  and turn the call into an unintended `/api/v1/message/` collection
  query (CWE-20).
- monitor-processing reply-context verbose logs: log only `bodyLen=`
  metadata, not the quoted message text itself. Verbose logs are
  retained / shipped to aggregators and would otherwise leak private
  chat content (CWE-532).

PR openclaw#73235 (BB routing guards) — 1 MEDIUM + 2 LOW:

- monitor-reply-cache.resolveBlueBubblesMessageId: when
  `requireKnownShortId=true` and `chatContext` lacks any identifier,
  throw "requires a chat scope" instead of resolving the short id.
  Short ids are allocated from a single global counter across every
  account and chat, so an action call without chat scope could
  silently apply to the wrong conversation (CWE-285). Test updated to
  expect fail-closed (was previously fail-open with a comment that
  acknowledged the risk).
- monitor-reply-cache.buildCrossChatError: replace raw inputId in the
  thrown error message with `<short:N-digit>` or `<uuid:prefix…>`
  shape descriptors. Combined with the earlier chatGuid redaction,
  cross-chat errors now leak no concrete identifier (CWE-117 /
  CWE-200). The Low PII finding on monitor-processing verbose logs is
  resolved automatically by the sanitizeForLog redaction extension
  added for PR openclaw#73241 openclaw#1.

PR openclaw#73400 (silent-reply 🧵) — 1 MEDIUM:

- silent-reply-policy.classifySilentReplyConversationType: classify
  a session key as `internal` only when `parseThreadSessionSuffix`
  returns a real `🧵<id>` suffix, not on a free-form `🧵`
  substring match. Caller-supplied session keys can no longer embed
  the marker mid-string to force the conversation type to `internal`
  and bypass silent-reply rewrites (CWE-840).
@zqchris

zqchris commented May 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing to stay under the active-PR quota — will resubmit when there's bandwidth on the upstream side. Patch lives on zqchris/openclaw#patch/chris and the silent-reply hardening it depends on remains active locally.

@zqchris zqchris closed this May 3, 2026
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 4, 2026
…penclaw#73241, openclaw#73400

Second hardening pass after the first round triggered new findings on
Aisle's re-scan. PR openclaw#73406 (auto-reply voice silent) was meanwhile
landed by the maintainer in upstream commit 28bf71d — that one will
drop out at the next rebase via patch-id match, no source change here.

PR openclaw#73241 (BB http hardening) — 1 HIGH + 2 MEDIUM:

- monitor-processing.sanitizeForLog: redact common secret-bearing
  patterns (`?password=`, `?token=`, `?api_key=`, `?secret=`,
  `Authorization: Bearer / Basic …`) before the value reaches the log
  sink. BlueBubbles uses query-string auth by default, so attachment
  download failures and similar errors can carry the API password in
  the captured request URL (CWE-532).
- history.fetchBlueBubblesMessageByGuid: validate the derived bareGuid
  (length ≤128, charset `[A-Za-z0-9._:-]+`, non-empty) before issuing
  the request. A trailing `/` would otherwise produce an empty bareGuid
  and turn the call into an unintended `/api/v1/message/` collection
  query (CWE-20).
- monitor-processing reply-context verbose logs: log only `bodyLen=`
  metadata, not the quoted message text itself. Verbose logs are
  retained / shipped to aggregators and would otherwise leak private
  chat content (CWE-532).

PR openclaw#73235 (BB routing guards) — 1 MEDIUM + 2 LOW:

- monitor-reply-cache.resolveBlueBubblesMessageId: when
  `requireKnownShortId=true` and `chatContext` lacks any identifier,
  throw "requires a chat scope" instead of resolving the short id.
  Short ids are allocated from a single global counter across every
  account and chat, so an action call without chat scope could
  silently apply to the wrong conversation (CWE-285). Test updated to
  expect fail-closed (was previously fail-open with a comment that
  acknowledged the risk).
- monitor-reply-cache.buildCrossChatError: replace raw inputId in the
  thrown error message with `<short:N-digit>` or `<uuid:prefix…>`
  shape descriptors. Combined with the earlier chatGuid redaction,
  cross-chat errors now leak no concrete identifier (CWE-117 /
  CWE-200). The Low PII finding on monitor-processing verbose logs is
  resolved automatically by the sanitizeForLog redaction extension
  added for PR openclaw#73241 openclaw#1.

PR openclaw#73400 (silent-reply 🧵) — 1 MEDIUM:

- silent-reply-policy.classifySilentReplyConversationType: classify
  a session key as `internal` only when `parseThreadSessionSuffix`
  returns a real `🧵<id>` suffix, not on a free-form `🧵`
  substring match. Caller-supplied session keys can no longer embed
  the marker mid-string to force the conversation type to `internal`
  and bypass silent-reply rewrites (CWE-840).
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 5, 2026
…penclaw#73241, openclaw#73400

Second hardening pass after the first round triggered new findings on
Aisle's re-scan. PR openclaw#73406 (auto-reply voice silent) was meanwhile
landed by the maintainer in upstream commit 28bf71d — that one will
drop out at the next rebase via patch-id match, no source change here.

PR openclaw#73241 (BB http hardening) — 1 HIGH + 2 MEDIUM:

- monitor-processing.sanitizeForLog: redact common secret-bearing
  patterns (`?password=`, `?token=`, `?api_key=`, `?secret=`,
  `Authorization: Bearer / Basic …`) before the value reaches the log
  sink. BlueBubbles uses query-string auth by default, so attachment
  download failures and similar errors can carry the API password in
  the captured request URL (CWE-532).
- history.fetchBlueBubblesMessageByGuid: validate the derived bareGuid
  (length ≤128, charset `[A-Za-z0-9._:-]+`, non-empty) before issuing
  the request. A trailing `/` would otherwise produce an empty bareGuid
  and turn the call into an unintended `/api/v1/message/` collection
  query (CWE-20).
- monitor-processing reply-context verbose logs: log only `bodyLen=`
  metadata, not the quoted message text itself. Verbose logs are
  retained / shipped to aggregators and would otherwise leak private
  chat content (CWE-532).

PR openclaw#73235 (BB routing guards) — 1 MEDIUM + 2 LOW:

- monitor-reply-cache.resolveBlueBubblesMessageId: when
  `requireKnownShortId=true` and `chatContext` lacks any identifier,
  throw "requires a chat scope" instead of resolving the short id.
  Short ids are allocated from a single global counter across every
  account and chat, so an action call without chat scope could
  silently apply to the wrong conversation (CWE-285). Test updated to
  expect fail-closed (was previously fail-open with a comment that
  acknowledged the risk).
- monitor-reply-cache.buildCrossChatError: replace raw inputId in the
  thrown error message with `<short:N-digit>` or `<uuid:prefix…>`
  shape descriptors. Combined with the earlier chatGuid redaction,
  cross-chat errors now leak no concrete identifier (CWE-117 /
  CWE-200). The Low PII finding on monitor-processing verbose logs is
  resolved automatically by the sanitizeForLog redaction extension
  added for PR openclaw#73241 openclaw#1.

PR openclaw#73400 (silent-reply 🧵) — 1 MEDIUM:

- silent-reply-policy.classifySilentReplyConversationType: classify
  a session key as `internal` only when `parseThreadSessionSuffix`
  returns a real `🧵<id>` suffix, not on a free-form `🧵`
  substring match. Caller-supplied session keys can no longer embed
  the marker mid-string to force the conversation type to `internal`
  and bypass silent-reply rewrites (CWE-840).
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 5, 2026
…penclaw#73241, openclaw#73400

Second hardening pass after the first round triggered new findings on
Aisle's re-scan. PR openclaw#73406 (auto-reply voice silent) was meanwhile
landed by the maintainer in upstream commit 28bf71d — that one will
drop out at the next rebase via patch-id match, no source change here.

PR openclaw#73241 (BB http hardening) — 1 HIGH + 2 MEDIUM:

- monitor-processing.sanitizeForLog: redact common secret-bearing
  patterns (`?password=`, `?token=`, `?api_key=`, `?secret=`,
  `Authorization: Bearer / Basic …`) before the value reaches the log
  sink. BlueBubbles uses query-string auth by default, so attachment
  download failures and similar errors can carry the API password in
  the captured request URL (CWE-532).
- history.fetchBlueBubblesMessageByGuid: validate the derived bareGuid
  (length ≤128, charset `[A-Za-z0-9._:-]+`, non-empty) before issuing
  the request. A trailing `/` would otherwise produce an empty bareGuid
  and turn the call into an unintended `/api/v1/message/` collection
  query (CWE-20).
- monitor-processing reply-context verbose logs: log only `bodyLen=`
  metadata, not the quoted message text itself. Verbose logs are
  retained / shipped to aggregators and would otherwise leak private
  chat content (CWE-532).

PR openclaw#73235 (BB routing guards) — 1 MEDIUM + 2 LOW:

- monitor-reply-cache.resolveBlueBubblesMessageId: when
  `requireKnownShortId=true` and `chatContext` lacks any identifier,
  throw "requires a chat scope" instead of resolving the short id.
  Short ids are allocated from a single global counter across every
  account and chat, so an action call without chat scope could
  silently apply to the wrong conversation (CWE-285). Test updated to
  expect fail-closed (was previously fail-open with a comment that
  acknowledged the risk).
- monitor-reply-cache.buildCrossChatError: replace raw inputId in the
  thrown error message with `<short:N-digit>` or `<uuid:prefix…>`
  shape descriptors. Combined with the earlier chatGuid redaction,
  cross-chat errors now leak no concrete identifier (CWE-117 /
  CWE-200). The Low PII finding on monitor-processing verbose logs is
  resolved automatically by the sanitizeForLog redaction extension
  added for PR openclaw#73241 openclaw#1.

PR openclaw#73400 (silent-reply 🧵) — 1 MEDIUM:

- silent-reply-policy.classifySilentReplyConversationType: classify
  a session key as `internal` only when `parseThreadSessionSuffix`
  returns a real `🧵<id>` suffix, not on a free-form `🧵`
  substring match. Caller-supplied session keys can no longer embed
  the marker mid-string to force the conversation type to `internal`
  and bypass silent-reply rewrites (CWE-840).
zqchris pushed a commit to zqchris/openclaw that referenced this pull request May 15, 2026
…penclaw#73241, openclaw#73400

Second hardening pass after the first round triggered new findings on
Aisle's re-scan. PR openclaw#73406 (auto-reply voice silent) was meanwhile
landed by the maintainer in upstream commit 28bf71d — that one will
drop out at the next rebase via patch-id match, no source change here.

PR openclaw#73241 (BB http hardening) — 1 HIGH + 2 MEDIUM:

- monitor-processing.sanitizeForLog: redact common secret-bearing
  patterns (`?password=`, `?token=`, `?api_key=`, `?secret=`,
  `Authorization: Bearer / Basic …`) before the value reaches the log
  sink. BlueBubbles uses query-string auth by default, so attachment
  download failures and similar errors can carry the API password in
  the captured request URL (CWE-532).
- history.fetchBlueBubblesMessageByGuid: validate the derived bareGuid
  (length ≤128, charset `[A-Za-z0-9._:-]+`, non-empty) before issuing
  the request. A trailing `/` would otherwise produce an empty bareGuid
  and turn the call into an unintended `/api/v1/message/` collection
  query (CWE-20).
- monitor-processing reply-context verbose logs: log only `bodyLen=`
  metadata, not the quoted message text itself. Verbose logs are
  retained / shipped to aggregators and would otherwise leak private
  chat content (CWE-532).

PR openclaw#73235 (BB routing guards) — 1 MEDIUM + 2 LOW:

- monitor-reply-cache.resolveBlueBubblesMessageId: when
  `requireKnownShortId=true` and `chatContext` lacks any identifier,
  throw "requires a chat scope" instead of resolving the short id.
  Short ids are allocated from a single global counter across every
  account and chat, so an action call without chat scope could
  silently apply to the wrong conversation (CWE-285). Test updated to
  expect fail-closed (was previously fail-open with a comment that
  acknowledged the risk).
- monitor-reply-cache.buildCrossChatError: replace raw inputId in the
  thrown error message with `<short:N-digit>` or `<uuid:prefix…>`
  shape descriptors. Combined with the earlier chatGuid redaction,
  cross-chat errors now leak no concrete identifier (CWE-117 /
  CWE-200). The Low PII finding on monitor-processing verbose logs is
  resolved automatically by the sanitizeForLog redaction extension
  added for PR openclaw#73241 openclaw#1.

PR openclaw#73400 (silent-reply 🧵) — 1 MEDIUM:

- silent-reply-policy.classifySilentReplyConversationType: classify
  a session key as `internal` only when `parseThreadSessionSuffix`
  returns a real `🧵<id>` suffix, not on a free-form `🧵`
  substring match. Caller-supplied session keys can no longer embed
  the marker mid-string to force the conversation type to `internal`
  and bypass silent-reply rewrites (CWE-840).
@zqchris
zqchris deleted the fix/silent-reply-thread-classify branch May 17, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant