Skip to content

Fix quote-stripping bug in OpenerLauncher.splitCommand breaking openers with shell-sanitized values - #529

Draft
angryziber with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-automatic-issues
Draft

Fix quote-stripping bug in OpenerLauncher.splitCommand breaking openers with shell-sanitized values#529
angryziber with Copilot wants to merge 4 commits into
masterfrom
copilot/fix-automatic-issues

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #528.

Root cause

The 3.10 release added sanitizeForShell (security hardening against shell injection), which wraps every substituted opener value (e.g. ${fetcher.ip}) in single quotes before it's inserted into the opener command string. On non-Linux platforms, the resulting string is split into process arguments via Runtime.exec(splitCommand(openerString)).

splitCommand's quote-handling logic assumed a quoted token always spans across at least one embedded space, so after finding a token that starts with a quote character, it always tried to consume an additional token via tokenizer.nextToken(quoteChar) to locate the closing quote.

For simple values with no embedded whitespace (e.g. an IP address wrapped as '192.168.1.1'), the entire quoted token is already returned in full by the initial whitespace-based nextToken call. The subsequent lookup for the closing quote then reads past the actual value (into whatever text follows, or throws and is silently swallowed), leaving a stray, un-stripped trailing quote character in the argument (e.g. 192.168.1.1' instead of 192.168.1.1). This corrupted virtually every opener command using a fetcher value on Windows/macOS non-terminal launches, exactly as reported in #528.

Fix

When a whitespace-delimited token already starts and ends with the same quote character (and is longer than 1 character), unwrap it directly instead of falling into the old multi-token-consuming logic that assumed the quotes were separated by whitespace.

Testing

  • Added regression tests to OpenerLauncherTest.testCommandSplitting covering single- and double-quoted, whitespace-free tokens (matching the pattern sanitizeForShell produces).
  • All existing OpenerLauncherTest cases still pass (including the deliberately-malformed-quote fallback case).
  • Ran full test suite; only pre-existing, unrelated, network-dependent FileFeederTest.simpleHostnames failure remains (confirmed present on the base branch too, before this change).
  • code_review and codeql_checker both ran clean.

Co-authored-by: angryziber <882016+angryziber@users.noreply.github.com>
Co-authored-by: angryziber <882016+angryziber@users.noreply.github.com>
Copilot AI and others added 2 commits September 1, 2026 06:51
…m build glob

Co-authored-by: angryziber <882016+angryziber@users.noreply.github.com>
Co-authored-by: angryziber <882016+angryziber@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

double quotes added around fetchip result

2 participants