Security: Auth token stored in world-readable plaintext config file #4

Closed
opened 2026-05-09 05:18:40 +00:00 by Mark · 1 comment
Owner

Severity: Medium

The ConfigManager writes the API token to ~/.vikunja-cli-config.json (or --config path) in plaintext without restricting file permissions.

File: vikunja_cli/config/config_manager.py / vikunjatool/utils/config.py, method save_config()

def save_config(self) -> None:
    os.makedirs(os.path.dirname(str(self.config_path)), exist_ok=True)
    with open(self.config_path, 'w') as f:
        json.dump(self.config, f, indent=2)

Impact:

  • Any process or user with read access to the home directory can read the token
  • Default umask often results in 644 permissions, making it readable by other users on multi-user systems

Fix: Set restrictive file permissions (e.g., os.chmod(self.config_path, 0o600)) after writing, or use a keyring / encrypted storage. Consider also masking the config path display to avoid leaking the location in command output.

**Severity: Medium** The ConfigManager writes the API token to `~/.vikunja-cli-config.json` (or `--config` path) in plaintext without restricting file permissions. **File:** `vikunja_cli/config/config_manager.py` / `vikunjatool/utils/config.py`, method `save_config()` ```python def save_config(self) -> None: os.makedirs(os.path.dirname(str(self.config_path)), exist_ok=True) with open(self.config_path, 'w') as f: json.dump(self.config, f, indent=2) ``` **Impact:** - Any process or user with read access to the home directory can read the token - Default umask often results in 644 permissions, making it readable by other users on multi-user systems **Fix:** Set restrictive file permissions (e.g., `os.chmod(self.config_path, 0o600)`) after writing, or use a keyring / encrypted storage. Consider also masking the config path display to avoid leaking the location in command output.
Author
Owner

Fixed in commit. Closing.

Fixed in commit. Closing.
Mark closed this issue 2026-05-13 15:56:06 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/vikunja-cli#4
No description provided.