Skip to content

Part #1029, harden workflow run expressions - #1090

Open
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-1029-actions-shell-injection
Open

Part #1029, harden workflow run expressions#1090
sylvesterkaczmarek wants to merge 1 commit into
nasa:devfrom
sylvesterkaczmarek:fix-1029-actions-shell-injection

Conversation

@sylvesterkaczmarek

@sylvesterkaczmarek sylvesterkaczmarek commented Aug 12, 2026

Copy link
Copy Markdown

Description of Change

Replace direct GitHub expression interpolation inside shell run: steps across the cFS workflows and composite actions with step environment variables.

This keeps expression values out of generated shell source so they are treated as data rather than shell syntax. Path, regex, container, and configuration values are quoted at shell boundaries. The CodeQL setup, prep, and make inputs intentionally carry command strings, so those are executed explicitly with bash -e -o pipefail -c "$INPUT_*" to preserve their existing semantics without interpolating GitHub expressions into the shell script.

The change covers 15 workflow/composite-action files and reduces direct ${{ ... }} interpolation inside run: blocks from 92 occurrences to 0.

Linked Issue

Part of #1029

Areas of Expertise Touched

  • ASTRO
  • CI/CD
  • COSMOS
  • Cybersecurity
  • Docker
  • EDS
  • Git
  • PSPs
  • SBN
  • SMP
  • Tables
  • TSN
  • Unit Tests
  • Other

Author Checklist

  • Linked GitHub issue is referenced above
  • Workflow changes were tested on a branch/fork before submitting this PR
  • All workflows ran successfully on this branch

Validation performed on the fork before submission:

  • audited 92 direct expression interpolations in run: blocks before the change and 0 after
  • parsed all modified workflow and composite-action YAML successfully
  • compared actionlint and ShellCheck diagnostics before and after the patch, with no new findings introduced
  • git diff --check passed

Upstream GitHub Actions are currently awaiting maintainer authorization for this fork-originated pull request, so no upstream CI result is being claimed yet.


Reviewer Checklist

  • Workflow logic is correct and achieves the stated goal
  • Third-party actions are from trusted sources and pinned to a specific SHA/tag
  • Secrets are handled appropriately (no secrets exposed in logs, least-privilege usage)
  • Workflow permissions follow the principle of least privilege
  • Changes do not break or bypass existing branch protection rules
  • All workflow runs on this PR completed successfully
  • Appropriate Expert areas have been reviewed

Move GitHub expression values out of shell run source and into step environment variables across the cFS workflows and composite actions.

This prevents expression values from being parsed as shell syntax while preserving their intended use as data. Quote path, regex, container, and configuration values at shell boundaries. CodeQL setup, prep, and build inputs intentionally represent command strings, so execute those explicitly through bash with normal error and pipe-failure handling rather than interpolating them into the generated script.

Validation:
- audited 92 direct expression interpolations in run blocks before the change
- audited 0 after the change
- all modified workflow and action YAML parses successfully
- no new actionlint or ShellCheck findings compared with current nasa/cFS dev
- git diff --check passes

AI assistance: ChatGPT was used for repository inspection, automated audit construction, implementation assistance, validation, CI diagnostics, and diff review.
@sylvesterkaczmarek
sylvesterkaczmarek marked this pull request as ready for review August 15, 2026 20:12
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