Skip to content

iMessage attachment paths blocked by image tool after 2026.3.2 security hardening #33045

Description

@aikoorhon

Summary

After updating to 2026.3.2, the image tool can no longer read iMessage attachments from their native paths (~/Library/Messages/Attachments/...).

Error

Local media path is not under an allowed directory: /Users/aikoorhon/Library/Messages/Attachments/df/15/0449D7CE-A973-4444-BAD7-514214D5F00A/IMG_3719.png

Root Cause

The image tool validates paths via assertLocalMediaAllowed using roots from getAgentScopedMediaLocalRoots, which only includes:

  • System temp dir
  • ~/.openclaw/media/
  • ~/.openclaw/agents/
  • ~/.openclaw/workspace/
  • ~/.openclaw/sandboxes/
  • Agent workspace (e.g. ~/clawd/)

~/Library/Messages/Attachments is not in any of these.

The iMessage channel has its own separate attachmentRoots config (default: /Users/*/Library/Messages/Attachments) that correctly validates inbound attachments — but those roots are not passed through to the image tool's localRoots parameter. The two security checks are disconnected.

Steps to Reproduce

  1. Configure iMessage channel with includeAttachments: true
  2. Send an image via iMessage
  3. Call the image tool with the path from the inbound message metadata
  4. LocalMediaAccessError: path-not-allowed

Expected Behavior

The iMessage channel's attachmentRoots should be merged into mediaLocalRoots when dispatching to the agent, so the image tool can read inbound attachments from their native Messages paths. This worked before 2026.3.2.

Config

channels.imessage.includeAttachments: true

No explicit attachmentRoots set (using default /Users/*/Library/Messages/Attachments).

Suggested Fix

In the iMessage inbound dispatch path, merge attachmentRoots into the mediaLocalRoots passed to the tool execution context — similar to how other channels handle scoped media roots.

Metadata

Metadata

Assignees

Labels

close:duplicateClosed as duplicatededupe:childDuplicate issue/PR child in dedupe clustersecuritySecurity documentation

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions