Skip to content

Skill instructions interpolate unsanitized user input into Python/shell source (query.md, add-watch.md) #3439

Description

@Simwawa

Summary

Two of the graphify skill's reference docs instruct the host agent to interpolate raw, unsanitized user-controlled values directly into generated Python or shell source, which is unsafe.

.copilot/skills/graphify/references/add-watch.md (around line 17)

URL, AUTHOR, and CONTRIBUTOR are user-provided values that the instructions interpolate into single-quoted Python source. An embedded apostrophe causes a syntax error, and crafted input can execute arbitrary Python.

Fix suggestion: pass these values as command-line arguments or structured input (e.g. JSON via stdin) instead of embedding them textually into generated source.

.copilot/skills/graphify/references/query.md (around line 171)

The save-result template instructs the agent to substitute the user's verbatim question and the generated answer directly into a shell command. Double quotes still allow command substitution/backticks, and embedded quotes break argument boundaries — so ordinary content can fail and crafted content can execute commands.

Fix suggestion: pass these values through an argv-safe mechanism (e.g. write structured input to a temp file and invoke via Python subprocess.run([...]) with an argument list, not a shell string). Apply the same fix to the other save-result templates in that file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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