Repository navigation
fix(security): sanitizer relaxes denylists by file extension only; Markdown with inline code passes (#32) - #73
Open
minerva-sky wants to merge 2 commits into
Conversation
…enamev#32) Sanitizer.sanitize_file_content ran the command, code, SQL, and file-system denylists over every artifact type, so a Markdown README with an inline code span was rejected as command injection and the SecurityError took the task down with it. Prose and data artifacts (:markdown, :text, :json, :yaml) now skip the command- and code-injection lists, :sql artifacts skip the SQL list. Code artifacts and unknown types keep every check; the encoding and file-system checks apply to all. Closes codenamev#32 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rective check for prose (codenamev#32) Panel round 3 (Obie Fernandez, 2/3) found two holes in the type-scoped version: a caller without a name: still let the model-declared type skip the command lists, and .md is not inert when an agent harness expands !`cmd` in command or skill files. Now only a known extension relaxes anything (.md/.txt skip command+code lists, .sql skips the SQL list), prose keeps a check for executable Markdown directives, and every call without a name runs every list exactly as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32.
Security::Sanitizer.sanitize_file_contentran one union denylist over every artifact, so a README with a code span raisedSecurityError, and because the raise isSecurityErrorit took the task down with it..mdis inWorkspace::ALLOWED_EXTENSIONSand a README is the most likely thing an LLM file task produces, so the check was mostly rejecting the artifacts it was supposed to protect.What changes
sanitize_file_contentgainsname: nil;.mdand.txtskip the command- and code-injection lists,.sqlskips the SQL list. Every other extension, extension-less files (Rakefile,Gemfile), and every call without a name run every list exactly as onmain. The encoding check and the file-system list apply to all.FileGenerationCapabilityreads it), so{"name":"build.rb","type":"markdown"}is rejected as before, and so is a baresanitize_file_content(content, :markdown)from any caller.database.yml, a workflowrun:step, apackage.jsonscript).!`cmd`: agent harnesses expand that in.claude/commands/*.mdandSKILL.mdat prompt time, so Markdown is not entirely inert.Workspace#validate_artifactpassesartifact.name(its name regex and extension allowlist already run first)..rb/.sh/Rakefile, the nameless path, the three config payloads, the two Markdown-directive payloads, and two Workspace end-to-end cases.Tests: sanitizer + workspace specs 82/82; full suite 1404 examples with the one known
event_dispatcher_integration_spec.rb:291wall-clock flake that #36 de-flakes.Follow-up already open as #67:
Workspace#verify_artifactpicks its verification strategy from the declared type by the same hole.Intended labels:
loop:drain,loop:security.Panel
fetch; nit that the Workspace examples belong inworkspace_spec.rb.name:still let the declared type skip the command lists, and.mdis executable in agent harnesses via!`cmd`command and skill files. Both fixed in 6a58c04 (extension-only relaxation; prose directive check). Round 2 (3 seats): cleared, with the note that.txtis not fully inert either (CMakeLists.txt,requirements.txt), judged non-blocking because main never caught those payloads without backticks.Earlier rounds (2026-10-14, recorded on #32): Obie objected on the type-spoof and on relaxed YAML/JSON; both were fixed on this branch before this session's panel.
🤖 Generated with Claude Code