Conversation
Share per-key in-flight validation results across synchronous preflights. Key the bounded memo by full trust identity and executable/bundle metadata, expire stable results, and leave transient failures retryable. Preserve live ACL inspection and existing no-UI secret reads. Cover serial/concurrent fan-out, update invalidation, expiry, transient failures, and capacity eviction through synthetic preflight fixtures. Fixes #3837 Closes #3838 Co-authored-by: luk <jinyuren886@gmail.com>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 22, 2026, 1:54 AM ET / 05:54 UTC. ClawSweeper reviewWhat this changesThe PR caches and coalesces application-signature checks used before Keychain reads, with bounded lifetimes, update-sensitive keys, tests, and documentation. Merge readiness⛔ Blocked before merge - 4 items remain This remains useful: main and the latest release still repeat signature validation. No discrete implementation defect was found, but the security-sensitive cache needs final-read boundary proof before merge. Priority: P2 Review scores
Verification
How this fits togetherCodexBar checks Keychain access before importing browser cookies or loading cached credentials. The changed cache reuses signature-validation results; live ACL inspection and downstream macOS authorization still control subsequent reads. flowchart TD
A[Cookie import or credential cache read] --> B[Read current Keychain ACL]
B --> C[Signature validation cache]
C --> D{Reusable result?}
D -->|No| E[macOS signature validation]
E --> F[Preflight decision]
D -->|Yes| F
F --> G[Skip or attempt protected Keychain read]
Before merge
Findings
Agent review detailsSecurityNeeds attention: No credential-disclosure bypass was established, but retained preflight success requires evidence that final authorization and prompt suppression remain effective. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the bounded shared cache with demonstrated authorization and prompt suppression at the final credential-read boundary. Do we have a high-confidence way to reproduce the issue? Yes, from source: repeated browser preflights on current main invoke the native signature validator again; the linked report supplies a concrete macOS profiling path. This review did not execute that path. Is this the best way to solve the issue? Yes, the shared validation chokepoint is a focused solution and preserves live ACL inspection; confidence in its security-sensitive final-read behavior still requires targeted proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b99a91694d78. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Share per-key in-flight validation results across synchronous preflights. Key the bounded memo by full trust identity and executable/bundle metadata, expire stable results, and leave transient failures retryable. Preserve live ACL inspection and existing no-UI secret reads. Cover serial/concurrent fan-out, update invalidation, expiry, transient failures, and capacity eviction through synthetic preflight fixtures. Fixes #3837 Closes #3838 Co-authored-by: luk <jinyuren886@gmail.com> (cherry picked from commit dfccffe)
Share per-key in-flight validation results across synchronous preflights. Key the bounded memo by full trust identity and executable/bundle metadata, expire stable results, and leave transient failures retryable. Preserve live ACL inspection and existing no-UI secret reads. Cover serial/concurrent fan-out, update invalidation, expiry, transient failures, and capacity eviction through synthetic preflight fixtures. Fixes #3837 Closes #3838 Co-authored-by: luk <jinyuren886@gmail.com> (cherry picked from commit dfccffe)
Browser-cookie preflights repeatedly validate the invoking app's entire code signature for the same trusted-application/executable pair. This memo reuses those results and shares an in-flight result per key, so concurrent callers perform one validation while unrelated keys can progress independently.
The key includes the full trusted-application representation, executable path and filesystem identity, enclosing bundle path/version/directory identity, and the bundle's main executable path/identity. Info.plist is read directly so app updates invalidate entries without relying on Foundation's cached bundle metadata. The process-local memo holds at most 64 completed results, with 30-second success and five-minute confirmed-rejection lifetimes; transient errors are never cached. ACL/prompt-selector inspection and non-interactive secret-read policy are unchanged.
Rewritten from the investigation and proposal by @jeffloo886, with contributor credit preserved in the commit and changelog.
Validation:
swift test -j 2 --filter KeychainAccessValidationMemoTestsfailed with 13 expected issues: 100 serial requests performed 100 validations and 20 concurrent requests performed 20.swift test -j 2 --filter 'KeychainAccess|BrowserCookieAccessGate|KeychainPromptSafetyAudit|ProviderArchitectureGatekeeper|KeychainNoUIQuery|KeychainCacheApplicationPath'passed 101 tests in 10 suites. Counts were 100 serial requests → 1 validation and 20 concurrent requests → 1 validation, including proof that another key progresses while one is pending. Bundle/version/executable changes, expiry, capacity, distinct identities, missing metadata, and uncached transient statuses are covered.CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1,CODEXBAR_TEST_CODEX_FILE_ISOLATION=1, andCODEXBAR_TEST_SESSION_FILE_ISOLATION=1, withCODEXBAR_ALLOW_TEST_KEYCHAIN_ACCESSunset. Fixtures and preflights are synthetic; no app relaunch or live account probes were used.swift build -j 2passed (debug).make checkpassed: 0 violations, 0 serious in 2549 files.The call counts are synthetic validation-hook measurements; this PR does not claim a new end-to-end CPU measurement.
Fixes #3837
Closes #3838