Skip to content

security(skillgen): --watch INPUT_PATH still interpolated in the Aider/Devin monolith cores #3844

Closed

Description

@safishamsi

Follow-up to #3742 / #3642.

#3742 closed the Step 1 injection and #3742's follow-on closed the same class in the progressive-disclosure --watch reference (tools/skillgen/fragments/references/shared/add-watch.md), which now reads the trusted graphify-out/.graphify_root instead of re-substituting the raw INPUT_PATH.

The identical placeholder is still live in the two monolith cores:

  • tools/skillgen/fragments/core/aider.md — python3 -m graphify.watch INPUT_PATH --debounce 3
  • tools/skillgen/fragments/core/devin.md — same line

(and the shipped graphify/skill-aider.md / graphify/skill-devin.md monoliths).

An agent-substituted path containing $(...), backticks, or ; would execute when the --watch command runs. Same severity/class as #3642.

Why it wasn't fixed in #3742

The monolith cores use a self-contained flow that does not write graphify-out/.graphify_root, so the sidecar trick used in add-watch.md doesn't apply directly. Editing a core also trips the skillgen monolith-roundtrip guard: any change needs a sanctioned-diff predicate in tools/skillgen/gen.py (_SANCTIONED_MONOLITH_DIFFS) or --monolith-roundtrip fails.

Suggested fix

Either (a) have the core Step 1 write .graphify_root and reuse it in the --watch snippet, or (b) neutralize the path in place (single-quote / restructure so the shell never interprets it), plus the matching gen.py sanctioned-diff and a regenerate + --monolith-roundtrip pass. Add a test that runs the core's --watch snippet with a hostile substituted path (mirroring tests/test_skillgen_input_path_injection.py).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions