Skip to content

Prompt template substitution is insecure #117

@ascorbic

Description

@ascorbic

The way that template string substitution is implemented is fragile and insecure. I would expect it to behave like GitHub Actions substitution where it is applied to the parsed values, but instead it is applied directly to the file before parsing. This means that any YAML formatted-values in the substitution is parsed along with the rest of the prompt file.

At best this means that it is very easy to end up with syntax errors, but at worst it means input could completely change the generated prompt metadata, including changing models, system prompts etc. It is very easy to end up with untrusted content in there where, for example, it reads files from a PR or the contents of an issue.

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