Repository navigation
Fix Proton Bridge STARTTLS before authentication - #277
Conversation
huacnlee
left a comment
There was a problem hiding this comment.
Reviewed and approved; Security: PASS for the affected TLS and credential scope.
Retracting my premature approval: the required Published backend merge gate has no result for commit 415377a. Local validation passed; review will be finalized after the required check reports.
|
Fixed the Windows test failure in 112a24d. The STARTTLS matrix test shut down and dropped its TLS socket immediately after writing the synthetic credential, before the Python peer acknowledged receipt. This could abort the server-side TLS handshake on Windows (WinError 10053). The test now retains the socket until the peer reports its result and exits, and assertion failures identify the protocol/host/port/mode. Verification: all 14 GitHub checks now pass, including Native credentials (windows-2022). Local connection tests (18), cargo fmt --check, git diff --check, and full make validate also pass. Security verdict: PASS for this test-only change. The peer still requires the exact synthetic credential inside TLS for success, and all rejection cases retain their no-credentials assertions. |
Fixes #225.
The native backend treated the Proton Bridge preset's loopback
insecuresetting as a reason to skip encryption. Bridge sends its greeting in the clear but requires STARTTLS before authentication; its self-signed certificate needs a local trust exception, not a plaintext session.Separate transport selection from certificate verification. Loopback IMAP/SMTP uses STARTTLS, including the default Bridge ports and custom ports, except that 993/465 select implicit TLS. Remote services retain the existing standard STARTTLS-port/otherwise-implicit-TLS convention.
insecureonly relaxes certificate trust for the exact loopback allowlist, andlocalhostis dialed as 127.0.0.1. TLS handshake signatures are still verified, buffered plaintext is refused, and failed upgrades never fall back to plaintext authentication.Existing plaintext test peers explicitly opt into a fixture-only setting compiled only in unit-test or integration-credential-test builds. Normal builds have no plaintext transport variant.
Verification
A fresh independent agent re-reviewed the revised diff and approved it with scoped security verdict PASS. The initial review's three findings were addressed: custom loopback ports no longer authenticate in plaintext, remote nonstandard ports retain implicit TLS, and policy tests exercise the production host/port/trust selection path with only the socket destination substituted.
Controlled IMAP and SMTP peers cover default Bridge ports, custom ports, standard STARTTLS ports, implicit TLS, strict verification, mixed local IMAP/remote SMTP settings, refusal, malformed TLS, and buffered plaintext. The reviewer ran 18 connection tests, all 57 IMAP tests, and a normal-build
cargo check --locked --lib; all passed.The new
proton_custom_port_requires_starttls_before_credentialsregression was transplanted onto unmodified upstream3024f026b71b9b5041d2da46a198670257a5aaac, where it compiled and failed: the peer received a non-STARTTLS first command and never reported encrypted credentials. It passes with this fix and calls productionconnect()directly. Only synthetic localhost credentials were used for this regression.make validatepassed in this isolated branch's worktree with its own build directory: 607 Rust tests passed (11 ignored), all JavaScript and shell/Python suites passed, and the QML suites reported 980 + 6 + 64 passing tests with zero failures. QML lint, plugin manifest validation,cargo fmt --check, andgit diff --checkpassed. The separate ordering fix is not included in this branch. No live SMTP message was sent.Live Proton IMAP listing succeeded using the combined local build. A separate synthetic peer tested the installed normal release with
testPlaintext: true: it still received STARTTLS, and its refusal received no credentials, confirming that the test-only plaintext transport is unavailable in the shipped build configuration.Release Notes