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

Reject API access from browsers (#3380)

Public commit record

What the developer wrote

Authored by pm47

81/100 · Strong
Reject API access from browsers (#3380)

Any request carrying an `Origin` header is now rejected with 403 before the inner route runs: browsers set it on every cross-site request and every non-GET/HEAD request, while `curl` and `eclair-cli` never do. Checking presence rather than value also covers `Origin: null` and DNS rebinding.

This is a defence against browser CSRF, not an authentication mechanism — `Origin` is trivially omitted by a non-browser client, and the API should still never be exposed beyond loopback.

Breaking change: the API can no longer be called from a web browser, even same-origin; anyone serving a web front-end against it now needs their own back-end in front.

Fixes project-loupe/audit-eclair#223, and by construction any other CSRF report against an individual endpoint.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit closes a cross-site request forgery (CSRF) hole in Eclair's admin API. Before the change, a malicious web page visited by a node operator could silently submit authenticated API requests (for example, to send funds or close Lightning channels) because browsers reuse cached HTTP basic-auth credentials. The patch now rejects any API request that carries an Origin header, which browsers set automatically while command-line tools do not. It also removes CORS headers that wrongly advertised cross-origin access. This is a hardening/breaking-change fix, not a full authentication replacement, and the API should still only be reachable on the local machine.

Recommended action

Deploy this commit promptly if the node exposes the API to any network reachable by a browser. Continue to keep the API bound to loopback and protected by firewall rules, because the Origin header can be trivially omitted by non-browser attackers. Review any custom web front-ends: they now need a separate back-end proxy in front of Eclair. Monitor logs for the new warning messages about rejected Origin requests.

Security signals we found

01

New origin-check directive rejecting all requests with an Origin header

02

Removal of CORS response headers from API responses

03

CSRF protection described in commit message and release notes

04

Tests verify 403 for browser-origin, null origin, and WebSocket requests

05

Basic-auth credentials still cached by browsers are the underlying threat vector

Risk score

Why this scored 79/100

Our methodology →
Potential impact 25/30
Exploitability 18/25
Stealth signal 10/15
Affected reach 12/15
Confidence 9/10
Evidence quality 5/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.