nvidia / moonshotai/kimi-k3 / low / low effort preferred over xai / grok-4.7-efficient / medium / medium effort · close win.
Primary judge: Sol 6.1, requested Low. Effective provider effort and internal attempts were not verified. A close win is still a scored preference; it does not establish a material defect.
Reviewed public evidence
Task goal
Review the supplied native and Python private-capture implementations and owner/direct invocation contracts for confidentiality and evidence integrity. Trace the concrete input/output surfaces, credential-field exclusions, file permissions, immutable naming, failure retention, request binding, and reconnect/reconciliation behavior. Examine plausible credential leakage, path or symlink substitution, oversized/truncated envelopes and stale owner-process capture configuration against the actual code. Report only actionable findings with severity, exact packet file/line evidence, realistic trigger and smallest remediation. Separately list acceptance gaps that are not demonstrated defects. Do not inspect credentials/profiles, invoke tools, change files, run tests, or publish private contents.
nvidia / moonshotai/kimi-k3 / low / low effort answer
## Evidence Packet — Direct review of security.packet.md (sha256:ef3d51…)
### Task-relevant findings (actionable)
**F1 — Medium: Credential-key exclusion is evadable by unlisted key names (both implementations, same defect class).**
- Evidence: `native/private-capture.js` packet lines 3–14 (set `secretKeys` + exact-match `token` condition); `bridge/[REDACTED: private constant].py` packet lines 18–29 (identical logic).
- Concrete issue: keys are normalized (`[^a-z0-9]` stripped / `isalnum`) and matched against a fixed set. Common credential carriers not in the set pass through verbatim into the immutable 0600 capture: e.g. `authToken` → `authtoken`, `bearer`, `jwt`, `secret`, `sessionKey`, `privateKey`, `passphrase`, `sshKey`, `signingKey`, `awsSecretAccessKey`. The special-case only fires when the key is exactly `token` and the value is a string (JS line 8; Python line 28), so `auth_token: "ghp_…"` is stored in cleartext in `input`/`nativeReceipt`/`rawEnvelope` evidence (Python lines 124–140).
- Realistic trigger: any native receipt, transport envelope header map, or engine output that surfaces a token under a non-enumerated key name (both `capture()` call sites in `_direct_rpc`, packet lines 207–222, pass the full payload and raw envelope).
- Smallest remediation: extend the normalized set and add a suffix heuristic (`endsWith('token')`, `endsWith('secret')`, `endsWith('key')` for string values), keeping the two implementations in parity; add a regression case per new key.
**F2 — Medium: `_store` never verifies ownership (st_uid) of the capture directory or the committed file.**
- Evidence: `bridge/[REDACTED: private constant].py` packet lines 40–49 (symlink check on the directory itself, resolve, repo check, mode check — no `st_uid` comparison), lines 55–67 (link + unlink), lines 68–77 (O_NOFOLLOW re-open and readback, no fstat owner check).
- Concrete issue: mode `0o700` checks permissions but not owner. If `OPENCODE2_[REDACTED: private constant]` (line 113) or `OPENCODE2_CAPTURE_FAILURE_DIR` (line 157) resolves — via misconfiguration, a symlinked ancestor (only the leaf is checked for symlink at line 41), or a shared host — to a directory owned/controlled by another principal, that principal controls the namespace: it can pre-place `digest.json`, or unlink/replace the destination after the readback closes (line 77) and before any later consumer re-opens by the returned digest. Content is still 0600 owned by the writer, so this is primarily an integrity/substitution and namespace-confusion issue rather than direct disclosure.
- Smallest remediation: after `directory.stat()` (line 48), require `st_uid == os.getuid()`; after `os.fstat(fd)` (line 70), require the file's `st_uid == os.getuid()`. Fail closed.
**F3 — Low: native `captureTerminalSnapshot` can reject after the durable receipt commit and can abort the whole reconcile page.**
- Evidence: JS packet lines 20–26 — `terminalEvidence`/`privateEvidence` and `JSON.stringify` run *before* the `try` at line 26; `privateEvidence` recurses without a depth bound (lines 6–15). Call sites: bridge line 242 (`transition` awaits capture after `storage.set` committed the receipt/version bump, line 241) and line 408 (`reconcile` awaits `captureTerminalSnapshot` with no `.catch`, unlike the adjacent line 412).
- Realistic trigger: a pathological receipt object (very deep nesting, cyclic via any non-plain value) — thrown error rejects `transition` (submit/inspect/advance then surface an RPC error after the durable state was already committed; the caller sees failure although, e.g., state advanced) or terminates `reconcile()` mid-page, silently skipping `captureTerminalSnapshot`/`advance` for every later receipt in that scan page until the next event.
- Smallest remediation: wrap the capture body (including `terminalEvidence`) in the existing try, and add `.catch(() => {})` at line 408 to match line 412.
**F4 — Low: native readback verification depends on durable storage preserving JSON member order.**
- Evidence: JS packet lines 30, 46–52 — verification is `JSON.stringify(await storage.get(key)) === serialized` against a string built from a fresh object. Any normalization that reorders keys (documented at bridge lines 236–240 that storage normalizes values) yields `missing-or-mismatched` and `reconciliationRequired: true`. This is fail-closed (no confidentiality or integrity loss), but produces false reconciliation alarms and makes `captured-readback-verified` unreliable across storage implementations.
- Smallest remediation: canonicalize (stable stringify) on write and compare digests of canonical form on read.
### Alternatives / discarded hypotheses (likely false positives)
- **Symlink substitution at destination:** adequately handled — `os.link` + `FileExistsError` pass (lines 63–65) plus `O_NOFOLLOW` re-open and exact readback (lines 68–75) fail closed. Not a defect.
- **Oversized envelopes truncated mid-write:** not present — bytes are fully serialized, size-checked before write (Python lines 50–52, 135–140; JS line 27), and failures produce identity-only failure records. Digest-only-over-limit coverage retains the hash (line 139).
- **Free-text credentials in questions/taskContext:** intentionally captured (`[REDACTED: private constant]` docstring, Python line 24; `privateTaskContext: input`, bridge line 302). Design choice, not enumerated-key bypass — treated as acceptance gap, not defect.
- **Credential values in Python failure path:** correctly limited to `errorClass` only (line 154); no leakage there. `projectDirectory` in records is by design.
- **Reconnect/observation gap:** subscription is started before cold reconcile (bridge lines 416–435, comment lines 421–423), and explicit `advance` is a safe idempotent recovery (lines 354–361). No defect.
- **Request-ID rebinding:** `existing.inputHash !== hash` throws (bridge lines 292–295); follow-ups require completed prior runs (line 299). Sound within shown code.
### Missing evidence / dependencies (uncertainties)
- `validID`, `ownedRoot`, `validateInput`, and `KEY` are referenced (bridge lines 248, 276, 297, 300) but not in the packet — ID validation strength and root-ownership derivation cannot be verified.
- The native `storage.get/set/scan` authority semantics (atomicity, key-order preservation, access control on `direct-private/v1/*` keys) are unknown; F4 severity depends on them.
- `ctx.rpc.register`/`directRpcDefinition` authorization scope is not shown — who may invoke submit/inspect is unverifiable.
- Whether `options.privateCapture` env/config can be toggled at runtime between capture and readback (stale owner-process configuration) cannot be determined from the packet.
### Acceptance gaps (not demonstrated defects)
- Automatic capture in the already-running original Codex MCP owner process is explicitly unverified (packet lines 235, 484); original team_moa/direct Codex flows do not use the Python helper.
- No demonstrated test that the extended key-exclusion set (F1) is exercised end-to-end.
- Directory-ownership attack (F2) and reconcile-abort path (F3) are unexercised; no negative tests shown.
- Digest-only oversized raw-envelope path (Python line 139) is implemented but untested per packet.
- No retention/deletion/rotation policy for `direct-private/v1/terminal/*`, failure records, or `*.json` digest files is shown.
- Stale environment in long-lived owner processes after `OPENCODE2_[REDACTED: private constant]` changes is acknowledged but not covered.
### Next useful action
Patch the shared credential-key normalization (both files, keep parity), add `st_uid` checks in `_store`, and add negative tests: unlisted-token-key receipt, foreign-owned capture directory, and oversized envelope.
No conflicting observations within the packet; review was direct (single-lane evidence analysis), no tools invoked, no files changed.xai / grok-4.7-efficient / medium / medium effort answer
The capture boundary fails closed on replay, but credential exclusion is bypassable on the normal write path and Python failure handling drops already-computed integrity anchors. Four defects are actionable; stale owner configuration is not a demonstrated leak.
## Actionable findings
**1. High — structured credential exclusion fails open.** Both denylists omit common names (`secret`, `privatekey`, `jwt`, `bearer`, `sessiontoken`, `idtoken`). A normalized key matches only the fixed set; `token` is not in that set and is withheld only when `key.lower() == 'token'` and the value is a string. Object or array `token` values are recursed, so nested `jwt`, `value`, or `secret` fields are stored. Prefixed keys such as `x-api-key` normalize to `xapikey` and miss `apikey`. String and non-dict envelopes are stored unchanged.
Evidence: `native/private-capture.js` lines 3–9; `bridge/[REDACTED: private constant].py` lines 18–32 and 132–140. `terminalEvidence` and `capture` then persist the walked object (`private-capture.js` lines 12–16 and 22–29; `[REDACTED: private constant].py` lines 116–130 and 144).
Trigger: a terminal receipt, direct payload, or raw RPC envelope contains `token: {jwt: "..."}`, `secret`, `[REDACTED: private constant]`, or `x-api-key`. The success path writes those values into the private snapshot. Durable storage is worse: redaction never runs on the primary receipt.
Smallest remediation: one shared normalized denylist; withhold the whole value on match regardless of type; also match normalized suffixes `token`, `secret`, `password`, `apikey`, and `credential`. Apply that helper before any durable or snapshot write.
**2. High — enabling private capture stores and returns unredacted input.** On `options.privateCapture === true`, the full client `input` is copied to `privateTaskContext` and committed with `storage.set` before the snapshot helper runs. `privateEvidence` is applied only inside `terminalEvidence` to a separate object. `inspect`, `submit`, `advance`, and `cancel` return that durable receipt. The bridge then spreads the original `output`, not the redacted copy.
Evidence: native direct RPC lines 302, 240–242, 273–275, and 340–346; bridge helper line 223.
Trigger: private capture is on and `input` or engine `admission` or `result` contains a credential field, including one the denylist would have caught. It remains in scoped request storage and in the authenticated RPC response. Turning the flag on increases retention relative to the question-only receipt.
Smallest remediation: redact `input` before assigning `privateTaskContext`, and do not return that field on RPC. Keep the unredacted task context only in the private snapshot store after finding 1 is fixed.
**3. Medium — Python capture path checks do not pin the directory they write.** `is_symlink()` covers only the leaf. `resolve()` follows parent symlinks. The repo check and `stat()` mode check are not tied to a directory fd. `stat()` follows symlinks. `O_NOFOLLOW` is used only after `NamedTemporaryFile` and `os.link`. Relative `OPENCODE2_[REDACTED: private constant]` or `OPENCODE2_CAPTURE_FAILURE_DIR` is resolved against the process cwd. The temp file is created with the process umask and chmodded to `0o600` only afterward.
Evidence: `bridge/[REDACTED: private constant].py` lines 39–49 and 53–68; failure directory selection at lines 157–159.
Trigger: a parent component of the capture or failure directory is a symlink, or the leaf is replaced after the symlink check, pointing at a traversable directory or a repo. Writes follow that path. A local observer can open the temp name before `fchmod` if the substituted directory is traversable and umask leaves group or other read. A same-user redirect into a repo defeats the `.git` check via that race and can later be committed.
Smallest remediation: reject non-absolute paths; walk with `O_NOFOLLOW`; `open` the final directory `O_DIRECTORY|O_NOFOLLOW`; require mode `0o700`, matching uid, and a regular non-repo directory; create the temp file `O_EXCL|O_NOFOLLOW` with mode `0o600` on that dirfd before writing.
**4. Medium — Python failure retention and response binding drop or mis-file evidence.** The `except` block builds an identity-only failure record and discards `record`, including `rawEnvelopeEvidence.sha256` already computed in the `try`. The failure file digest is not returned. Separately, `runID` and `requestID` prefer the response over the submitted payload when both exist. Python filenames are content digests only, so a mis-bound snapshot is not request-scoped on disk. Native failure keys do retain `snapshotDigest` (`private-capture.js` lines 34–37); Python does not.
Evidence: `bridge/[REDACTED: private constant].py` lines 118–119, 132–144, and 150–164; bridge call at helper line 222.
Trigger: `_store` raises after an oversized or secret-bearing envelope was hashed (combined record over 8,000,000 bytes, readback mismatch, or unsafe directory). Reconciliation is left with no digest. Or the RPC `output` carries a different `requestID` or `runID` than the payload; the lifecycle snapshot is labeled with the response identity and can be reconciled to the wrong battle.
Smallest remediation: on failure, persist `requestID` from the caller, `errorClass`, raw-envelope sha256, and serialized length, and return those digests. If both sides have an ID, require equality and otherwise fail closed. Bind the record to the caller ID.
## Acceptance gaps (not demonstrated defects)
- The stale Codex MCP process with old env or schema is an unverified capture gap. Both gates fail silent: the native code returns when `enabled` is not strictly `true`, and Python returns `disabled` when `OPENCODE2_[REDACTED: private constant]` is unset (`private-capture.js` line 21; `[REDACTED: private constant].py` lines 113–115; packet lines 235 and 484). That is missing evidence, not a shown credential leak.
- Free text is intentionally retained, including `question`, `error` (native RPC line 334, sliced to 2000 characters), and `text`. Credential-shaped strings in those fields are a residual policy risk.
- Native snapshots cover only `completed` and `terminal-incomplete`. `admitting` and `admission-uncertain` are not snapshotted, and reconcile or advance will not move them (native RPC lines 354–355 and 408–410). Recovery depends on `inspectUnsafe` plus engine helpers not in this packet.
- The admission-diagnostic RPC is not captured (bridge helper lines 226–236). `publicationAllowed: false` is stored but not enforced here.
- The native storage permissions, `validID`, `KEY`, `inputHash`, and `OpenCodeClient.request` shape are outside the packet. The integration claim of directory `0700` and file `0600` is not visible in the JS capture path.
- `evidence_index` stops after 4096 path characters or 64 segments (`[REDACTED: private constant].py` lines 89–90). Full `input` and `nativeReceipt` copies remain. Digests are not comparable across native `JSON.stringify` and Python canonical JSON.
- Non-dict `output` is silently replaced with `{}` (`[REDACTED: private constant].py` line 117). The shown bridge success path avoids that with `isinstance(..., dict)`.
## Alternatives and discarded hypotheses
- I did not treat a pre-created leaf symlink in `/tmp` as a bypass. `is_symlink()` rejects that leaf. The gap is parent symlinks and the check-to-write race.
- I did not treat `events.emit("changed", ...)` as a credential leak. The payload is only sequence, request ID, and state (native RPC line 244).
- I did not treat JSON key-order readback mismatch as a defect. The packet states native readback was verified, and storage round-trip semantics are not in the packet.
- I did not treat returning the RPC `output` to the direct caller as itself a leak. The caller needs the result. The defect is the unredacted durable copy and the weak snapshot denylist.
- `coverage: digest-only-over-limit` omits a sanitized label, but `structuredCredentialsWithheld` remains set (`[REDACTED: private constant].py` lines 139–141). That is not an independent defect.
## Missing evidence
`validID`, storage key prefix `KEY`, hash inputs, `validateInput`, engine launch, status, and collect shapes, and the storage implementation are not in the packet. I cannot confirm request-ID key traversal, whether reconcile’s scan is cross-workspace, or that live replies actually contain the weak field names. Consequence: findings 1 and 2 are proven write-path defects; exploitability in production traffic depends on those unseen object shapes. The symlink finding does not depend on them.
## Next useful action
Patch findings 1–4 in the snapshot helpers and the durable `privateTaskContext` assignment, then add tests for object-valued `token`, suffix keys, response ID mismatch, failure-record digest retention, and a parent-symlink capture directory. Do not inspect live credentials or treat a stale owner process as a leak.Primary judge's stated reason
Forced, weak preference for A: it avoids B's specific unsupported temporary-file disclosure claim and the associated remediation premise. B supplies useful additional retention and binding analysis and better rejects the speculative ordering finding. This is not an established material quality difference; an independent review could reasonably prefer B's broader tracing.
This reason is the judge's assessment. No independent factual-defect finding is asserted by this record.
Battle wave: 363476d6-e8c0-4ffc-9edf-97ef2eef4154. Pair: brp1_175927ca72c340cf5db717ba4e9ac1ce387036132263cf2548f2b52a13bef95c. A separate independent review is required before calling a concern a verified factual defect. Judge disagreement is not recorded here.