Harden .linkedin-mcp profile/cookie permissions#283
Harden .linkedin-mcp profile/cookie permissions#283stickerdaniel merged 6 commits intostickerdaniel:mainfrom
Conversation
Greptile SummaryThis PR hardens the file-system permissions of LinkedIn session artifacts (browser profile directory, cookie files, storage-state snapshots) that were previously written with default umask-inherited permissions, making them world-readable on common setups. Key changes:
Confidence Score: 5/5Safe to merge — all prior review concerns are addressed and no new defects are introduced. The previous TOCTOU concern on No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "Merge branch 'main' into bug-279-secure-..." | Re-trigger Greptile |
a81b4d1 to
f7170d6
Compare
- Replace custom _secure_profile_dirs/_set_private_mode with thin _harden_linkedin_tree that uses secure_mkdir from common_utils - Fix export_storage_state: chmod 0o600 after Playwright writes - Add test for export_storage_state permission hardening - Add test for no-op outside .linkedin-mcp tree - Revert unrelated loaders.py change
Harden .linkedin-mcp profile/cookie permissions
Harden .linkedin-mcp profile/cookie permissions
Harden .linkedin-mcp profile/cookie permissions
Harden .linkedin-mcp profile/cookie permissions
…e-profile-perms Harden .linkedin-mcp profile/cookie permissions
What changed
linkedin_mcp_server/core/browser.py:_secure_profile_dirs(...)ensures profile directories are owner-only (0700)._set_private_mode(...)applies explicit POSIX modes for sensitive paths.BrowserManager.start()to use_secure_profile_dirs(...)instead of plainmkdir(...).BrowserManager.export_cookies(...)to:.linkedin-mcpare private,0600).tests/test_browser_security.pywith coverage for:.linkedin-mcp/profiledirectory permissions,Insight / Why this matters
mkdir/write_text), which inheritumask. On common setups (umask 022), this yields world-readable paths (0755directories,0644files).Practical gain / Why this matters
Why
Testing
pytest tests/test_browser_security.py -qscripts/clone_and_test.sh stickerdaniel/linkedin-mcp-server(157 passed)Fixes #279