AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Moderate 67 Bitcoin

Fix a batch of Tor-related issues (#3354)

Public commit record

What the developer wrote

Authored by Bastien Teinturier

98/100 · Strong
Fix a batch of Tor-related issues (#3354)

* Verify that Tor cookie is 32-bytes

In order to be valid, a Tor cookie must be exactly 32 bytes.
We verify that and fail otherwise.

* Use Tor safe-cookie mode by default

And fail if password mode is used but the host is remote.

* Fix race condition in file permissions

There was a race condition in file permissions that allowed attackers
on the machine to read secrets, because we started by creating the
secret and only after that we set the file permissions.

We now reverse that flow: we create an empty file with the right
permissions and then write the secret to it.

This applies to our seed files and to tor private keys.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit fixes three security issues in how Eclair connects to the Tor network and stores sensitive files. First, it changes the default Tor authentication from password to safecookie, and blocks password mode when the Tor control port is on a remote machine, because password mode sends secrets in cleartext and cannot prove the server is really Tor. Second, it checks that Tor's authentication cookie is exactly 32 bytes. Third, it fixes a race condition where secret files (seed files and Tor private keys) were created with loose permissions before being locked down, which could let other users on the same machine read them; now the file is created with strict permissions first, then the secret is written.

Recommended action

Users running Tor with Eclair should upgrade, switch to safecookie authentication, ensure the Tor control port is not exposed remotely, and verify that existing seed and tor.dat files have restrictive owner-only permissions. Operators should review Tor daemon configuration and firewall rules for the control port.

Security signals we found

01

Default authentication changed from password to safecookie

02

Password authentication rejected for remote Tor control ports

03

Tor cookie length validated to be exactly 32 bytes

04

File permission race condition fixed for seed and Tor private key files

05

Documentation updated to warn about remote Tor control port risks

Risk score

Why this scored 67/100

Our methodology →
Potential impact 22/30
Exploitability 14/25
Stealth signal 10/15
Affected reach 9/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.