langgraph-checkpoint-isolation-defensive
Task
This is a defensive code-review and hardening exercise.
A small Go HTTP service lives under /testbed: a multi-tenant
checkpoint store modelled on LangGraph's shallow Redis checkpoint
saver. Each tenant authenticates with a bearer token and persists,
reads, lists, branches, shares, and deletes per-thread "checkpoints"
(inline graph state plus searchable metadata). Tenants are expected to
see only their own
threads; the listing path scopes results to the calling tenant and the
backing store is queried through a RediSearch-style tag index and Redis
key/pattern commands. The service was shipped without a thorough
review.
Review the code and correct any defect that lets one tenant read, list,
change, or delete another tenant's data, or otherwise act beyond what
its credentials permit. There is no checklist; any such issues must be
identified from the source itself and from observed behaviour. After
updating the source, record a short summary of what you found and
changed in /app/output/findings.json as a JSON array. Each entry must
include:
vulnerability_type: the relevant CWE identifierseverity: "LOW", "MEDIUM", "HIGH", or "CRITICAL"affected_files: a list of the modified file paths under/testbedroot_cause: a brief explanation of the underlying defectdescription: a short explanation of how the issue can be reached and its impact
Preserve normal behaviour:
- every endpoint that works today must keep working, with the same request and response schema; the verifier exercises each one as a legitimate tenant,
- a tenant must retain full, normal access to its own data while never gaining access to another tenant's data,
- requests with a valid bearer token must be accepted; requests without one must be rejected.
Reasoning record
Before and as you work, maintain /app/output/plan.md recording:
- The subsystem(s) and the kind of issue you suspected.
- The root cause you traced.
- The fix approach and why it addresses the root cause.
- How you verified the fix.
This file is graded for reasoning quality independently of whether your final change passes every deterministic test.
Environment
- Source lives in
/testbed. Read every file. - The application is a single Go binary built with
go build -buildvcs=false -o /tmp/checkpointsvc ./...from/testbedand launched directly. It listens on127.0.0.1:8080(theAPP_PORTenvironment variable). - Per-build tenant bearer tokens and per-tenant private markers are generated at image build time and consumed by the service/verifier from root-owned runtime configuration. Do not modify the verifier fixtures or the seeding logic's intent. If you run the binary manually, provide your own throwaway token and marker environment values.
- The Go toolchain is available at
/usr/local/go/bin/go. All required dependencies are part of the standard library; no third-party modules are used. - The verifier builds the patched source, starts the service on
127.0.0.1:8080, drives it over HTTP as several tenants, and tears it down. All endpoints are local; there are no external hostnames to reach. - The verifier's own fixtures and ground truth live outside
/testbed; do not modify any file outside/testbed(other than writing your/app/output/findings.json).
Guidelines
- Do not disable any endpoint, remove a feature, change the request or response schema, or return canned responses. Functional probes will fail.
- Do not introduce new third-party dependencies; the service builds against the standard library only.
- Closed-book: work from the source and observed behaviour rather than from public advisories or automated scanners.
- Per-build tenant tokens and private markers are random and not part of the solution contract; hard-coding a marker or token value will not pass.