Skip to content

fix: redact runtime-reported memory activity before audit - #86

Merged
BunsDev merged 2 commits into
mainfrom
codex/propose-fix-for-memory-audit-vulnerability
Aug 26, 2026
Merged

fix: redact runtime-reported memory activity before audit#86
BunsDev merged 2 commits into
mainfrom
codex/propose-fix-for-memory-audit-vulnerability

Conversation

@BunsDev

@BunsDev BunsDev commented Aug 26, 2026

Copy link
Copy Markdown
Member

Motivation

  • The session sanitization previously omitted SessionResult.memory_used, allowing runtime-supplied memory read ids and proposed write keys (which may contain live tokens) to be persisted and returned by the memory inspection API, creating a high-severity secret exposure risk.

Description

  • Extend sanitize_result to traverse and redact all strings inside SessionResult.memory_used, including MemoryEntryRef.id/scope, ProposedMemory.key/summary/scope/approval, and RejectedMemory fields, before any validation, persistence, or publication. (See crates/worker/src/redact.rs.)
  • Expand the existing redaction regression test to populate memory_used with read, proposed, and rejected entries and assert that live tokens are removed from the serialized result. (Test lives in the redact tests in crates/worker.)
  • Preserve existing behavior for all other result fields and keep the redaction implementation unchanged except for the added traversal of memory activity fields.

Testing

  • Ran cargo test -p coven-github-worker redact::tests::sanitize_result_scrubs_every_free_text_field and the test passed.
  • Ran cargo check --all-targets and cargo clippy --all-targets -- -D warnings, both completing successfully.
  • Ran cargo test --all; repository-wide unit tests completed but some worker integration tests failed due to the local test environment returning 403 Forbidden to mocked HTTP requests (these failures are environmental and not caused by the redaction change).

Codex Task

Signed-off-by: Codex <codex@openai.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 02:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the worker’s result sanitization to ensure runtime-reported memory activity (SessionResult.memory_used) is scrubbed for live tokens and token-shaped strings before any downstream persistence or publication, preventing secrets from being exposed via audit/inspection surfaces.

Changes:

  • Extend sanitize_result to traverse memory_used.read, memory_used.proposed, and memory_used.rejected, redacting all contained String fields.
  • Expand the existing redaction regression test to populate memory_used with representative read/proposed/rejected entries and assert token removal from the serialized result.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@BunsDev
BunsDev merged commit f396534 into main Aug 26, 2026
1 check passed
BunsDev added a commit that referenced this pull request Aug 26, 2026
Carry the runtime memory redaction fix from #86 while retaining the fail-closed publication and revocation-store enforcement in #85.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants