Repository navigation
docs(cse_main): document risk-acceptance for unquoted OUTBOUND_COMMAND - #9876
Open
Calvin S. (calvin197) wants to merge 1 commit into
Open
Calvin S. (calvin197) wants to merge 1 commit into
Calvin S. (calvin197) wants to merge 1 commit into
Conversation
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
Contributor
Windows Unit Test Results 3 files 18 suites 1m 5s ⏱️ Results for commit ddbbbbb. |
Contributor
Contributor
There was a problem hiding this comment.
🟢 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
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
A security scan flagged
OUTBOUND_COMMANDbeing expanded unquoted inside aretrycmd_if_failurecall incse_main.shas a potential command-injection-shaped pattern (ADO finding 37518905). This PR documents why that is intentional and should not be changed:OUTBOUND_COMMANDholds a full shell command (e.g. acurlconnectivity preflight check) constructed by the RP fromconfig.OutboundType/CloudSpecConfig(GetOutboundCommandinpkg/agent/baker.go), not an arbitrary string from external/customer-controlled input.No functional/behavioral change — in-place comment only. Validated:
bash -npasses, and the fullcse_main_spec.shShellSpec 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)