Skip to content

docs(cse_main): document risk-acceptance for unquoted OUTBOUND_COMMAND - #9876

Open
Calvin S. (calvin197) wants to merge 1 commit into
mainfrom
security/document-outbound-command-risk
Open

Calvin S. (calvin197) wants to merge 1 commit into
mainfrom
security/document-outbound-command-risk

Conversation

@calvin197

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

A security scan flagged OUTBOUND_COMMAND being expanded unquoted inside a retrycmd_if_failure call in cse_main.sh as a potential command-injection-shaped pattern (ADO finding 37518905). This PR documents why that is intentional and should not be changed:

  • OUTBOUND_COMMAND holds a full shell command (e.g. a curl connectivity preflight check) constructed by the RP from config.OutboundType/CloudSpecConfig (GetOutboundCommand in pkg/agent/baker.go), not an arbitrary string from external/customer-controlled input.
  • Quoting it would break word-splitting into argv, causing the outbound connectivity preflight check to fail to execute as intended.

No functional/behavioral change — in-place comment only. Validated: bash -n passes, and the full cse_main_spec.sh ShellSpec suite still passes (17 examples, 0 failures), including the static assertions on this exact line's format and ordering.

Which issue(s) this PR fixes:
Fixes #

ADO work items (msazure/CloudNativeCompute): 37518905 (parent: 37518878)

OUTBOUND_COMMAND is expanded unquoted in a retrycmd_if_failure call,
which a scanner flags as a command-injection-shaped pattern. This is
intentional, not an oversight:

  - It is a full shell command (e.g. a curl connectivity check) built by
    the RP from config.OutboundType/CloudSpecConfig (GetOutboundCommand
    in pkg/agent/baker.go), not an arbitrary string from an external/
    customer-controlled input.
  - Quoting it would break word-splitting into argv, making the outbound
    connectivity preflight check fail to execute as intended.

No functional change - in-place comment only, documenting why this
should not be 'fixed' by naively adding quotes. Verified: bash -n passes,
and the full cse_main_spec.sh ShellSpec suite still passes (17 examples,
0 failures) - including the static assertions on this exact line's
format and ordering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 350c2577-7031-4d0d-adc1-e99d053fc981
Copilot AI balanced review requested due to automatic review settings October 22, 2026 23:37
@calvin197
Calvin S. (calvin197) requested review from a team as code owners October 22, 2026 23:37
@github-actions

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   18 suites   1m 5s ⏱️
563 tests 563 ✅ 0 💤 0 ❌
585 runs  585 ✅ 0 💤 0 ❌

Results for commit ddbbbbb.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
staging_cse_windows Package 1 65% ➖
debug 0% ❌
provisioningscripts 2% ❌
parts_windows Package 1 73% ➖
Summary 38% (1652 / 6834) ❌

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The comment-only change explains the existing behavior, with no unresolved substantive issues.

No open issues 🎉

What changed in this PR

Documents why Linux node provisioning intentionally expands OUTBOUND_COMMAND unquoted, recording the rationale behind the security-scan risk acceptance without changing runtime behavior.

Changes:

  • Explains the command’s configuration-derived origin and reliance on shell word-splitting.
  • Notes that adding quotes would require an end-to-end array conversion.
File Description
parts/​linux/​cloud-init/​artifacts/​cse_main.sh Adds explanatory comments above the unchanged outbound connectivity check.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 28% ❌
Summary 28% (4591 / 16082) ❌

This branch has not been deployed

No deployments
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.

2 participants