Security fixes for 2026.11.17 #414

Merged
jcoffey-dev merged 6 commits from sec/batch-5-2026 into release/2026 2026-11-17 17:01:01 +00:00
Owner

The 6 fixes from #413, cherry-picked onto release/2026. With the version PR after it, this becomes the 2026.11.17 security release.

All six applied without changes. Tests: fmt, fork checks, build, unit tests, and the imap, webdav, jmap, system, tenant, directory and automation suites pass locally.

smtp also passes: smtp_delivery (a timed DSN count) failed under build load, then passed 12 of 12 alternating with unchanged release/2026 (also 12 of 12). The version PR for 2026.11.17 follows.

The 6 fixes from #413, cherry-picked onto release/2026. With the version PR after it, this becomes the 2026.11.17 security release. All six applied without changes. Tests: fmt, fork checks, build, unit tests, and the imap, webdav, jmap, system, tenant, directory and automation suites pass locally. smtp also passes: smtp_delivery (a timed DSN count) failed under build load, then passed 12 of 12 alternating with unchanged release/2026 (also 12 of 12). The version PR for 2026.11.17 follows.
jcoffey-dev added 6 commits 2026-11-17 16:50:40 +00:00
rustls-webpki 0.103.15, webpki-roots 1.0.9 and webpki-root-certs 1.0.9
accept certificate paths through emSign intermediates whose private keys
are now public (RUSTSEC-2026-0381, -0382, -0383; CVE-2026-111943). That
reaches every outbound TLS connection that uses the bundled roots.

They are now 0.103.17, 1.0.12 and 1.0.12. Only these three crates move
in Cargo.lock.

Reported privately in a security review.

(cherry picked from commit 836af7a18621d27e02f6c14b404706e73c09b6fd)
With forwarding headers trusted, the client address came from RFC 7239
Forwarded, or X-Forwarded-For when there was none. nginx, Caddy and
Traefik write only X-Forwarded-For and pass a client's own Forwarded
header through unchanged, so a client behind them could name its own
address. That address drives rate limits, bans, IP rules and the audit
log, and a loopback address skipped endpoint restrictions, the contact
form's rate limit and the migration run token's loopback check.

Only one header is read now: X-Forwarded-For, or Forwarded with
INBUXA_HTTP_FORWARDED_HEADER=forwarded. A loopback address in a header
is the loopback of whoever wrote it, so it stands for this host only
when every hop after it is loopback too; otherwise the hop that wrote
it is the client. That also stops a client on a trusted private network
from claiming loopback through X-Forwarded-For.

Test: client_ip's new tests fail on the old chain logic and pass now.

Reported privately in a security review.

(cherry picked from commit a51d9670ded618568d60723fee85cf3e84324be5)
System Sieve scripts run with the trusted functions, whose exec starts
any program as the server's user. The tenant ceiling hard-denied
impersonation, legal holds and the deliverability lists, but not
sysSieveSystemScriptCreate, Update or Destroy, so a server
administrator's Merge or Replace policy on a tenant could hand them to
the tenant's administrators. Tenant roles don't include them by default,
and a tenant administrator can't grant them alone.

The ceiling now refuses all three inside a tenant, whatever the policy
(multi-tenancy spec, MT-15).

Test: the tenant suite gives a tenant user all three through both a
Merge and a Replace tenant policy. On main the user holds
sysSieveSystemScriptCreate; now none of the three.

Reported privately in a security review.

(cherry picked from commit bc4e01a2f4774dfe0d91b8d3e0ff67fb0bfc9e25)
A superuser-class blob id names a blob by its hash alone, and
fetchAnyBlob, in the default tenant administrator role, downloaded any
such blob. The check never looked at the tenant, so a tenant
administrator who learned a hash could download that blob from another
tenant's mail.

Inside a tenant, fetchAnyBlob now reaches a blob only when the tenant
holds it: an account of the tenant links it, or it is a queued message
the tenant sees (MT-5). Server-level administrators reach any blob as
before. The permission stays in the tenant role, since queue downloads
use it, and roles already stored need no change. Store::blob_holders
lists what links a hash.

Test: in the tenant suite a tenant administrator downloads, by hash, a
blob of a user outside the tenant: 200 on main, 404 now. The tenant's
own blobs and its queued messages still download, and another tenant's
administrator can't fetch that queued message. With the queue check
turned off, the queued download fails, so the test covers that path.

Reported privately in a security review.

(cherry picked from commit 06856dc98883605ec7456219dc4e536da18b5ef8)
/jmap/download takes the Content-Type from its accept parameter. A value
that isn't a valid header value, such as one with an encoded CR/LF,
failed the response builder, and HttpResponse::build unwrapped the error
and panicked, ending that connection. A signed-in user with a blob to
download could do it; the server kept running.

The accept value is used only when it is a valid header value, and
otherwise the download is application/octet-stream. build() answers 500
instead of panicking when any header is invalid.

Test: in the tenant suite, accept=text/plain%0D%0AX-Evil:1 panicked at
response.rs on main; now it downloads as application/octet-stream with
no injected header.

Reported privately in a security review.

(cherry picked from commit d95025bee63e759945063a2e0e36fa07e6a2c106)
OAuth: unregistered clients need PKCE and a native-app redirect
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 7m45s
44afac318c
With requireClientRegistration off (it's on by default), the
authorization endpoint accepted any client id with any redirect URI and
no PKCE. A made-up client could send people to a sign-in page that
returned their authorization code to any web site.

A client nobody registered now has to send an S256 code_challenge, as
stateless clients already do, and may only redirect to a loopback
address or a private-use scheme (RFC 8252), where a web site can't
listen. Desktop and mobile mail apps keep working; a web application
has to be registered. Registered clients are unchanged.

Test: in the system suite, with registration not required, an
unregistered client got a code without PKCE on main. Now it needs PKCE
and a loopback or private-use redirect; an https redirect is refused.

Reported privately in a security review.
jcoffey-dev merged commit 2c432fe074 into release/2026 2026-11-17 17:01:01 +00:00
jcoffey-dev deleted branch sec/batch-5-2026 2026-11-17 17:01:01 +00:00
jcoffey-dev referenced this issue from a commit 2026-11-17 17:02:41 +00:00
Sign in to join this conversation.