Executive brief
Nanobot, an AI agent framework, contains a flaw in how it handles media files sent through the Matrix messaging platform. An authorized user in a chat room can send specially crafted media files that lack size information, forcing the bot to download and store the entire file in memory before checking if it is too large. This can be used to crash the bot or slow down its operations by exhausting its memory and internet bandwidth.
Technical details
A denial of service vulnerability exists in Nanobot's Matrix channel media download handler due to improper resource allocation (CWE-770). The handler previously only validated file sizes if the 'info.size' metadata was present in the Matrix media event; if missing or invalid, the bot would proceed to fully materialize the response body in memory before performing a post-download size check. An authenticated attacker (a member of a Matrix room the bot processes) can send multiple concurrent media events with omitted size metadata to trigger simultaneous large downloads. This leads to process memory exhaustion and bandwidth saturation. The vulnerability is fixed in version 0.2.1 by implementing early rejection of missing size metadata, streaming downloads with a hard byte cap, and limiting concurrent downloads via a semaphore.
Affected products
- HKUDS Nanobot < 0.2.1
Timeline
- 2026-05-30: patched: Pull request merged to harden Matrix media handling
- 2026-06-01: advisory: NVD and VulnCheck published advisory details