media: URL-only inbound attachments bypass the Gateway type check #1672

Closed
opened 2026-10-27 13:41:20 +00:00 by sam · 1 comment
Owner

The Gateway now sniffs attachment bytes against the declared type, but an attachment carrying only a URL is passed through with its declared type unchecked. Decide where the bytes are fetched and checked. Done when a URL-only attachment whose content contradicts its declared type is refused or retyped.


Imported from beads archie-core-ycrnb · type bug · priority P2 · created 2026-10-27

The Gateway now sniffs attachment bytes against the declared type, but an attachment carrying only a URL is passed through with its declared type unchecked. Decide where the bytes are fetched and checked. Done when a URL-only attachment whose content contradicts its declared type is refused or retyped. --- _Imported from beads `archie-core-ycrnb` · type bug · priority P2 · created 2026-10-27_
sam added the mediumbug labels 2026-10-27 13:41:20 +00:00
sam self-assigned this 2026-10-27 13:41:20 +00:00
Author
Owner

Fixed in cc842864: checkInbound fetches the first 512 bytes of a URL-only image, audio or voice attachment through the public-address-only client (no redirects, 10s) and runs the existing sniff on them. A mismatch or an unreadable URL is refused with InvalidArgument; the stored attachment is unchanged. Covered by URL rows in TestCheckInboundRefusesContradictoryMedia.

Fixed in cc842864: checkInbound fetches the first 512 bytes of a URL-only image, audio or voice attachment through the public-address-only client (no redirects, 10s) and runs the existing sniff on them. A mismatch or an unreadable URL is refused with InvalidArgument; the stored attachment is unchanged. Covered by URL rows in TestCheckInboundRefusesContradictoryMedia.
sam closed this issue 2026-11-07 19:03:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1672