Skip to content

Commit 3c236de

Browse files
committed
fix(sandbox): make ~/.gitconfig read-only in the macOS sandbox
Remove ~/.gitconfig from the file-write* allow list in all six macOS Seatbelt profiles so the sandboxed process can no longer modify the user's global git config (git config can drive command execution via aliases, core.pager, core.hooksPath, etc.). Read access is unchanged, so normal git operations are unaffected.
1 parent ae0a3aa commit 3c236de

6 files changed

Lines changed: 0 additions & 6 deletions

packages/cli/src/utils/sandbox-macos-permissive-open.sb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
(subpath (string-append (param "HOME_DIR") "/.gemini"))
1313
(subpath (string-append (param "HOME_DIR") "/.npm"))
1414
(subpath (string-append (param "HOME_DIR") "/.cache"))
15-
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
1615
;; Allow writes to included directories from --include-directories
1716
(subpath (param "INCLUDE_DIR_0"))
1817
(subpath (param "INCLUDE_DIR_1"))

packages/cli/src/utils/sandbox-macos-permissive-proxied.sb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
(subpath (string-append (param "HOME_DIR") "/.gemini"))
1313
(subpath (string-append (param "HOME_DIR") "/.npm"))
1414
(subpath (string-append (param "HOME_DIR") "/.cache"))
15-
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
1615
;; Allow writes to included directories from --include-directories
1716
(subpath (param "INCLUDE_DIR_0"))
1817
(subpath (param "INCLUDE_DIR_1"))

packages/cli/src/utils/sandbox-macos-restrictive-open.sb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
(subpath (string-append (param "HOME_DIR") "/.gemini"))
7171
(subpath (string-append (param "HOME_DIR") "/.npm"))
7272
(subpath (string-append (param "HOME_DIR") "/.cache"))
73-
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
7473
;; Allow writes to included directories from --include-directories
7574
(subpath (param "INCLUDE_DIR_0"))
7675
(subpath (param "INCLUDE_DIR_1"))

packages/cli/src/utils/sandbox-macos-restrictive-proxied.sb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
(subpath (string-append (param "HOME_DIR") "/.gemini"))
7171
(subpath (string-append (param "HOME_DIR") "/.npm"))
7272
(subpath (string-append (param "HOME_DIR") "/.cache"))
73-
(subpath (string-append (param "HOME_DIR") "/.gitconfig"))
7473
;; Allow writes to included directories from --include-directories
7574
(subpath (param "INCLUDE_DIR_0"))
7675
(subpath (param "INCLUDE_DIR_1"))

packages/cli/src/utils/sandbox-macos-strict-open.sb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
(subpath (string-append (param "HOME_DIR") "/.gemini"))
106106
(subpath (string-append (param "HOME_DIR") "/.npm"))
107107
(subpath (string-append (param "HOME_DIR") "/.cache"))
108-
(literal (string-append (param "HOME_DIR") "/.gitconfig"))
109108
;; Allow writes to included directories from --include-directories
110109
(subpath (param "INCLUDE_DIR_0"))
111110
(subpath (param "INCLUDE_DIR_1"))

packages/cli/src/utils/sandbox-macos-strict-proxied.sb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
(subpath (string-append (param "HOME_DIR") "/.gemini"))
106106
(subpath (string-append (param "HOME_DIR") "/.npm"))
107107
(subpath (string-append (param "HOME_DIR") "/.cache"))
108-
(literal (string-append (param "HOME_DIR") "/.gitconfig"))
109108
;; Allow writes to included directories from --include-directories
110109
(subpath (param "INCLUDE_DIR_0"))
111110
(subpath (param "INCLUDE_DIR_1"))

0 commit comments

Comments
 (0)