Skip to content

/chat/downloadimage fails for images from Channels with "invalid media hmac" (500 Internal Server Error) #241

@AntonKun

Description

@AntonKun

When trying to download images from public Channels via the /chat/downloadimage endpoint, WuzAPI returns a 500 error with invalid media hmac.

The same image download works correctly for normal chats, and the issue appears to affect only images coming from Channels.

Logs:

2025-12-09 15:12:48.090 +01:00 [DBG] Manual attachment download
2025-12-09 15:12:48.117 +01:00 [WRN] Wuz API return unsucces status code: "InternalServerError". Response:
{"code":500,"error":"failed to download image failed to download media from last host: invalid media hmac","success":false}
2025-12-09 15:12:48.120 +01:00 [WRN] Wuz API /chat/downloadimage return unsucces status

It looks like:

  • Images from public Channels are not encrypted
  • The /chat/downloadimage handler seems to expect encrypted media
  • As a result, it attempts HMAC validation and fails

The download logic likely assumes encryption for all media, but Channel images appear to be delivered unencrypted, causing HMAC validation to fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions