Repository navigation
fix: launch root-owned apps under a stock /Applications - #31408
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Under an admin-writable parent, bundle ownership is the right test: this user cannot create a root-owned directory, so a bundle they planted there stays refused. Any other parent, or a failed Notes
[DESIGN-REVIEWED] ddbe803 Description read[DESCRIPTION-READ] a989a37eadccb2eda0cd3ced9e69e9ae8b62db5a1c1442309476a75887e3ce57 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the fix targets the cause (a parent-mode probe that cannot tell installed bundles from planted ones on a stock What this change shipsInventory (5 items) — 5 justifiedIntent: let admin users on a stock Mac launch root-owned apps from
[FIRST-PRINCIPLES-REVIEWED] ddbe803 Description read[DESCRIPTION-READ] 758e3acc06c2a1a2dc330b40b0593589b904d4afbbda5ecc136737a4f32c3ae7 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ human override acceptedReviewed Human judgment by @bolichen97 overrides the Opus 5.5 finding for [OPUS-OVERRIDE] ddbe803 Verdict recorded from an authorized human decision for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
|
[operator: bolichen97]
|
|
[operator: bolichen97]
|
|
[operator: bolichen97] Both blocking findings on A maintainer who checks the reasoning and agrees can record it with these two commands, each as its own comment (they bind this head only): If you do not accept that equivalence, the exception for a stock Either way the PR still needs a design sign-off from a maintainer, and the Sensitive Change sign-off from a maintainer other than the author. |
109b4a7 to
09e3afb
Compare
|
[operator: bolichen97] Rebased: main moved in The two maintainer override commands drafted above name the old head |
|
[operator: bolichen97] The |
09e3afb to
f11b0fe
Compare
|
[operator: bolichen97] Rebased: main moved in The maintainer override request is no longer needed: the two commands drafted for |
|
[operator: bolichen97]
|
|
[operator: bolichen97] Correction to my earlier note: on If you do not accept that equivalence, the shape to take is the issue's second option (keep the refusal and say plainly that third-party apps cannot be launched on this machine). Say which you prefer and I will rework the PR. The red backend shard 2 on Linux, Windows and macOS is one test, The PR still needs a design sign-off from a maintainer and the Sensitive Change sign-off from a maintainer other than the author. |
computer_launch_app refused every third-party bundle under /Applications for an admin user, including root-owned ones installed from a pkg or the App Store. macOS ships /Applications as root:admin 0775, so the parent writability probe fired for every admin, which is the default account on a Mac. Only /System/Applications apps could be launched. When the parent is exactly /Applications with that owner, group (gid 80) and mode, the parent probe is skipped. The bundle, Contents and Contents/MacOS are then judged by ownership as well as mode, because a directory's owner can chmod it at will. A bundle this user owns is still refused. Any other parent, or a failed stat, keeps today's probes. The new tests live in test_computer_use_launch_macos_stock.py and inject the parent's stat. The existing bundle tests build a synthetic /Applications/Foo.app; on a Mac that parent is a real stock directory, so they pin the stock answer off and keep every assertion. The module docstrings and the computer-use spec describe the stock-parent rule. Closes #15036
f11b0fe to
ddbe803
Compare
|
[operator: bolichen97] Rebased: main moved in The new base carries #31469, the fix for |
|
[operator: bolichen97] The The other reds on this head (Opus, GPT, Design, First Principles, UX, Sensitive Change Review, Dependency License Gate, and the readiness signal) all failed reading the API under the shared token's rate limit before producing a verdict. Each failed lane job was re-run once; readiness re-evaluates as they finish. |
|
[operator: bolichen97]
|
|
/ai-review override fable ddbe803 false-positive: agent: posted at the operator's direction after they reviewed the rebuttal. Not a defect: adding or re-pointing an /Applications entry needs the agent's shell, which can already have LaunchServices start the same terminal or a bundle it wrote; the terminal list is documented as not a security boundary, so the code that can run outside the sandbox is unchanged. |
Human judgment recorded@bolichen97 recorded a false-positive release (class
This decision applies only to this commit. A new push requires a new judgment. |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on ddbe803, no conflict, no open change request.
computer_launch_app refused every third-party bundle under /Applications for an admin user, including root-owned ones installed from a pkg or the App Store. macOS ships /Applications as root:admin 0775, so the parent writability probe fired for every admin, which is the default account on a Mac. Only /System/Applications apps could be launched. When the parent is exactly /Applications with that owner, group (gid 80) and mode, the parent probe is skipped. The bundle, Contents and Contents/MacOS are then judged by ownership as well as mode, because a directory's owner can chmod it at will. A bundle this user owns is still refused. Any other parent, or a failed stat, keeps today's probes. The new tests live in test_computer_use_launch_macos_stock.py and inject the parent's stat. The existing bundle tests build a synthetic /Applications/Foo.app; on a Mac that parent is a real stock directory, so they pin the stock answer off and keep every assertion. The module docstrings and the computer-use spec describe the stock-parent rule. Closes #15036 (cherry picked from commit e4611c5) Original author: Bolin Chen (#31408).
Problem / Motivation
Goal: Root-owned apps under a stock
/Applicationslaunch throughcomputer_launch_appfor admin users, while apps this user owns stay refused.On a stock Mac,
computer_launch_apprefuses every third-party app under/Applicationsfor an admin user, root-owned ones from a.pkgor the App Store included: "'Keynote' is installed in a directory this user can write, so it was not launched". Only apps under/System/Applicationslaunch.Why it matters
A Mac's first account is an admin, so for most users the launch verb can open only Apple's bundled apps. Every root-owned app installed from a
.pkgor the App Store (Microsoft Office, Keynote, WeChat) is refused with a reason the user cannot act on.Not a goal
~/Applications.What changed (motivation → approach → change)
macOS ships
/Applicationsasroot:adminwith mode0775, so every admin user can create files in it. The launch check refuses a bundle whose parent this user can write, so it refused every bundle there.launch_macos.pynow recognises that one directory:/Applicationswith owner root, groupadmin(gid 80) and mode0775exactly. There it skips the parent probe and judges the bundle,ContentsandContents/MacOSby ownership as well as mode, the rule the executables already follow, because an owner canchmodtheir own directory at will.apple_speechalready trusts an Xcode bundle under/Applicationsby ownership in the same way. Any other parent, or a failedstat, keeps today's probes. The module docstrings and the macOS launch section ofcomputer-use.mddescribe the rule./Applications/ApplicationsThis narrows a security refusal, so it needs a design sign-off from a maintainer before it merges.
Backwards compatibility
Breaking: under a stock
/Applications, a bundle whose own directory this user owns is now refused even while that directory is read-only, as an executable this user owns already is. Only a non-admin user could launch such a bundle on main, since an admin was refused every bundle there. Writer sweep on origin/main @ aca93ab: the one writer of a bundle there is the desktop app's updater (website/electron/auto-update.js), which replaces only a bundle this user can write, so that bundle is refused on main and here alike.Reader: src/kiro_crew/computer_use/macos_driver.py:MacOSBackend.launch_app -- chat -- returns the same refusal text it already returns for a writable bundle; test_a_bundle_directory_this_user_OWNS_is_refused_though_read_only
Tests
test_computer_use_launch_macos_stock.py(new, injectedstat, runs on every platform): a root-owned bundle under a stock parent resolves; a bundle directory this user owns at mode0555is refused, at each of the three levels; a parent with mode0777, a non-admin group or a non-root owner keeps the parent probe.test_computer_use_launch.py:TestMacOSBundleVerificationpins_is_stock_applicationsoff. Its synthetic/Applications/Foo.apphas a real stock parent on a Mac, and without the pin three of its tests fail there. Every existing assertion is kept.TestMacOSBundleVerificationpassed 20 runs at-n0and 10 at-n 2 --dist loadgroup --max-worker-restart=2besidetest_computer_use_launch_windows_catalog.pyandtest_computer_use_unsupported.py; all 115 ids in both files ran green in a shuffled order (seed 24238): 108 passed, 7 skipped. The flake-pattern ratchet and the repo semgrep rules pass on the diff.Proof: PROVEN test/test_computer_use_launch_macos_stock.py::TestMacOSStockApplicationsParent::test_a_ROOT_OWNED_bundle_under_a_stock_parent_resolves (head ddbe803)
Manual verification
On a real Mac (macOS 26.7.2, build 25G332, Apple silicon),
ls -ld /Applicationsshowsdrwxrwxr-x root adminand the user is inadmin. Each app was not running.kirocrew computer call computer_launch_app app=<App>ran from a source checkout (kirocrew 0.13.0) with computer use enabled in an isolated data home:c9b3e26a82stat -f %Sm /Applicationswas the same before and after the branch run. That launch ran on an earlier revision of this commit, which differs from head only in comments and the position of one constant. On headddbe80354b18,resolve_target(the check the launch runs beforeopen -a) resolves Keynote and refuses Paintbrush, again with the/Applicationsmtime unchanged.Related Issues
Closes #15036
Builds on #20132 (honest refusal text) and #20367 (no mtime bump on a refused launch).
Sibling sweep
Swept: git grep -n "_directory_is_writable(" -- src/ and git grep -n "/Applications" -- src/
Sibling: src/kiro_crew/computer_use/launch_windows.py -- not affected -- Program Files denies creates to an unelevated admin token, so its root probe does not refuse every install there
Sibling: src/kiro_crew/apple_speech/init.py -- not affected -- already trusts an Xcode bundle under
/Applicationsby root ownership up to the bundle root, not by the parent's modeSibling: src/kiro_crew/dashboard_verify.py -- not affected -- its browser check runs on Linux only, because no browser under an admin-writable
/Applicationscan pass itPattern harvest
Not generalizable: the rule rests on one macOS install-location fact (a stock
/Applicationsis admin-writable), and the one other module that meets it,apple_speech, already judges ownership instead of the parent's mode, so there is no repeated code shape to turn into a rule.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.