Skip to content

Security: wiarch/wi-dot

Security

docs/SECURITY.md

WI Dot — Security and Privacy

Security objectives

WI Dot handles configuration files that may contain sensitive personal and development information. Its security model must prioritize local encryption, minimal metadata collection, safe filesystem operations and explicit user approval for system changes.

Current cryptographic model

The CLI encrypts file contents before upload. The server validates and stores encrypted payloads but does not possess the passphrase required to decrypt them.

Current payload format:

  • AES-256-GCM.
  • PBKDF2-SHA256.
  • 600,000 PBKDF2 iterations.
  • 16-byte random salt.
  • 12-byte random IV.
  • 16-byte GCM authentication tag.
  • SHA-256 payload hash over salt, IV, ciphertext and tag.

Do not change these parameters or payload structure without a coordinated, versioned migration and cross-language tests.

Metadata exposure

The server still receives or can infer original paths and filenames, environment identifiers and sync tokens, plaintext SHA-256 hashes used for change detection, ciphertext size, upload timing and update frequency, and account/API activity metadata.

A content hash can reveal whether a known file content is present. Paths and filenames can reveal installed applications or aspects of a user's environment. Do not claim that all metadata is hidden.

Critical risks requiring remediation

1. Restore path trust

The current CLI pull flow expands the remote original_path and writes to the resulting local path. It does not yet enforce an approved root or reject traversal and arbitrary absolute paths. A malicious or compromised server response could cause writes outside the intended directory.

Required: canonicalize and validate every remote path, enforce a configurable safe root, reject traversal, and verify parent directories without following symlinks.

2. Symlink traversal during collection

The recursive collector uses filesystem metadata operations that follow symlinks. A symlink to another directory can cause collection outside the selected tree or recursive loops.

Required: use lstat, skip symlinks by default, and add tests for symlinked files, directories and cycles.

3. Unbounded payloads and file collection

The upload request validates encrypted payload fields but does not establish a comprehensive decoded ciphertext/file-size limit. Recursive collection also lacks a mature file-count and size policy.

Required: define request body limits, ciphertext limits, maximum file size/count, timeouts and safe failure behavior.

4. Local passphrase storage

The CLI stores the passphrase in ~/.config/widot/config.json. The application applies mode 0600 to the file and 0700 to its directory, but the passphrase remains plaintext at rest for users or processes that can read that file.

Required: evaluate Linux Secret Service/KWallet and other platform credential stores. Keep explicit warnings until keychain integration exists.

5. Dashboard mock data

The React dashboard currently uses static mock data and must not imply that its displayed files or environment inventory are live encrypted account data.

Environment recovery-specific controls

  • Inventory must be read-only and must not invoke privileged commands.
  • Exclude SSH private keys, tokens, browser credential stores, password databases and cloud credentials by default.
  • Sensitive-path inclusion requires explicit opt-in and a clear warning.
  • Package installation plans must be displayed before execution.
  • Never run downloaded scripts automatically.
  • Never invoke sudo or modify system repositories, services, drivers or system paths without explicit approval.
  • Validate package names and commands generated by adapters; do not interpolate untrusted remote strings into shell commands.
  • Prefer argument arrays and process APIs over shell string concatenation.
  • Show the exact commands and expected effects before approval.
  • Keep restore logs free of secrets and configuration contents.

Required controls

  • Never transmit passphrases or plaintext file contents to the API.
  • Never log tokens, passphrases or file contents.
  • Enforce authenticated ownership checks for every environment and dotfile.
  • Verify the GCM authentication tag before writing plaintext.
  • Validate payload version, algorithm, KDF and iteration count.
  • Use HTTPS for all production API communication.
  • Use restrictive local permissions and atomic writes.
  • Never follow symlinks by default during recursive collection.
  • Never restore remote paths without canonicalization and confinement.
  • Back up local files before restore until conflict and rollback controls are complete.
  • Keep dependencies and generated files out of version control.

Reporting

Do not publish exploitable vulnerabilities, tokens, passphrases or real dotfile contents in public issues. Use a private security reporting channel available to repository maintainers.

There aren't any published security advisories