Skip to content

Bug: Potential injection via unescaped prompt text in Ralph Wiggum setup heredoc #52408

@sakal-s

Description

@sakal-s

Description

In plugins/ralph-wiggum/scripts/setup-ralph-loop.sh (lines 140-150), the user-provided prompt text is inserted directly into a markdown file via a heredoc without any escaping:

cat > .claude/ralph-loop.local.md <<EOF
...
$PROMPT
EOF

If the prompt contains the literal string EOF on its own line, or shell-special characters, this could cause:

  • Premature heredoc termination, resulting in a truncated or malformed file
  • Unexpected shell expansion of variables or commands within the prompt text

Expected Behavior

User-provided prompt text should be safely written to the file without risk of heredoc injection or shell expansion.

Suggested Fix

Use a quoted heredoc delimiter to prevent shell expansion, or write the file using printf or a similar method that does not interpret the content.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions