Security hardening: 30 exploitable vulnerabilities (batches 1–7)#38
Conversation
…ile-size limits, serve CSRF, untrusted wrappers)
…batch_patch, transcribe, tree width)
…nscribe output, session_search get)
…ession_search wrapping, resource size, subagent summary, patch expansion)
…le/element wrapping + cap, config size cap, resource resolver symlink Lstat)
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
odek | 47fae17 | Commit Preview URL Branch Preview URL |
Jun 13 2026, 12:41 PM |
vprotocol finding (axis 2.1/2.9): the maxHeadTailTotalBytes comment claimed a "total across all files" guarantee that the code enforces per-file. Correct the comment to state the cap is per-file and that the ~10 MiB aggregate bound comes from the separate 10-file-per-call limit. Add TestHeadTail_CapsOutputSizeMultiFile to lock both the per-file cap and the aggregate bound across the max 10 files. Additive only — no behavior change to security logic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔏 Verification Certificate — AI Verification Protocol v5.2.7Ran the AI Verification Protocol against this PR's diff (8 commits, ~1,790 insertions across 30 files). Classification: KnownGroundTruth — human-authored security fixes, each with a TDD test for the exact change ( Axes Summary
Signals (qualitative)
Findings & Remediations (auto-applied, additive — §7.1)
Repair Gate (§7.5): ✅ build passes · ✅ full Verdict: AutoApprove (single-reviewer caveat →
|
CodeQL flagged uncontrolled user data (the @-reference query) reaching a
path expression in FileResolver.Search. A query like "../../etc/passwd"
makes filepath.Join(root, query) clean to a path outside root, so
filepath.Glob matched files the workspace must not expose and os.Lstat
leaked their metadata (size, etc.) — the same metadata-disclosure class
this PR hardens elsewhere.
Add a separator-aware withinRoot() confinement primitive and apply it to
every Search match before touching the filesystem. Reuse it in Load,
replacing the prior HasPrefix(absTarget, absRoot) check that also fixed a
boundary bug ("/foo" matching "/foobar").
TestFileResolver_SearchOutsideRoot fails against the pre-fix code
(leaks @../secret.txt) and passes with the guard.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
This PR closes 30 exploitable vulnerabilities discovered in the odek agent runtime through a TDD-driven hardening pass. Each fix is paired with a RED regression test; the branch is kept green with the full suite plus the race detector.
Scope
The hardening spans file tools, browser/network tools, performance/parallel tools, the Web UI server, sub-agent handling, config loading, and the @-resource resolver. Every change is minimal and follows the existing code style.
Batches
odek serveCSRF / clickjacking / security headers, untrusted-content wrappers for head_tail / diff / sort / tr / json_query--ctxprompt wrapping, resource file-size cap, delegate_tasks summary cap, patch / batch_patch output-expansion capKey security themes
read_file,search_files,multi_grep,batch_read,head_tail,diff,sort,tr,json_query,glob,file_info,tree,base64file mode),shell,browser,transcribe,session_search, @-resources,--ctxfiles, and MCP tools now wrap external output in a per-call nonce wrapper.search_filesandFileResolver.SearchuseLstatto avoid following symlinks for metadata.browserandhttp_batchre-classify redirect hops;browserenforces a request timeout and caps extracted elements.Testing
Both pass.
Documentation
AGENTS.mdupdated with the new defenses and constants.docs/SECURITY.mdupdated with the untrusted-content wrapper table, config-size-cap section, and resource-resolver symlink note.