From 06342de24f910f55cd9ae3326f9805cd3f9e9e79 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Fri, 16 Jan 2026 09:54:36 +0800 Subject: [PATCH] security: restrict BOM whitelist to prevent shared component deletion - Removes shared directories (Frameworks, Plugins, etc) from receipt scanning whitelist - Ensures that uninstalling an app won't accidentally delete shared system libraries - Updates SECURITY_AUDIT.md to reflect stricter receipt scanning policy --- SECURITY_AUDIT.md | 2 +- lib/core/app_protection.sh | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/SECURITY_AUDIT.md b/SECURITY_AUDIT.md index 7bec259..67c3971 100644 --- a/SECURITY_AUDIT.md +++ b/SECURITY_AUDIT.md @@ -166,7 +166,7 @@ For user-selected app removal: - **Safety Limit:** 3-char minimum (prevents "Go" matching "Google") - **Disabled:** Fuzzy matching and wildcard expansion for short names. - **User Confirmation:** Required before deletion. -- **Receipt Scans:** BOM-derived files are limited to safe system prefixes and filtered by `should_protect_path()`. +- **Receipt Scans:** BOM-derived files are restricted to app-specific prefixes (e.g., `/Applications`, `/Library/Application Support`). Shared directories like `/Library/Frameworks` are **excluded** to prevent collateral damage. **Code:** `lib/clean/apps.sh:uninstall_app()` diff --git a/lib/core/app_protection.sh b/lib/core/app_protection.sh index 98b753a..90bfdb9 100755 --- a/lib/core/app_protection.sh +++ b/lib/core/app_protection.sh @@ -950,13 +950,6 @@ find_app_receipt_files() { /Library/LaunchAgents/*) is_safe=true ;; /Library/LaunchDaemons/*) is_safe=true ;; /Library/PrivilegedHelperTools/*) is_safe=true ;; - /Library/Internet\ Plug-Ins/*) is_safe=true ;; - /Library/Audio/Plug-Ins/*) is_safe=true ;; - /Library/Frameworks/*) is_safe=true ;; - /Library/Input\ Methods/*) is_safe=true ;; - /Library/QuickLook/*) is_safe=true ;; - /Library/PreferencePanes/*) is_safe=true ;; - /Library/Screen\ Savers/*) is_safe=true ;; /Library/Extensions/*) is_safe=false ;; *) is_safe=false ;; esac