Repository navigation
fix(synology-chat): deliver attachments without forwarding source URLs [AI] - #119941
Conversation
|
Codex review: found issues before merge. Reviewed August 14, 2026, 2:28 PM ET / 18:28 UTC. ClawSweeper reviewWhat this changesThis PR replaces Synology Chat source-URL attachment forwarding with guarded byte staging and a short-lived callback URL, while also adding config-command redaction hardening. Merge readiness⛔ Blocked by patch quality or review findings - 9 items remain Keep open. The attachment architecture is well evidenced, but the prior P1 remains: persisted assistant transcript entries are seeded into a later model prompt without redaction. Priority: P1 Review scores
Verification
How this fits togetherSynology Chat sends outbound media through its plugin to a NAS webhook. The proposed path loads and stores frozen bytes inside OpenClaw, then gives the NAS a scoped callback URL instead of the original media location. flowchart LR
A[Outbound attachment] --> B[Synology Chat plugin]
B --> C[Guarded media loader]
C --> D[Frozen media store]
D --> E[Short-lived callback URL]
E --> F[Synology NAS]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The hosted-media controls are substantial, but the branch leaves a reachable sensitive-data disclosure path through assistant transcript hydration. PR surfaceSource +2078, Tests +2884, Docs +23, Config +10, Generated 0, Other +10. Total +5005 across 57 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the hosted-media design, but redact persisted assistant transcript text at the seed boundary with a sanitizer that handles both config commands and sensitive URLs, then prove a Gateway restart cannot pass plaintext into a model prompt. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: Gateway reseeds assistant transcript rows, and the current mapper preserves assistant text before prompt construction. Is this the best way to solve the issue? No. The media owner boundary is sound, but the proposed security repair is incomplete until assistant transcript hydration is redacted and covered by a restart-path regression. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 17eb646bb3e1. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (37 earlier review cycles; latest 8 shown)
|
ClawSweeper reviewReviewed August 12, 2026, 6:39 PM UTC. What this changesThe PR replaces Synology Chat’s source-URL attachment handoff with guarded byte loading, bounded SQLite staging, and a short-lived opaque callback that serves frozen attachments to the NAS. PR surface: Source +1180, Tests +1727, Docs +20, Config +20. Total +2947 across 47 files. Merge readinessResult: ready for maintainer review. Overall: 🐚 platinum hermit Reviewed head: Review scores
VerificationStatus: sufficient How this fits togetherSynology Chat’s outbound adapter converts OpenClaw attachment requests into NAS webhook calls. The new path loads and validates source bytes inside OpenClaw, stores them temporarily, and lets the NAS retrieve only the frozen result through an authenticated callback. flowchart LR
A[Attachment request] --> B[Guarded source load]
B --> C[Active content check]
C -->|Safe| D[Frozen plugin storage]
H[Per-account callback config] --> E[Opaque callback URL]
D --> E
E --> F[Synology webhook]
F --> G[Authenticated byte response]
Before merge
Review detailsBest possible solution: Keep immutable storage and reader leases in the generic Plugin SDK while Synology owns callback routing, tokens, active-content policy, quotas, and delivery outcomes; no safe net-neutral alternative preserves attachments without re-exposing source URLs. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source shows the original URL handoff, while focused production-adapter tests exercise guarded staging, capability delivery, rejection paths, and the protected sink with high confidence. Is this the best way to solve the issue? Yes. Owning immutable storage in the shared outbound-media layer and keeping Synology-specific routing and policy inside the plugin is the narrowest coherent boundary; forwarding the URL or adding a generic public media endpoint would be weaker. AGENTS.md: found_applied Codex review notes: model internal, reasoning high; reviewed against 2ce4200. Label detailsLabel justifications:
Evidence reviewedPR surface:
|
Maintainer decision: attachment upgrade contractApprove the fail-closed attachment upgrade implemented by this PR.
This is the chosen product contract for this branch. The compatibility change is intentional and accepted; the remaining deployment-evidence gap must stay disclosed and must not be represented as completed appliance validation. |
Current-head mock-Gateway behavior proofHead: Environment and production entry points exercised:
Denied/fixed scenario:
Positive control and retrieval sequence:
Exact command: Observed result: {
"head": "6a0b9404f7e222d46ab7b54b7cea6b7c98399caf",
"environment": "local production adapters with loopback Synology webhook and mock Gateway route",
"testFiles": { "passed": 3, "total": 3 },
"tests": { "passed": 32, "total": 32 },
"webhookPost": "accepted hosted capability only",
"protectedSourceUrlForwarded": false,
"onDemandDestinationCalls": 0,
"hostedHead": "authenticated and bodyless",
"hostedGet": "authenticated frozen bytes; repeatable",
"benignControl": "authenticated text and hosted-media webhook delivery succeeded"
}Environment gap: no physical Synology appliance or private deployment credential was available. This evidence proves the exact OpenClaw webhook payload, production client behavior, same-route Gateway dispatch, immutable retrieval, and protected-boundary result; it does not claim vendor UI rendering, appliance-specific Range behavior, or physical-device retry timing. |
|
Exact-head closeout for
The remaining disclosed evidence gap is physical Synology NAS/browser validation; no code-level bypass was found. The PR body now carries the exact-head evidence and production-vs-test LOC metric. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
What Problem This Solves
Synology Chat attachment delivery previously handed the original media URL to the NAS after OpenClaw had inspected it. The NAS then fetched that URL independently, outside OpenClaw's guarded media-loading path.
This change preserves ordinary text links and attachment delivery while making OpenClaw own the only source fetch.
Architecture
OpenClaw now loads and freezes attachment bytes first, rejects active content before persistence, stores accepted bytes in bounded plugin-scoped SQLite state, and gives Synology a short-lived opaque HTTPS capability on the configured callback route. The NAS receives only the frozen bytes and never receives the original remote or local media reference.
The shared outbound-media layer owns guarded loading, validation-before-persistence, immutable bounded storage, expiry, aggregate capacity, corruption-closed reconstruction, and safe attachment headers. The Synology plugin owns exact public/internal callback mapping, capability parsing, account and route isolation, MIME and filename policy, delivery-result classification, lifecycle cleanup, deadlines, and transport limits.
The capability endpoint:
HEADandGETduring a ten-minute lifetime;Configuration and Upgrade Decision
webhookUrlis the exact externally reachable HTTPS callback configured in Synology Chat.webhookPathremains the internal Gateway route. OpenClaw does not infer the public origin from request headers and exposes no general Gateway media endpoint.The upgrade behavior is deliberate: existing attachment users add per-account
webhookUrl. Without it, inbound and text messages continue to work, attachment readiness is reported as false, doctor explains the setup step, and attachment attempts return an actionable error. There is no fallback that forwards the original URL.A repository maintainer explicitly accepted this attachment-only callback contract in the maintainer decision: inbound and text messaging continue without
webhookUrl; attachments fail closed and visibly until each account has its exact external HTTPS callback. Doctor, setup, status, CLI, and documentation own the operator action. Physical Synology deployment proof remains a disclosed evidence gap, not a merge blocker for this accepted direction.System Agent Security Repair
The review also found a model-boundary config-command parsing/redaction bypass. The repair now:
config set,set-ref,get, andschema;propertyNames, and fails closed for unknown owners and secret-bearing fixed segments;channels.defaults,channels.modelByChannel), passthrough records, quoted/escaped dynamic keys, andconfig schema ..Exact-Head Evidence
At exact head
c0c5ee67a6936dfbe29a260964661edb3c264c5c:run_0149d5a8bf96; subsequent commits are config-command hardening plus a formatter-only type-alias layout, covered by exact-final-head GitHub CI;HEAD/GET, account/route/token/method/expiry isolation, fresh-runtime capacity, stalled metadata timeout/no late writes, read/delete races, config set/ref/get/schema model non-disclosure, constrained records, arrays, unknown owners, core channel namespaces, and legacy history hydration;SECURITY.md, and the final autoreview/trufflehog pass was clean; and+2263/-199production,+3184/-266tests/test-support,+27/-4docs, and net-zero generated code. The positive production delta implements the accepted hosted-media capability and its security/lifecycle owners; it is not a downstream guard-only bug patch.Physical Synology appliance validation was not available. Request ordering, retry/interruption behavior, and representative appliance delivery remain deployment evidence to collect when supported hardware is available; they are not claimed by the focused tests.
Product Result