<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Vedant Agarwal</title>
    <description>The latest articles on DEV Community by Vedant Agarwal (@vedantagarwal).</description>
    <link>https://dev.to/vedantagarwal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4254757%2Fd18752ce-a624-4a08-8c96-b2f67ff97ae3.jpg</url>
      <title>DEV Community: Vedant Agarwal</title>
      <link>https://dev.to/vedantagarwal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vedantagarwal"/>
    <language>en</language>
    <item>
      <title>Can user B read user A's memory in your LangGraph app? A two-user check</title>
      <dc:creator>Vedant Agarwal</dc:creator>
      <pubDate>Fri, 20 Nov 2026 03:09:07 +0000</pubDate>
      <link>https://dev.to/vedantagarwal/can-user-b-read-user-as-memory-in-your-langgraph-app-a-two-user-check-3ghn</link>
      <guid>https://dev.to/vedantagarwal/can-user-b-read-user-as-memory-in-your-langgraph-app-a-two-user-check-3ghn</guid>
      <description>&lt;p&gt;If you run a LangGraph app for more than one user, each user's saved conversations and long-term memory need to stay private. I wanted a way to check that from the outside, as two real users, instead of trusting that my handlers were right. This post describes the check, what it found on a sample app, and what it found on an affected and a fixed version of LangGraph's SQLite store.&lt;/p&gt;

&lt;h2&gt;
  
  
  How isolation works in LangGraph
&lt;/h2&gt;

&lt;p&gt;A LangGraph server keeps two kinds of memory per user:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Threads&lt;/strong&gt;: saved conversation state and history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Store&lt;/strong&gt;: long-term memory, organised into namespaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The server authenticates callers with the auth handler your app provides. Access to threads and Store items is then limited by the &lt;code&gt;@auth.on&lt;/code&gt; handlers your app adds. The official guides show the pattern for &lt;a href="https://docs.langchain.com/langsmith/resource-auth" rel="noopener noreferrer"&gt;threads&lt;/a&gt; and for &lt;a href="https://docs.langchain.com/langsmith/store-auth" rel="noopener noreferrer"&gt;the Store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I think that is a reasonable design, because only the app knows who owns what. It does mean that isolation depends on code each team writes, and a missing handler does not raise an error. Requests simply succeed.&lt;/p&gt;

&lt;p&gt;I call this failure an &lt;strong&gt;agent memory spill&lt;/strong&gt;: one user of an agent app can read memory the app stored for another user, through the server's ordinary read paths, because a per-user access check is missing or wrong.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens without the handlers
&lt;/h2&gt;

&lt;p&gt;I built a small sample app with no model in it: one graph that saves and recalls a value, two fixed test users, and an auth handler that checks their tokens. I ran it on a local LangGraph dev server (LangGraph 1.2.23) in two forms.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sample app&lt;/th&gt;
&lt;th&gt;What user B could do with user A's data&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authenticates users, no &lt;code&gt;@auth.on&lt;/code&gt; handlers&lt;/td&gt;
&lt;td&gt;Read A's thread, its state and history, find it in thread search, read and search A's Store items, and get A's saved value back by asking the agent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Adds an owner filter for threads and an own-namespace check for the Store&lt;/td&gt;
&lt;td&gt;None of those&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Nothing about the first app looks broken when you use it as one user.&lt;/p&gt;

&lt;h2&gt;
  
  
  The check
&lt;/h2&gt;

&lt;p&gt;The check is part of &lt;a href="https://github.com/strangertest-labs/stranger-test" rel="noopener noreferrer"&gt;stranger-test&lt;/a&gt;, an open-source tool I maintain. It is free, Apache-2.0, and uses only the Python standard library. It needs a server you run and two test users' tokens.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User A saves a unique marker in a thread and in the Store.&lt;/li&gt;
&lt;li&gt;User A reads the marker back on every path. If A cannot read her own marker on a path, that path is reported as not exercised and can never count as a pass.&lt;/li&gt;
&lt;li&gt;User B tries each path: A's thread by id, thread search, the Store item by namespace and key, and Store search. If you give it your agent's inputs, it also has B ask the agent.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Each path is graded, and the run as a whole is &lt;code&gt;LEAK&lt;/code&gt;, &lt;code&gt;OK&lt;/code&gt; or &lt;code&gt;INCONCLUSIVE&lt;/code&gt;. A server with no authentication at all is reported as an observation, because the two callers are then the same user.&lt;/p&gt;

