Repository navigation
RESTHeart 9.12.2
This is a security release. It fixes a change stream bug that could deliver one client's events to other clients, and it hardens the
restheart-accounts endpoints that send emails. If you use change streams with notify_when, or restheart-accounts, upgrade. Read "Before you
upgrade" first: some changes alter existing behaviour.
Before you upgrade
- Your change streams use
notify_when. A client that does not bind the variable named innotify_whenis now rejected with 400
variable not bound. Before, it received every event of the stream. - Your tests or tools send
X-Skip-Email: true. The header is now ignored unless you set/accountsEmailPolicy/allow-skip-email-header: true.
Without it, register, forgot-password, invite and resend-invite send the email. - You call
/auth/forgot-passwordmore than once for the same address. It now sends at most one email per address every 300 seconds. The
response is still 202. Set/accountsEmailPolicy/resend-cooldown-secondsto change the interval, or0to turn it off. - Your sign-up form accepts unusual values.
/auth/registernow answers 400 to anything but a single email address up to 254 characters,
and to names longer than 100 characters or containing line breaks, control characters,<or>.
Security: change streams delivered events to the wrong clients (#770)
notify_when filters the events of a change stream per client, by comparing a field of the event with a variable the client binds when it
connects. Two bugs combined:
- The variable was read only from a plain query parameter (
?chatId=...). A client that bound it withavars={"chatId": "..."}, as for the
stream's own stages, was treated as unbound. - An unbound variable disabled the filter. The client received the events of every other client of the same stream.
A client that used avars therefore received all the events of the stream, including documents that belonged to other users.
Now:
?tid=...andavars={"tid": "..."}are equivalent. When both are given,avarswins, as for stage variables.- A client that does not bind the variable is rejected with 400
variable not bound, and receives nothing. - A variable bound in
avarsto a value that is not a string is rejected with 400, unless the plain query parameter gives a string.
Security: restheart-accounts emails
A new provider, accountsEmailPolicy, decides when restheart-accounts may skip an email and how often it may resend one:
/accountsEmailPolicy:
# Honour the X-Skip-Email: true header. For integration tests only.
allow-skip-email-header: false
# Minimum seconds between two password-reset or verification emails to the same address.
resend-cooldown-seconds: 300X-Skip-Email is off by default
Register, forgot-password, invite and resend-invite skipped the email whenever the request carried X-Skip-Email: true. Anyone could create an
account, or a password-reset token, for an address without its owner being told. The header is now honoured only when
allow-skip-email-header is true, and RESTHeart logs a warning at startup when it is.
forgot-password has a cooldown
/auth/forgot-password sent an email every time it was called, so it could be used to flood an address, also one seeded through
/auth/register. It now sends at most one password-reset (or verification, for unverified accounts) email per address per
resend-cooldown-seconds. The response is the same 202 either way, so the cooldown does not reveal whether the account exists.
register validates its input
/auth/register now accepts only one email address, up to 254 characters, and names up to 100 characters without line breaks, control
characters, < or >. Names end up in emails, and these values could add lines or markup to them.
Other changes
- Compiler deprecation warnings removed.
- CI: the release workflow runs on
ubuntu-22.04, like the branch and pull request workflows. Onubuntu-latestthe kernel is 6.19+, on which
mongod 8.x refuses to start (SERVER-131155).
Full Changelog: 9.12.1...9.12.2