Repository navigation
Close KisteAgent scan findings: signed scan authority, bounded standby, review ownership - #41
Conversation
…I access by owner
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19f377c836
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…he standby baseline in one search
Why
A security scan of KisteAgent found that a client could grant itself scan authority by writing
originating_indicatorsinto graph state, that standby mode held a worker forever, that the alert which woke standby could be pushed out of the analyzed window (also when a new alert landed in the same rule execution), that non-global addresses such as CGNAT and multicast passed the scan-target check, and that any API client could read and approve another operator's pending review. Two dependencies,langgraph-sdk0.4.2 andmcp1.28.1, had published advisories. This PR closes each of these and adds a regression test per finding.What changed
execute_elastic_querysigns the retrieved indicators with an HMAC key held by the server and bound to the thread (provenance.py).counter_reconscans only targets that match a verified receipt. The unsignedoriginating_indicatorschannel is gone.BG_JOB_TIMEOUT_SECS) and a per-process capacity cap that always keeps an ordinary worker slot free. Timeout, capacity and error exits end the run without analysis or review._indexand_idand fetches it withget, so the analyzed window always contains it._is_deniedrefuses every non-global or multicast address, including IPv4 embedded in IPv6.auth.py, opt-in withKISTE_API_TOKENS): the server stamps thread ownership from the bearer token, and owners can only see and change their own threads. A token marked as reviewer can resume another owner's pendingreview_gate_Sinterrupt, and only that checkpoint. With no tokens configured, local single-user mode is unchanged.langgraph-sdk0.4.8,mcp1.30.0 (held below 2 forFastMCP).Evidence
Each test below was run against the base code (
origin/main) and against this branch.test_vuln_0005_provenance.py: base fails withAssertionError: Forged graph state reached the scanners, branch passes.test_vuln_0006_standby_limits.py: base fails withStandby did not terminate within its configured timeout, branch passes.test_vuln_0007_0008_standby_identity.py: base fails withDistinct Elasticsearch documents collapse to identical rule metadata. The same-execution insertion with a lower alert UUID fails on the branch's first fix commit (389b4a9) withPinned the old top hit instead of the insertion: ['z-old']and passes now.test_vuln_0003_targets.py: base fails withNon-global scan allowed: 100.64.0.1 (allowed), branch passes.test_vuln_0009_auth.py(runs a loopbacklanggraph devserver): base fails withNo server authentication handler is registered, and with 200 instead of 404 when a peer reads the owner's review. Branch passes, including owner resume, reviewer approval and no-token local mode.uv run --locked make test:65 passed. Both CIruffcommands:All checks passed!. Rootpython3 -m unittest discover -s tests:OK. Browser tests were not run locally; CI runs them.Merge risk
Door: two-way.
Blast radius: KisteAgent's chat retrieval, counter-recon and standby paths, and the API when
KISTE_API_TOKENSis set.Safe because: with no tokens set,
auth.pyallows every operation as before, and the compiled-graph tests drive the authorized retrieval, scan, standby and review paths end to end (level 4).Scope
The reviewer check reads the in-memory runtime used by
uv run langgraph dev, the documented runtime; another runtime needs the endpoint tests to pass first. WithoutKISTE_PROVENANCE_KEY, a server restart requires a fresh retrieval before counter-recon can run.