-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Title: Encrypt Google Drive token storage and lock down token file permissions
Type: security
Severity: high
Area: Google Drive integration / token persistence
Description:
Google Drive OAuth tokens are currently stored as plaintext JSON under data/google_drive_tokens.json. The current save path does not apply encryption or restrictive file permissions. On a shared machine or copied bundle/data directory, refresh tokens can be extracted and reused.
Evidence:
nmapui/google_drive.pywrites tokens with_save_json_file()and plainjson.dumps(...)nmapui/paths.pydefinesGOOGLE_DRIVE_TOKEN_FILE = BASE_DIR / "data" / "google_drive_tokens.json"- No
chmod(0600)or platform keychain integration is applied during token writes
Proposed Fix:
Move token persistence to an encrypted secret store. On macOS, prefer Keychain-backed storage. If file storage remains as fallback, encrypt the payload and explicitly apply owner-only permissions.
Implementation Notes:
- Introduce a storage abstraction so auth/status/upload code stops assuming plaintext JSON
- Support migration from the existing plaintext token file
- Add tests for permission setting and migration behavior
Related Issues:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels