Skip to content

chore(docker): avoid shell interpretation and uncontrolled path expansion#31110

Open
thetaPC wants to merge 3 commits intomainfrom
docker-args
Open

chore(docker): avoid shell interpretation and uncontrolled path expansion#31110
thetaPC wants to merge 3 commits intomainfrom
docker-args

Conversation

@thetaPC
Copy link
Copy Markdown
Contributor

@thetaPC thetaPC commented May 1, 2026

Issue number: N/A


What is the current behavior?

When passing a Playwright flag with a space in its value (e.g. --project='Mobile Safari'), the shell strips the quotes before Node receives the argument. Since docker.mjs passed args to execa with shell: true, the unquoted space caused the argument to be split and Playwright never received the correct value.

Additionally, arguments like -e DISPLAY=${display}, -v ${displayVolume}, and --mount were constructed as combined strings and passed through shell interpretation, meaning special characters in those values (e.g. spaces in an absolute path) could cause the command to fail unexpectedly. This caused CodeQL to trigger with security issues.

What is the new behavior?

Each Docker argument is now passed as a separate array element to execa without shell: true, so values are forwarded directly to Docker without shell re-interpretation. This preserves spaces within argument values (e.g. --project='Mobile Safari') and prevents uncontrolled expansion of paths and environment variable values.

The security issues stated by CodeQL has been addressed.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Verify that the following command works: npm run test.e2e.docker datetime/test/basic -- -g 'IO fallback' --project='Mobile Safari' --repeat-each=20

@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment May 5, 2026 9:25pm

Request Review

Comment thread core/scripts/docker.mjs Fixed
Comment thread core/scripts/docker.mjs Fixed
@thetaPC thetaPC changed the title chore(scripts): re-quote spaced args passed to docker test runner chore(docker): avoid shell interpretation and uncontrolled path expansion May 1, 2026
@thetaPC thetaPC marked this pull request as ready for review May 5, 2026 21:50
@thetaPC thetaPC requested a review from a team as a code owner May 5, 2026 21:50
@thetaPC thetaPC requested a review from OS-jacobbell May 5, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants