CVE-2026-77331 in memtomem-stm
Summary
by MITRE • 11/20/2026
memtomem-stm is a short-term memory proxy gateway with proactive memory surfacing for AI agents. From 0.1.2 until 0.1.34, concurrent surfacing RPC failures can start more than one reconnect for the same dirty session because concurrent LTM recovery is not uniquely owned by a session generation. Cancellation during a post-reconnect retry can also leave the replacement transport reusable after an interrupted protocol exchange, causing session-state integrity loss or local service degradation. The duplicate-reconnect subcase was introduced in 0.1.24, while the cancellation-recovery subcase affects the broader listed range. This issue is fixed in version 0.1.34.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/20/2026
The vulnerability identified within memtomem-stm versions ranging from 0.1.2 to 0.1.34 represents a critical flaw in session management and concurrency control for short-term memory proxy gateways designed for AI agents. This software component facilitates proactive memory surfacing, allowing artificial intelligence systems to maintain context across interactions by storing and retrieving state information via remote procedure calls. The core issue stems from inadequate synchronization mechanisms when handling long-term memory recovery during network instability or service interruptions. Specifically, the architecture fails to enforce exclusive ownership of session generation identifiers during concurrent low-temperature memory recovery operations. This design oversight allows multiple reconnection attempts to be initiated simultaneously for a single dirty session, leading to race conditions that compromise the integrity of the communication channel and the consistency of stored state data.
The first subcase involves duplicate reconnects triggered by concurrent surfacing RPC failures. When network latency or server unavailability causes remote procedure calls to fail, the system attempts to recover the session state from long-term memory storage. However, because this recovery process is not uniquely bound to a specific session generation identifier within the affected version range, multiple threads or processes can independently decide that a reconnection is necessary for the same logical session. This results in duplicate connection establishment attempts, which consume unnecessary system resources and create conflicting states on both the client and server sides. Such behavior aligns with CWE-362, Concurrent Execution using Shared Resource with Improper Synchronization, as multiple execution paths access shared state without proper locking or atomic operations to prevent interference.
The second subcase addresses a more severe integrity violation related to cancellation during post-reconnect retries. When a reconnection attempt is interrupted by a cancellation signal before the protocol exchange completes successfully, the replacement transport object remains in a reusable state despite being associated with an incomplete transaction. This leaves the session in an inconsistent condition where subsequent operations may utilize a transport that has not fully established its context or acknowledged prior commands. The result is potential loss of session-state integrity, meaning critical memory data or agent instructions could be dropped, duplicated, or processed out of order. This flaw directly impacts local service degradation and can lead to unpredictable behavior in AI agents relying on consistent stateful interactions. This scenario reflects CWE-367, Time-of-check Time-of-use (TOCTOU) Race Condition, as the system checks the transport status but uses it before ensuring its validity is fully established after a cancellation event.
From an operational perspective, these vulnerabilities undermine the reliability of AI agent workflows that depend on persistent memory contexts. In production environments, this can manifest as intermittent failures in task completion, loss of conversational context for chat-based agents, or corruption of short-term memory buffers used for complex reasoning tasks. The duplicate reconnect issue primarily affects system stability and resource efficiency, while the cancellation-recovery flaw poses a direct threat to data consistency and functional correctness. Attackers with local access could potentially exploit these race conditions to cause denial-of-service by exhausting connection pools or to manipulate agent behavior by injecting conflicting state updates during the window of inconsistency created by interrupted protocol exchanges.
The remediation strategy involves upgrading memtomem-stm to version 0.1.34, which resolves both identified issues through improved concurrency controls and stricter lifecycle management for transport objects. Developers should ensure that session recovery processes are serialized or uniquely locked per generation ID to prevent duplicate reconnection attempts. Additionally, the handling of cancellation events must be updated to explicitly invalidate replacement transports if they were not fully initialized before the interruption occurred. Implementing these fixes aligns with best practices outlined in MITRE ATT&CK technique T1496, Resource Hijacking, by preventing unauthorized or unintended resource consumption and state manipulation. Organizations relying on this proxy gateway should verify their deployment versions immediately to mitigate risks associated with session integrity loss and service degradation.