Skip to content

fix: harden lsof, denylist, and crontab gating - #8

Merged
s1korrrr merged 1 commit into
mainfrom
feat/andrzej_security_hardening_public
Aug 4, 2026
Merged

fix: harden lsof, denylist, and crontab gating#8
s1korrrr merged 1 commit into
mainfrom
feat/andrzej_security_hardening_public

Conversation

@s1korrrr

@s1korrrr s1korrrr commented Aug 4, 2026

Copy link
Copy Markdown
Member

Outcome

Closes residual audit hardenings: NUL-terminated lsof CWD parsing (newline field injection), tighter session-critical process denylist with CoreServices/libexec path prefixes, and crontab mutation capability gating on verified write/readback aligned with SECURITY_STATUS.

Related issue

Follow-up to the end-to-end audit that shipped tree-kill / path-auth in #7.

Change type

  • Bug fix
  • Feature
  • Documentation
  • CI, packaging, or maintenance
  • Security or privacy hardening

Risk and boundaries

  • Process TERM/KILL denylist is intentionally tighter (Finder/Dock/session agents + /System/Library/CoreServices/ + /usr/libexec/); developer tools under Homebrew//opt remain killable.
  • Crontab edit/enable/remove stay hidden until an idempotent write/readback probe succeeds; export/start/stop remain available.
  • lsof now uses -F pcn0; CWD paths with embedded newlines parse safely.

Breaking-change impact

None for app users. AutomationCapabilityContext gains mutableSourceVerified (default true).

Verification

  • Added or updated focused tests for behavior changes
  • ./script/check_open_source_readiness.sh
  • swift test -Xswiftc -warnings-as-errors (679 tests, 0 failures)
  • swift build -c release -Xswiftc -warnings-as-errors
  • bash -n script/*.sh
  • ./script/build_and_run.sh --verify
  • Sandbox release bundle validate
  • Local gitleaks scan (no leaks)
  • Public docs and changelog updated when guarantees changed
  • No secrets, private paths, unredacted logs, generated bundles, or unrelated changes included

Evidence

  • Focused: NUL lsof newline paths, session-critical denylist, crontab mutableSourceVerified gating, mutation probe unit tests
  • Full suite: 679 passed with warnings-as-errors
  • Bundles: build_and_run.sh --verify OK; sandbox validate_release_bundle.sh OK

Test plan

  • Confirm CI Release Gates green
  • With crontab present: inventory refresh should keep mutation caps when probe succeeds
  • Simulate crontab install failure: mutation caps drop; export/start/stop remain
  • Confirm Finder/Dock/UserEventAgent cannot be terminated from UI

Parse lsof CWD fields with NUL terminators to block newline injection,
expand session-critical process protection with path prefixes, and gate
crontab mutation on verified write/readback to match SECURITY_STATUS.
@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@s1korrrr
s1korrrr merged commit 07b7986 into main Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant