fix: test.sh's eval invocation dropped all but one coverage flag, and was a real injection risk - #97
Merged
Merged
Conversation
… was a real injection risk Found via a real CI failure on unity-test-runner's thin-wrapper PR: every single Docker test run produced no results file at all. Two bugs, both introduced in #95: 1. COVERAGE_FLAGS was converted to a bash array (to avoid the eval below), but the unity-editor invocation still referenced it as plain $COVERAGE_FLAGS instead of "${COVERAGE_FLAGS[@]}" - unquoted, unsubscripted array expansion in bash only yields element [0]. Every run silently dropped -enableCodeCoverage/-coverageOptions and the coverageResultsPath *value*, leaving a bare -coverageResultsPath flag that then swallowed the next token (customParameters' first word) as its argument - corrupting the whole Unity command line. 2. The invocation used `eval` to get CUSTOM_PARAMETERS to word-split into separate argv entries. CUSTOM_PARAMETERS is user-controlled (the action's own customParameters input) - eval would interpret any shell metacharacters in it (;, $(), backticks) as real shell syntax, a real command-injection surface. Fixed by converting the whole invocation to a plain bash array (runTests, COVERAGE_FLAGS) with proper "${array[@]}" expansion. CUSTOM_PARAMETERS is still deliberately left unquoted for its intended word-splitting into separate args, but with eval gone entirely, that splitting can no longer be abused as shell syntax. Verified: bash -n syntax check passes, full bun test suite still 156 pass/0 fail (this file isn't bundled into dist/index.js - it's a static asset mounted into the container at runtime, so nothing else needed rebuilding).
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
frostebite
added a commit
that referenced
this pull request
Aug 18, 2026
frostebite
added a commit
that referenced
this pull request
Aug 18, 2026
Docker test runs on unity-test-runner's thin-wrapper PR fail near- instantly with zero visible stdout - only two 'cat: no such file' stderr lines from the very end of test.sh's loop body, meaning the script reaches its last lines but nothing from mkdir/echo/unity-editor earlier in the script is visible at all, and the whole thing completes in well under a second (confirmed via job log timestamps) - too fast for Unity to have actually launched. Ruled out so far: the version-pin gap (#96, fixed), the eval/array bug in the coverage flags (#97, fixed) - this is a third, still-unidentified issue. set -x traces every command to stderr, which (unlike stdout) is rendering promptly in the CI log, to find the actual failure point in the next run. Temporary - will be removed once root-caused.
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.
Found via a real CI failure on
unity-test-runner's thin-wrapper PR (#310): after fixing the version-pin gap (#96), every single Docker test run still produced no results file at all.Two bugs, both introduced in #95:
COVERAGE_FLAGSwas converted to a bash array (to avoid theevalbelow), but theunity-editorinvocation still referenced it as plain$COVERAGE_FLAGSinstead of"${COVERAGE_FLAGS[@]}"— unquoted, unsubscripted array expansion in bash only yields element[0]. Every run silently dropped-enableCodeCoverage/-coverageOptionsand thecoverageResultsPathvalue, leaving a bare-coverageResultsPathflag that then swallowed the next token (customParameters' first word) as its argument — corrupting the whole Unity command line.evalto getCUSTOM_PARAMETERSto word-split into separate argv entries.CUSTOM_PARAMETERSis user-controlled (the action's owncustomParametersinput) —evalwould interpret any shell metacharacters in it (;,$(), backticks) as real shell syntax, a real command-injection surface.Fix
Converted the whole invocation to a plain bash array (
runTests,COVERAGE_FLAGS) with proper"${array[@]}"expansion.CUSTOM_PARAMETERSis still deliberately left unquoted for its intended word-splitting into separate args, but withevalgone entirely, that splitting can no longer be abused as shell syntax.Testing
bash -nsyntax check passes.bun test ./src: 156 pass, 0 fail (this file isn't bundled intodist/index.js— it's a static asset mounted into the container at runtime, so nothing else needed rebuilding).unity-test-runner's failing CI run was exercising).🤖 Generated with Claude Code