Zero-click data loss vulnerability through environmental variable injection and insecure default scheduling.
Raw Developer Origin & Technical Request
GitHub Issue
Apr 16, 2026
### Summary
Three independent weaknesses compose into a zero-click data-loss chain:
1. `ScanEngine.scanBrewCache` spawns `brew --cache` with `Process()` without sanitising env. `brew` honours `HOMEBREW_CACHE` → attacker-controlled output flows into `brewCachePaths` → `removeItem`.
2. `CleaningEngine.isSafeToDelete` allow-lists `~/Downloads`, `~/Documents`, `~/Desktop` as whole-subtree deletable roots, so an attacker-chosen target like `\$HOME/Documents` passes.
3. `SchedulerService.init` loads `PureMac.ScheduleConfig` from UserDefaults before onboarding; `AppState.init` calls `scheduler.start()` unconditionally. A pre-written plist (`defaults write com.puremac.app …`) with `autoClean=true, nextRunDate=` triggers `cleanAll` within 60s of the next launch.
### Location
- `PureMac/Services/ScanEngine.swift` 279-338
- `PureMac/Services/CleaningEngine.swift` 111-139
- `PureMac/Services/SchedulerService.swift` 13-21
- `PureMac/ViewModels/AppState.swift` 71-79
### Evidence (runtime, macOS 26.4)
```
export HOMEBREW_CACHE=\$HOME/Documents
\$ /opt/homebrew/bin/brew --cache
/Users/victim/Documents ← attacker wins
# + pre-seeded ScheduleConfig.autoClean=true, nextRunDate=-1s
# → scheduler ticks in ≤60s → scanBrewCache emits CleanableItem path=\$HOME/Documents
# → isSafeToDelete(\$HOME/Documents) passes (Documents in allow-list)
# → removeItem wipes \$HOME/Documents
```
Full lab transcript: all three prereqs (`launchctl setenv`, `defaults write `, direct plist wr...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from momenbasel/PureMac.
Frequently Asked Questions
Market intelligence mapped to Zero-click data loss vulnerability through environmental variable injection and insecure default scheduling..
What problem does Zero-click data loss vulnerability through environmental variable injection and insecure default scheduling. solve?
What architecture is tied to Zero-click data loss vulnerability through environmental variable injection and insecure default scheduling.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like onboarding and removeItem by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics