`User.authenticate_bot` searched with a missing or empty token, so a key
holding only a bot's id matched that bot if its `bot_token` was `NULL`,
and a key with an empty token segment matched a `bot_token` of `""`.
Return `nil` when the token is blank.
Thruster 0.1.24 and 0.1.27 fix two published advisories in its HTTP cache:
GHSA-m592-hhcw-jh6f, "cache-key collisions allow cross-request response
substitution", and GHSA-g74j-pv38-jj8g, "HTTP cache ignores later Vary
field lines and repeated request header values". Campfire's public
responses go through that cache: avatars, the account logo, files and
assets.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Puma 8.0.2 was affected by security advisories in its reactor timeouts,
TLS write timeouts, graceful shutdown, bind URL parsing and `pumactl`.
Upgrade to 8.0.3, which fixes them.
ref: https://github.com/puma/puma/releases/tag/v8.0.3
The tag check ignored a failed `git ls-remote` and continued as if the
tag did not exist, and it asked `origin`, which can differ from the
repository `gh` releases to.
Look the tag up with `gh api`, abort when that call fails, and accept
only a version of dot-separated numbers.
A 1.5.x release still moves `latest` on both registries. That is
harmless until 1.6 ships, so it is left for then.
The image build used the working tree as its context, so untracked files
such as `.ruby-lsp/` shipped in the registry.once.com image.
Extract `git archive` of `HEAD` once and build both the image and the
source ZIP from it. Say in the uncommitted-changes prompt that those
changes are not released.
The export image copied the working tree, so untracked files such as
`.ruby-lsp/` landed in the published ZIP.
Build it from `git archive` of `HEAD`, extracted to a directory so that
`.dockerignore` still applies.
`bin/release` let `gh release create` make the tag, and `gh` makes a
new tag at the head of the default branch. Running it on `release-1.5`
tagged `main` as v1.5.7, so the GitHub release and the GHCR images
shipped `main`.
Pass `HEAD` as `--target`, and abort when the tag already exists on
origin at a different commit.
* Upgrade Rails to 8b06b0eb
Rails at 8b06b0eb includes today's security release, rails/rails@6782df4a.
* Update addressable to 2.9.2
addressable 2.9.0 had a ReDoS in URI templates with several exploded variables, which failed the gem audit.
ref: https://github.com/sporkmonger/addressable/security/advisories/GHSA-4w5q-wg7v-w6gp
* Update rack to 3.2.8
rack 3.2.7 had four advisories, including a multipart parser memory exhaustion, which failed the gem audit.
ref: https://github.com/rack/rack/security/advisories/GHSA-5v64-555j-wjxm
* Ignore resque-web advisories in the gem audit
Four resque 2.7 advisories are in resque-web, which Campfire doesn't mount. They are fixed only in resque 3.
* Document the Forwarded header check for proxied installs
Rails now refuses a request whose Forwarded and X-Forwarded-For headers name different clients. Behind a proxy that adds Forwarded from a public address, that breaks every signed-in page. Say how to avoid it.
* Drop the Forwarded header note from the self-hosting guide
Thruster deletes a client's Forwarded header before proxying, so the header conflict the note described can't reach Campfire in the documented container.
This reverts commit 81ed465095.
* Upgrade runtime to Ruby 4.0.9
Ruby 4.0.9 fixes the Regexp compilation bug behind GitLab's
CVE-2026-110264. Move `.ruby-version`, `Dockerfile` and
`Dockerfile-export` to it.
ref: https://www.ruby-lang.org/en/news/2026/10/23/ruby-4-0-9-released/
* Bump setup-ruby to v1.334.0 for Ruby 4.0.9
The pinned v1.327.0 and v1.324.0 did not know Ruby 4.0.9, so every CI
job failed at Ruby setup. v1.334.0 is the first release that does.
ruby:4.0.7-slim already ships ca-certificates 20250419+deb13u1, which removes
emSign ECC Root CA - G3 and AAA Certificate Services. Fail the build if either
root comes back in the store Ruby's OpenSSL loads.
Every page parsed the importmap and joined each of its URLs against the
request's base URL, about a millisecond of CPU a page, though the answer
changes only with the importmap and the host. Keep the last answer, keyed
by both. One entry, so a request with a made-up Host header can't grow it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Check a cable connection's session while it's open
Signing out or changing the password ends sessions and then disconnects
their connections. A connection that found its session just before isn't
subscribed to its disconnects yet, so it missed that and stayed open.
Each connection now looks its session up every minute while it's open, and
closes once the session is gone, asking the browser to reconnect so one
holding a current session comes back. That also covers any other way a
connection misses the disconnect, such as a subscription that takes long to
register, and a lookup that fails is simply tried again.
* Check the session on the server's heartbeat rather than a timer of its own
A connection's own timer could outlive it: closing can run before opening finishes, or a channel's teardown can fail before the connection's. The heartbeat only reaches connections that are open, so nothing is left to stop.
* Skip the session check on a rejected connection
A rejected connection stays registered until its socket closes, and has no session to check, so its heartbeat mustn't fail and stop the heartbeat reaching the connections after it.
If the password changes again between this browser's change and its new session, that session is refused, and the browser is sent to sign in instead of an error.
A password change ends every session, but a sign-in or sign-in link checked
against the old password just before the change could still save its session
just after, and that session outlived the change.
The session now checks, as it's saved, that the user's password is still the
one the request loaded. The save's transaction holds SQLite's write lock from
the start, so a change commits either before the check, which fails it, or
after the insert, and ends this session with the others. Sessions start
through the user's association so the check sees the user that was
authenticated, and a refused sign-in is answered like a wrong password.
The profile asked for the current password when the request's password
field was filled in. The check now follows the save itself: the model
checks the challenge whenever the password digest is about to change,
and the profile always hands it the challenge. Editing a name, avatar
or email without a new password still needs none, and scripts that
reset a password, which set no challenge, are unaffected.
Only a string counts as a challenge, and the rate limit counts every
non-empty one, so what's limited is exactly what gets checked.
The lookup under the write lock repeated the one made before
validation, so the query cache could answer it with that earlier miss
even after another connection had registered the endpoint. It runs
uncached now.
Enabling notifications unsubscribed the browser on any refusal, so a
session signed out between authenticating and saving lost the browser's
subscription too, and the next session had nothing to post. Only a
refused endpoint unsubscribes it now.
Only room pages posted the subscription again, so a browser that
changed its password and closed the profile page went without
notifications until it next opened a room. A small controller in the
layout does it now, still once per session, and the bell is back to how
it was.
Two tabs posting at once after a password change could both miss the
row and insert two, so the endpoint is looked up again under the same
write lock as the session check.
The browser is shared across system tests, and a script added to every
new document stays until it's removed, so later tests would have seen
the granted permission and the fake subscription too.
A push subscription belongs to the user, not a session, so a device
signed out by a password change kept getting notifications. Changing
the password now removes every subscription along with the sessions,
in the same transaction.
A browser still signed in keeps its own subscription in its service
worker, so the notifications controller posts it once per session: the
bell names the session by a digest of its id, never its token, and the
browser remembers the last one it posted for. That post never
unsubscribes the browser when the server refuses it.
A request that authenticated just before the change could put a
subscription back after it. The create action now checks the session
still exists and saves in one immediate transaction, after validating
the endpoint outside it.
Changing the password now ends every other session, so whoever holds
one could shut the owner out of their own account with a new password.
The profile asks for the current password whenever the password
changes; without it, or with a wrong one, nothing is saved and the page
says why. Other profile edits don't need it, and the admin
reset-password script still works without it.
Attempts are rate limited like signing in, 10 in 3 minutes per address,
so the current password can't be guessed here instead.
A transfer link signed only the user id, so one copied before the
password changed still started a session for up to four hours after.
Bind it to the password salt with generates_token_for, so a new
password ends those links too. Links made before this upgrade stop
working; they last four hours at most.
An after_commit condition reads the record's last save, so another save
of the user in the same transaction skipped the disconnect even though
the sessions were gone. The callback that deletes them now registers
the disconnect on the transaction itself, which also leaves a rolled
back change alone. A password changed along with the avatar is covered
too: the attachment's touch doesn't hide the change.
Keeping the session the password was changed from also kept any copy of
its cookie working, and a copied cookie is one of the ways someone else
gets into an account. Every session ends now, and the profile page
signs the browser that changed the password back in with a new one.
The sessions end wherever the password changes, but only the profile
page closed the live connections, so a change from a console left a
signed-out device receiving messages until it dropped. Close them after
commit from User, logging rather than failing if the realtime service
can't be reached, since the password is saved by then.
Changing the password is how someone shuts out whoever else is signed
in to their account, but every session opened with the old password
stayed valid. Now the others end and their live connections close, as
on sign-out. The session the password was changed from stays signed in.
Changing the password outside a request, as from a console, ends every
session.
An asset host's path can contain the asset directory too, as in
https://cdn.example.com/assets, and cutting each URL at the first one would
allow everything the host serves under it. Cut at the last one instead.
Behind a proxy that terminates TLS without X-Forwarded-Proto, Rails sees
http while the page is https, and an http source on a non-default port
doesn't match. A source without a scheme takes the page's own.
Uploads are served from this origin too, so script-src 'self' would run one
that a cache still holds under a script type from before the upload guard.
Application pages now allow each importmap URL up to its asset directory
(relative root and asset host included), the inline importmap by hash, and
the service worker by worker-src.
With DISABLE_CONTENT_SECURITY_POLICY=true there's no application policy,
and the hash callback started an empty one, so pages sent an empty
Content-Security-Policy header. Skip the callback then.
A request for several byte ranges gets a 206 multipart/byteranges whose
boundary the client needs to split the body. Rewriting it to
octet-stream lost the boundary. No browser runs that type as a script,
so it passes through.
Disk URLs are cached for an hour, but blob proxy URLs are cached
publicly and as immutable for a hundred years, so a copy taken that way
before the upgrade doesn't expire.
script-src 'self', object-src 'none' and base-uri 'self', enforced. The
two inline scripts the importmap helper emits are allowed by their
SHA-256, and the origins its URLs point to (a configured asset host, in
any form Rails accepts) are allowed by name. There is no per-request
nonce, so cached pages stay valid.
DISABLE_CONTENT_SECURITY_POLICY=true leaves the policy off, for an
install whose proxy or customization injects scripts.
Uploaded files come from this origin, so one served with a JavaScript
type could run as one of the app's own scripts. Browsers accept sixteen
spellings of that type, and Disk URLs sign the type they were minted
with, so refusing a list of types at upload can't cover links already
out there. Instead, a middleware rewrites the type of anything Active
Storage reads out that isn't plainly media, a PDF or plain text to
application/octet-stream, whatever the URL says.
That's exactly what it was given before, with quotes and apostrophes
left as they are, rather than relying on its own sanitize pass to undo
h's '. Covers an email address with an apostrophe.
A <pre> whose text starts with a newline needs one more written out to
survive being parsed again, as the html5 serializer does with
preserve_newline. Without it, linking text dropped one more of a code
block's leading blank lines than rendering did before.
Replying swaps each mention in the quoted copy for its text. Assigning
that text to outerHTML parsed it as html; replace the mention with a
text node instead.