Skip to content

install_agy_hooks.py interpolates the plugin root path into a shell command line with only double-quote escaping (splices) #577

Closed

Description

@fdaviddpt

Filed from release-auditor round 1 on the v0.27.0..HEAD delta (2026-09-05).

Class: splices -- can ship behind a filed issue (non-blocking).

scripts/install_agy_hooks.py:75 does entry[event]["command"] = f'bash "{command_path}"', interpolating the install path into a shell command line agy later re-parses, with double quotes as the only quoting. tests/test_install_agy_hooks_563.py:107-149 (test_build_entry_command_survives_windows_shell_quoting) considers exactly this hazard but asserts only one spelling of it (no raw backslash).

Audit exercised, with a control:

CONTROL (ordinary root): bash "/opt/remember/scripts/agy-stop-hook.sh"
QUOTE in root         : bash "/opt/we"ird/scripts/agy-stop-hook.sh"
DOLLAR in root        : bash "/opt/$(id)/scripts/agy-stop-hook.sh"

The control produced a correctly quoted command; the other two did not.

plugin_root is the user's own checkout path (os.path.abspath(os.path.dirname(__file__)/'..')), not remote-controlled, which is why this is low rather than blocking.

Fix: wrap command_path in shlex.quote() before interpolating it into the command string.

[AI-generated]

Activity

  1. added
    bug
    priority:low
    filed-by-loop
    cohort-6
    on Sep 5, 2026
  2. self-assigned this
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcohort-6filed-by-looppriority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions