fix: execFileSync shell command built from environment values - #806
Open
bjormpro wants to merge 2 commits into
Open
fix: execFileSync shell command built from environment values#806bjormpro wants to merge 2 commits into
bjormpro wants to merge 2 commits into
Conversation
Use `execFileSync` (or `spawn` with argument arrays) instead of `execSync` with a command string, so file paths are passed as literal arguments and never interpreted by a shell. Best single fix in `apps/expo-app/scripts/utils/AndroidBuilder.mjs`: - Update the child_process import to include `execFileSync` and remove `execSync` usage. - Replace all three `execSync(...)` invocations in `applyBundle` with `execFileSync(binary, args, options)`. - Keep existing behavior (`cwd`, `stdio: 'inherit'`) unchanged. This addresses both alert variants at once because both tainted paths are no longer concatenated into a shell command string.
Collaborator
🟡 Heimdall Review Status
🟡
|
| Code Owner | Status | Calculation | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ui-systems-eng-team |
🟡
0/1
|
Denominator calculation
|
bjormpro
commented
Jul 24, 2026
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 changed? Why?
Dynamically constructing a shell command with values from the local environment, such as file paths, may inadvertently change the meaning of the shell command. Such changes can occur when an environment value contains characters that the shell interprets in a special way, for instance quotes and spaces. This can result in the shell command misbehaving, or even allowing a malicious user to execute arbitrary commands on the system.
Use
execFileSync(orspawnwith argument arrays) instead ofexecSyncwith a command string, so file paths are passed as literal arguments and never interpreted by a shell.Best single fix in
apps/expo-app/scripts/utils/AndroidBuilder.mjs:execFileSyncand removeexecSyncusage.execSync(...)invocations inapplyBundlewithexecFileSync(binary, args, options).cwd,stdio: 'inherit') unchanged.This addresses both alert variants at once because both tainted paths are no longer concatenated into a shell command string.
Root cause (required for bugfixes)
UI changes
Testing
How has it been tested?
Testing instructions
Illustrations/Icons Checklist
Required if this PR changes files under
packages/illustrations/**orpackages/icons/**Change management
type=emergency
risk=high
impact=sev1
automerge=false