&lt;p&gt;Try it with no setup, against a bundled practice server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip install stranger-test
stranger-test confirm agent-memory --demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then against your own server on localhost, with two test tokens:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;stranger-test confirm agent-memory http://127.0.0.1:2024 --token-a &lt;span class="s2"&gt;"$ALICE"&lt;/span&gt; --token-b &lt;span class="s2"&gt;"$BOB"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://github.com/strangertest-labs/stranger-test/blob/main/docs/AGENT-MEMORY.md" rel="noopener noreferrer"&gt;guide&lt;/a&gt; has a copy-paste auth snippet with two test users, for a dev app that has no auth yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  The store underneath can also get it wrong
&lt;/h2&gt;

&lt;p&gt;Correct handlers are not the whole story. LangGraph's Postgres and SQLite stores have had namespace-matching bugs, all fixed, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/langchain-ai/langgraph/security/advisories/GHSA-47pj-3jcm-6whg" rel="noopener noreferrer"&gt;CVE-2026-71433&lt;/a&gt;: a namespace prefix search crossed segment boundaries. Fixed in &lt;code&gt;langgraph-checkpoint-postgres&lt;/code&gt; and &lt;code&gt;langgraph-checkpoint-sqlite&lt;/code&gt; 3.1.1.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/langchain-ai/langgraph/security/advisories/GHSA-6hmw-9432-67qq" rel="noopener noreferrer"&gt;CVE-2026-115883&lt;/a&gt;: namespace labels containing &lt;code&gt;.&lt;/code&gt; reached other namespaces. Fixed in &lt;code&gt;langgraph-checkpoint-sqlite&lt;/code&gt; 3.1.2 and &lt;code&gt;langgraph-checkpoint-postgres&lt;/code&gt; 3.1.3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other researchers reported both, and both are public. I did not find them. I wanted to know whether a two-user check would catch that kind of bug, so I ran it against the real &lt;code&gt;SqliteStore&lt;/code&gt;, behind a small app that correctly limits each user to their own namespace. The two test users' ids were &lt;code&gt;ali&lt;/code&gt; and &lt;code&gt;alice&lt;/code&gt;, so one id is a string prefix of the other. &lt;code&gt;alice&lt;/code&gt; saved an item, and &lt;code&gt;ali&lt;/code&gt; searched his own namespace.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;code&gt;langgraph-checkpoint-sqlite&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;3.1.0 (affected)&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;LEAK&lt;/code&gt;: &lt;code&gt;ali&lt;/code&gt;'s search of his own namespace returned &lt;code&gt;alice&lt;/code&gt;'s item&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3.1.1 (fixed)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;OK&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every other exercised path was clean on both versions, because the app's own checks blocked them. The scripts are in the repository under &lt;code&gt;integration/langgraph/&lt;/code&gt; if you want to reproduce it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Upgrade the store packages to the fixed versions above.&lt;/li&gt;
&lt;li&gt;Add &lt;code&gt;@auth.on&lt;/code&gt; handlers for threads and for the Store, then check that they hold with two real tokens.&lt;/li&gt;
&lt;li&gt;Do not treat a thread id or a namespace as proof of who is asking.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The check covers what it can reach over the server's HTTP API. A clean result is not a proof of isolation.&lt;/li&gt;
&lt;li&gt;The store-boundary path needs two test accounts whose ids are prefix siblings.&lt;/li&gt;
&lt;li&gt;It does not test leaks through semantic search.&lt;/li&gt;
&lt;li&gt;I ran it against LangGraph’s local dev server, including with the server’s Store set to the real SQLite store, not against a production deployment.&lt;/li&gt;
&lt;li&gt;Run it only against servers you run or are authorized to test.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you run a multi-user LangGraph server and try it, I would like to hear which read paths I am missing. Issues are open on the &lt;a href="https://github.com/strangertest-labs/stranger-test" rel="noopener noreferrer"&gt;repository&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>ai</category>
      <category>python</category>
      <category>langgraph</category>
    </item>
  </channel>
</rss>
