Skip to content

Potential fix for code scanning alert no. 10: Uncontrolled command line - #23

Merged
anikitenko merged 12 commits into
mainfrom
alert-autofix-10
Oct 21, 2026
Merged

anikitenko merged 12 commits into
mainfrom
alert-autofix-10

Conversation

@anikitenko

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/anikitenko/fdo/security/code-scanning/10

To fix this safely without changing behavior, ensure shell-safe quoting when reconstructing endpoint.command in helperTarget (in src/utils/hostServices/gitInvocation.cjs). The best minimal fix is to escape single quotes inside repo before embedding it in single quotes (POSIX-safe pattern: ' → '"'"'). That preserves current command format and compatibility while preventing quote-breaking injection.

Concretely:

  • Edit helperTarget near the return object.
  • Introduce a local escaped value (e.g., quotedRepo = repo.replace(/'/g, '"'"')).
  • Build command with that escaped value instead of raw repo.

No changes are required in gitTransport.cjs; it can continue executing endpoint.command because the dangerous interpolation point is in gitInvocation.cjs.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

anikitenko and others added 12 commits October 21, 2026 12:46
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ter sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ression

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ression

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ression

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…hod call

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…er sanitization

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ng or encoding

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…aping

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…aping

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@anikitenko
anikitenko marked this pull request as ready for review October 21, 2026 11:34
@anikitenko
anikitenko merged commit 1f8f84f into main Oct 21, 2026
8 of 11 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-21T11:34:59.238068Z e186e6f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant