Title: Security: Remaining /bin/sh -c shell-injection sites not covered by #289 · Issue #367 · getsentry/XcodeBuildMCP · GitHub
Open Graph Title: Security: Remaining /bin/sh -c shell-injection sites not covered by #289 · Issue #367 · getsentry/XcodeBuildMCP
X Title: Security: Remaining /bin/sh -c shell-injection sites not covered by #289 · Issue #367 · getsentry/XcodeBuildMCP
Description: Follow-up to #289. PR #289 fixes the useShell=true code path in defaultExecutor by routing through shellEscapeArg. That fix does not cover call sites that construct their own /bin/sh -c strings and pass them to the executor with useShell...
Open Graph Description: Follow-up to #289. PR #289 fixes the useShell=true code path in defaultExecutor by routing through shellEscapeArg. That fix does not cover call sites that construct their own /bin/sh -c strings and...
X Description: Follow-up to #289. PR #289 fixes the useShell=true code path in defaultExecutor by routing through shellEscapeArg. That fix does not cover call sites that construct their own /bin/sh -c strings and...
Opengraph URL: https://github.com/getsentry/XcodeBuildMCP/issues/367
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Security: Remaining /bin/sh -c shell-injection sites not covered by #289","articleBody":"Follow-up to #289.\n\nPR #289 fixes the `useShell=true` code path in `defaultExecutor` by routing through `shellEscapeArg`. That fix does **not** cover call sites that construct their own `/bin/sh -c` strings and pass them to the executor with `useShell=false` as `['/bin/sh', '-c', command]`. Each of these interpolates user-controlled paths into the shell string and is currently vulnerable to CWE-78.\n\n## Affected sites\n\n- `src/utils/bundle-id.ts` — `defaults read \"${appPath}/Info\" CFBundleIdentifier` and the PlistBuddy fallback\n- `src/mcp/tools/project-discovery/get_mac_bundle_id.ts` — same pattern\n- `src/mcp/tools/macos/build_macos.ts` — same pattern\n- `src/utils/macos-steps.ts` — same pattern\n\n## Regression tests already documenting these vectors\n\nThe PR carries `UNFIXED:` test cases for these sites in:\n- `src/utils/__tests__/bundle-id-injection.test.ts`\n- `src/utils/__tests__/mac-bundle-id-injection.test.ts`\n\nTheir assertions (e.g. `expect(cmdString).toContain('$(id)')`) intentionally still document the injection vectors so the audit trail remains visible. They should be flipped from `UNFIXED:` to safe assertions as each site is fixed.\n\n## Remediation options\n\nFor each site, either:\n1. Stop using `/bin/sh -c` and call `defaults` / `PlistBuddy` with an arg array directly (preferred — removes shell parsing entirely), or\n2. Apply `shellEscapeArg` (from `src/utils/command.ts`) to every interpolated value.\n\nOption (1) is a small design-shape decision per call site (whether the helper takes a path or a parsed-out arg array), which is why these were deliberately left out of the #289 rebase scope.\n\n## Why this matters\n\nAfter #289 lands, one shell-injection variant is closed and four documented variants remain live. The vulnerability is only partially mitigated until these are addressed.","author":{"url":"https://github.com/cameroncooke","@type":"Person","name":"cameroncooke"},"datePublished":"2026-04-26T21:13:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/367/XcodeBuildMCP/issues/367"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b717621b-668c-70bb-ebd7-25ef0dc2a041 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D698:2BCCB3:3353B6:47A490:6A4D0BAE |
| html-safe-nonce | a9455cd74e396e29d50f802ddcfc540398edd28db5327245d02e0a59d62f02fb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENjk4OjJCQ0NCMzozMzUzQjY6NDdBNDkwOjZBNEQwQkFFIiwidmlzaXRvcl9pZCI6IjU3NDYxMDU0ODAwMTYzNjY1MTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2fc29dbfb4cf79dcc8a64ef826325e0f9cd11b5d7dffc00fe81f99ced7aa4146 |
| hovercard-subject-tag | issue:4331996427 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/XcodeBuildMCP/367/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1cdfa9cd691f98f411c22451ccf59f802a1a1b959e1c0fe4415f8701501ad0ea/getsentry/XcodeBuildMCP/issues/367 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1cdfa9cd691f98f411c22451ccf59f802a1a1b959e1c0fe4415f8701501ad0ea/getsentry/XcodeBuildMCP/issues/367 |
| og:image:alt | Follow-up to #289. PR #289 fixes the useShell=true code path in defaultExecutor by routing through shellEscapeArg. That fix does not cover call sites that construct their own /bin/sh -c strings and... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cameroncooke |
| hostname | github.com |
| expected-hostname | github.com |
| None | bcb4661e6fb4fe8b394c51ea02ccdb2236d40dc59afc75a3bbba50bf6517134c |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/XcodeBuildMCP git https://github.com/getsentry/XcodeBuildMCP.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 945551361 |
| octolytics-dimension-repository_nwo | getsentry/XcodeBuildMCP |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 945551361 |
| octolytics-dimension-repository_network_root_nwo | getsentry/XcodeBuildMCP |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fb70bd3c4b2bec429781b65419e912c66e2d5581 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width