Repository navigation
Description
Verified against upstream main at cf9b73c4f352bdc1fbd3c1332fca4183a63e3fb8 (0.14.9) during the 2026-10-26 security review, using Windows and Bun 1.3.10. Severity is a review priority, not a calculated CVSS score. The reproduction invokes actual plugin hooks/tools through the repository's fake-host harness; it is not a real-host end-to-end exploit.
Impact and cause
Ordinary tool use creates durable plaintext copies of recognized credentials, even with autoCapture disabled. memory_evidence can return those values to the model; normal evidence reads are also not session/repository filtered.
afterTool writes output_summary: summarize(text) for read/grep/glob/edit/write/bash/shell results. summarize folds whitespace and takes the first 80 characters; neither it nor record redacts secrets. A short GitHub token that redactSecrets() recognizes survives byte-for-byte in evidence/<date>.logfmt and the tool response.
Expected behavior / acceptance
- A recognized synthetic credential in an ordinary tool result never appears in evidence or a
memory_evidenceresponse, with auto-capture off or on. - Prefer structured result metadata to persisted output excerpts. If retaining excerpts, redact the complete text before truncation/whitespace folding, so token prefixes and PEM boundaries are not lost before redaction.
- Review other audit/reason write paths for the same bypass and define evidence-read scoping.
- Add regression coverage for the complete hook-to-file-to-tool-response path, including a credential crossing the summary boundary and multiline private-key material.
- Keep old evidence remediation separate and explicit; fixing new writes does not scrub old files.
Related work
#74 asks whether evidence redaction is complete but primarily covers historical stores/snapshots. This is a confirmed new-write leak in the default configuration, so it is tracked separately. Related: #83.
Reproduction
Save the following as security-review-repro.test.ts at the repository root of the reviewed revision and run bun test ./security-review-repro.test.ts --timeout 20000. All files are temporary fixtures and any model API is fake. These assertions deliberately confirm the current vulnerable behavior; passing means the bug reproduced, not that it is fixed. The fixtures are retained in the OS temp directory for inspection.
Self-contained Bun reproduction
// Review-only proofs against upstream cf9b73c (0.14.9). No real stores, keys, or model calls.
import { beforeEach, afterEach, expect, test } from 'bun:test';
import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { loadPlugin, type LoadedPlugin } from './test/harness.ts';
import { appendMemory, loadAll, isActive, isVisibleHere } from './src/memory.ts';
import { rememberSessionDir, resetSessionScopes, resolveRepo, setRepoScope } from './src/repokey.ts';
import { resetState, setCurrent } from './src/state.ts';
import { dateStr, evidenceDir } from './src/config.ts';
import { redactSecrets } from './src/secrets.ts';
import { resetCaptureCooldowns } from './src/index.ts';
import { startViewer, type ViewerServer } from './src/viewer/server.ts';
let root: string;
let a: string;
let b: string;
let plugin: LoadedPlugin | undefined;
let viewer: ViewerServer | undefined;
beforeEach(() => {
root = mkdtempSync(join(tmpdir(), 'osi-security-proof-'));
a = join(root, 'repo-a'); b = join(root, 'repo-b');
mkdirSync(a); mkdirSync(b);
process.env.OPENCODE_MEMORY_DIR = join(root, 'memory');
process.env.OPENCODE_COMMANDS_DIR = join(root, 'commands');
process.env.OPENCODE_CBM_BIN = join(root, 'no-graph-binary');
resetState(); resetSessionScopes(); resetCaptureCooldowns(); setRepoScope(null);
});
afterEach(async () => {
viewer?.server.stop(true); viewer = undefined;
await plugin?.cleanup(); plugin = undefined;
resetState(); resetSessionScopes(); setRepoScope(null);
delete process.env.OPENCODE_MEMORY_DIR;
delete process.env.OPENCODE_COMMANDS_DIR;
delete process.env.OPENCODE_CBM_BIN;
// Keep only synthetic temp fixtures for inspection; never touch user state.
});
test('confirmed: ordinary tool output persists a recognized GitHub token in evidence', async () => {
plugin = await loadPlugin(a); // autoCapture OFF
const fake = 'ghp_' + 'AbCdEfGhIjKlMnOpQrStUvWxYz0123456789';
expect(redactSecrets(fake)).toBe('[redacted]');
await plugin.toolHooks['execute.after']({ sessionID: 'ses-a', callID: 'read1', tool: 'read',
input: { filePath: '.env' }, result: { content: 'GITHUB_TOKEN=' + fake } });
const raw = readFileSync(join(evidenceDir(), dateStr() + '.logfmt'), 'utf8');
expect(raw).toContain(fake);
const returned = await plugin.tools.memory_evidence.execute({ ev: 'tool_result' });
expect(returned.content).toContain(fake);
});
Activity
WhollyMindless commentedon Oct 26, 2026
Follow-up review: partially addressed; please keep this issue open until the remaining requirements are fixed or explicitly split.
The new ordinary tool-output scrub works in the reviewed cases, including a token crossing the summary boundary and multiline PEM material. Two residual cases remain:
memory_evidence; the tool does not use caller identity. The PR acknowledges this deferral. Please define/enforce caller-scoped reads and make any cross-repository audit access explicit.memory_merge_review.reasonstill persists a recognized synthetic credential verbatim in the daily memory row, even though the corresponding evidence line is scrubbed. Please cover the supersession write boundary in the audit/reason review.These are remaining gaps, not regressions in the new tool-output scrub. Historical-store cleanup remains separate under #74.
Detailed #133 review · Runnable probes and merge-reason finding. Reproduced on combined head
c9791ed, Windows / Bun 1.3.10, with temporary stores and synthetic credentials. Please adjust the unconditionalFixes #128claim until the acceptance decision is resolved.fix(security): resolve session identity against the instance, partiti…
fix(security): scrub credentials at the evidence write boundary (abog…
test(security): regression suites for abogartz#127 abogartz#128 aboga…
docs(security): README on the entry-resolved reader and audit scrubbing
fix(security): resolve session identity against the instance, partiti…
Merge pull request #133 from WhollyMindless/fix/security-127-129
chore(release): 0.14.12 [skip ci]
abogartz-opencode-self-improvement commentedon Oct 28, 2026
🎉 This issue has been resolved in version 0.14.12 🎉
The release is available on:
Your semantic-release bot 📦🚀