Remove potential osascript hijacking attack (#2867)

Fixes
https://linear.app/zed-industries/issue/Z-2818/security-vulnerability-dylib-injection

Release Notes:

- Fixed a potential local code-injection if a user installs the Zed CLI
for the first time with a hijacked `osascript` in their path.
This commit is contained in:
Mikayla Maki 2023-08-18 18:00:39 -07:00 committed by GitHub
commit 15f91f38f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View file

@ -29,7 +29,7 @@ pub async fn install_cli(cx: &AsyncAppContext) -> Result<()> {
// The symlink could not be created, so use osascript with admin privileges
// to create it.
let status = smol::process::Command::new("osascript")
let status = smol::process::Command::new("/usr/bin/osascript")
.args([
"-e",
&format!(

View file

@ -18,11 +18,7 @@
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<!-- <key>com.apple.security.cs.disable-library-validation</key>
<true/> -->
</dict>
</plist>