Files
deepseek-harness/docs
MicroBlock f851b9cd26 im: refuse outbound resources the host would have to fetch
`im_send` publishes model-written markdown, and the platform upload path fetched
every resource src through `ctx.http`: the `file:` handler there reads this
host's filesystem and any http(s) target, both outside the sandbox the session's
own tools answer to. A chat participant could therefore have had the bot upload
a host file into the chat, or make the host request an internal address, by
getting `![](file:///…)` into a message.

Publications now resolve only the resources their content carries (`data:`,
`base64:`) or the core's own `satori:` references:
`createResourceFetcher` takes an optional accepted-scheme policy, `Bot`'s
prepare passes `PUBLISHABLE_SCHEMES`, and anything else rejects with the new
`RefusedContentError` before any I/O. The default (no policy) keeps resolving
every scheme, which is what `dsh-im`'s inbound media download needs.

`ImSender` reports such a refusal as `failed` with the reason instead of blaming
the platform or claiming an uncertain outcome. A local file still reaches a chat
through `im_send_file`, which reads it under the caller's working directory and
publishes its bytes inline.

Covered by the fetcher policy and `bot.send` cases in
`vendor/plugin-im-core/tests/{resource,bot}.spec.ts` and the status mapping in
`packages/experimental/im/tests/send.spec.ts`; recorded as vendor divergence V74.
2026-11-06 17:02:08 +08:00
..