Skip to content

Redoubt 2.3.1

Latest

Choose a tag to compare

@FreyFlyy FreyFlyy released this 01 Dec 18:42
· 4 commits to main since this release

Redoubt v2.3.1

!! SKIPPED TESTS (DOCUMENTATION) !!

Two live Tor integration tests in tests/test_tor_manager.py (test_real_tor_creates_exactly_the_address_derived_from_our_key and test_real_tor_dies_with_its_owner_and_stop_kills_the_process) were skipped in the CI runner environment because a live tor daemon/binary was not installed on the test runner. (will be corrected in v2.3.2)

Security

No known exploited vulnerability fixes. Hardening:

  • ~/.redoubt/redoubt.log and ~/.redoubt/settings.json are now created with mode 0600, and ~/.redoubt with 0700; existing files and the directory are tightened at startup. Before, they followed the default umask and could be readable by other local users (log metadata such as IP addresses and Tor events). Best effort on Windows.
  • zero_bytearray and SecureBuffer.zero() use ctypes.memset on the real buffer instead of a Python loop. Key material held in immutable bytes objects can still remain in memory until garbage collection; this is a Python limitation and is not changed.
  • install.sh can verify the AppImage checksum against the release SHA256SUMS. The checksum comes from the same GitHub release as the binary: it detects corruption or a tampered single asset, but not a compromise of the release itself. Signed releases are not provided.
  • Stricter packet field validation and the handshake-aware session cap reduce what a malformed or flooding peer can make Redoubt do before the handshake completes.

Improvements

Message delivery and data integrity

  • A message is now persisted before the irreversible steps. On send, store_message runs before the Double Ratchet advances and before the socket write; on receive, decrypt, then store, then commit() of the ratchet. If the database write fails, no ratchet step is consumed and no MESSAGE_ACK is sent, so the sender's retransmission can be decrypted and stored again.
  • pending_acks is registered before session.send() (and removed if the send fails). A fast MESSAGE_ACK can no longer leave an orphan entry that causes a redundant retransmission.
  • An outbox message larger than MAX_MESSAGE_BYTES is dropped before consuming a ratchet step (the UI already refuses such messages).
  • Outbox messages queued within the same second are now sent in insertion order (created_at has 1-second resolution; rowid breaks ties). get_history and get_last_message break same-millisecond ties the same way.
  • Every read now takes the same lock as writes. The SQLCipher connection is shared by the UI, network, watchdog and presence threads (check_same_thread=False); the lock is now an RLock.

Connection handling

  • Inbound connections whose handshake is still running now count towards the global session cap, so a burst of simultaneous connections can no longer all pass the pre-handshake check. _handle_inbound is split into _handle_inbound and _accept_inbound.
  • drop_contact calls shutdown() on the socket before closing it.
  • Parameters, variables and pending_acks keys that hold the contact id (fingerprint, or fingerprint + -onion) are renamed from contact_fingerprint to contact_id. No behaviour change. The database column and Storage parameters keep the old name (changing the column would need a schema migration).

Protocol validation

  • validate_packet now checks the exact decoded size of identity_pub (32 bytes), session_nonce (16), nonce (12), ciphertext (at least the 16-byte GCM tag) and dh (32). Malformed packets are rejected at the protocol layer instead of failing later in the handshake or decryption.
  • add_padding raises InvalidPacket if a packet exceeds the padding block, instead of silently producing a frame the peer would refuse. unb64 raises ValueError for non-ASCII input.

UI

  • Contact names are escaped in the contact list and in the chat log, so a name such as [admin] is shown literally instead of being parsed as Rich markup.

Installer

  • Installs the latest stable release (resolved at run time) instead of a hard-coded version. A specific version can be requested with REDOUBT_VERSION=X.Y.Z.
  • Icon and fonts are downloaded from the release tag, not from main. All downloads are HTTPS-only. The AppImage is downloaded to a temporary name and moved into place only after verification, so a failed download never replaces a working installation.
  • The AppImage is verified against the release SHA256SUMS when the release publishes it. A mismatch, a missing entry or a failure to fetch the file aborts the installation. If the release has no SHA256SUMS (404), the installer warns and continues, unless REDOUBT_REQUIRE_CHECKSUM=1 is set.

Configuration / testing

  • Added xfail_strict = true in pyproject.toml.
  • RELEASE_WORKFLOW.md updated.
  • Test suite fixes: Peer test helper retries with a fresh port when binding fails with EADDRINUSE; --version test compares against redoubt.__version__ instead of a hard-coded string; strict xfail test that documented the pending_acks race is now a regular test; removed fixed sleeps from storage and byte-rate-limit tests; test_disable_core_dumps now runs in a subprocess.

Bug Fixes

Migration

  • A wrong passphrase now raises WrongPassphraseError (both an InvalidTag and a ValueError). Before, the interactive loader reported it as a "System Error" because the text check on the error message never matched.
  • If some contacts, messages or pending messages cannot be decrypted during the database migration, their number is now logged and printed as a warning, with the path of the untouched original (redoubt.db.pre-migration-backup). Backups were already created before migration; skipped records were previously only logged.

Compatibility

Full backward compatibility with 2.3.0

  • No database schema change and no wire format change. Validation only enforces the sizes that Redoubt already uses for the fields listed above.
  • Existing installations: ~/.redoubt, redoubt.log and settings.json have their permissions restricted on the next start.
  • Installer: with install.sh, a release published without SHA256SUMS installs with a warning. Publishing SHA256SUMS with each release (already described in RELEASE_WORKFLOW.md, but missing from v2.3.0) enables the verification.