New passwords: PASSWORD_MIN_LENGTH (default 8) and PASSWORD_CHECK_PWNED
(off by default), in Admin Panel / People / Login and on every platform.
The browser sends a password to Meteor hashed, so the server checks every
password that reaches it as text - Admin Panel Set password and Add user,
POST /users/register - and the sign-up, Change Password, reset and
enrolment forms check in the browser. Signing in is never checked, so an
existing shorter password keeps working until it is changed. A breached
password is found with Have I Been Pwned's k-anonymity range API: only 5
hex digits of the SHA-1 leave WeKan, and an unreachable service never
refuses a password.
REQUIRE_2FA: off (default), admins or all. It covers accounts that sign in
with a WeKan password; LDAP, OAuth2, SAML, CAS and Sandstorm accounts sign
in through an identity provider and are not asked. Such an account can
still sign in, sees only the 2FA set-up until it has 2FA, and until then
the server refuses every method and publication but signing in and
enrolling, HTTP routes do not accept its login and the REST API gives it
no token. Once required, 2FA cannot be switched off.
The new interface strings are pending translation.
Thanks to xet7 !
A grain has one login (Sandstorm's), one database (FerretDB on SQLite) and one
mailbox (the grain's own address), but the .spk carried every login package
WeKan has and a FerretDB with the PostgreSQL, MySQL and SAP HANA handlers.
releases/sandstorm-slim-spk.sh, used by sandstorm.yml, release-all.yml's
build-sandstorm job and build.sh's "Make the .spk package", builds with the
package profile of releases/sandstorm-slim.mjs - accounts-password, 2FA,
passwordless, lockout, OAuth2/OIDC, CAS, LDAP, SAML and the seven social
logins removed from a copy of .meteor/packages for that one build, then
restored - trims the bundle for a linux/x64 grain, verifies none of those
packages got in and packs with spk pack (meteor-spk pack rebuilds and would
undo the trim). sandstorm-src/build-deps.sh builds FerretDB from source with
ferretdb_no_postgresql,ferretdb_no_mysql.
Under Sandstorm the Admin Panel hides the E-mail, Login, Locked users, SAML,
LDAP, OAuth2, CAS, Header login, OAuth providers and Passwordless panes,
Attachments / Database migration, the Email-to-card IMAP and webhook settings,
the New user button and the password fields; a hidden pane opened by URL lands
on the first visible one. POST /users/login and /users/register answer 404
sandstorm-sso-only, database migration is refused and the IMAP/webhook
settings are not stored. Without accounts-password the server creates
Accounts.emailTemplates with the package's defaults and marks useraccounts
initialised, which otherwise stopped the first grain.
Against wekan-12.63-sandstorm.spk, built from the same source: 181,307,364
instead of 185,271,476 bytes (-3.8 MiB, -2.1 %), unpacked 26.7 MiB smaller.
Docker, Snap and the bundles build from the full package list, and a test fails
if that list is slimmed. Tested on a local Sandstorm 0.308: a grain starts, a
board, a list and a card are created, and the removed options are not shown.
tests/sandstormSlim.test.cjs and tests/playwright/specs/sandstorm-slim.e2e.js
pin it. Design: docs/Platforms/FOSS/Container/Sandstorm/Smaller-wekan-spk.md.
Thanks to xet7 !
The member's SQRL client sends both options with every sign-in, and WeKan
now follows them (it used to say they were not supported):
- sqrlonly: every other way of signing in is refused - password, OIDC,
LDAP, SAML, CAS, passkey, Nextcloud (validateLoginAttempt), the REST
/users/login and header login, which mint their tokens without it. A
resume token stays valid; a session already open stays open.
- hardlock: no password-reset e-mail is sent (the answer is the same as
for a sent one), a reset link sent before does not sign in, and the
member cannot change their e-mail address.
An ident records the options only once it succeeds; a flag the client
leaves out is switched off. Neither applies while the identity is disabled
from the SQRL client (the emergency stop), nor while the admin has SQRL
off, and an admin can still change the e-mail, set a password and create
a token: those are the ways back. Member Settings / SQRL shows which locks
are on; the sign-in page and the e-mail change say why they refused.
tests/sqrl.test.cjs drives both options through the protocol with a real
Ed25519 client (set, cleared, never by a query, a refused or a forged
ident), the refusal decision for every login type, and pins every path
that signs a member in - and lists every file that mints a login token,
so a new one cannot skip the check. New strings translated in all
locales.
Thanks to xet7 !
Each login method has its own section: LDAP, OAuth2 (OpenID Connect and
Oracle OIM), CAS and Header login are new or complete, and the Login pane
gets PASSWORD_LOGIN_ENABLED and ACCOUNTS_COMMON_LOGIN_EXPIRATION_IN_DAYS.
models/lib/authConfigCatalog.js lists all 103 variables; server/lib/
authConfig.js resolves each one at run time (Admin Panel value first, then
the environment variable) for the app and, through
globalThis.__wekanAuthEnv, for the wekan-ldap, wekan-oidc and
wekan-accounts-cas packages. OAuth2 and CAS service configurations and LDAP
background sync are reapplied when their settings are saved.
Passwords and client secrets (LDAP_AUTHENTIFICATION_PASSWORD, OAUTH2_SECRET)
never reach the browser: the page learns only whether one is set and where
it comes from. Other values have credentials written inside a URL masked on
the server, and a URL field refuses them.
Fixed on the way:
- The Admin Panel LDAP overrides never applied. The bridge read Settings with
a server-side findOne(), which Meteor 3 refuses; the error was swallowed and
the environment used. The settings are now held in an observed cache.
- LDAP Test connection never existed on the server (testConnection.js was not
imported) and used the synchronous Meteor.user().
- PROPAGATE_OIDC_DATA=false turned the feature on.
- CAS read only the misspelled CASE_VALIDATE_URL; CAS_VALIDATE_URL now works
and the old name still does.
- snap help named three group-filter keys snap set does not know.
Every catalog variable is now listed in the Dockerfile, the docker-compose
files, snap config and help, and start-wekan.sh/.bat; 14 were missing.
tests/authConfigCatalog.test.cjs pins resolution, secrets, input validation,
platform coverage, and - across the whole tree - that no code reads a login
variable outside the catalog or straight from process.env, and that no
server code calls the synchronous Settings.findOne() or Meteor.user().
tests/playwright/specs/admin-login-env-overrides.e2e.js drives the pages.
Thanks to xet7 !
The login lockouts count per address and per (account, address), so a
guesser spread over many addresses was never slowed, and a hard per-account
lockout would let a stranger lock the owner out (JamBleed). After five
failures on one account within 15 minutes, from anywhere, the account now
accepts one attempt per slot - 1 s doubling to 30 s - over REST and DDP
alike; an early attempt is refused before the password is looked at, and
addresses the account has signed in from are not slowed. Refusals show as
BruteBleed in Admin Panel -> Problems, naming the account as the target.
LDAPBleed and BruteBleed move to the guarded list.
Thanks to xet7 !
Fix InactiveBleed across REST, attachment and export authentication, header login, LDAP token issuance and People account controls. Apply administrator-created account flags before insertion and guard token creation atomically.
Thanks to esbrito81 and xet7 !
Remove the progressive HTML4/Legacy Omi middleware, cookieless sessions, page controllers, assets, parity refactors, design documents and associated tests. Restore the standard Meteor interface and operations from before the HTML4 work began.
Preserve intervening translations, backup screenshots, session upgrades, cryptographic test identifiers, local image storage, document previews and lazy browser loading. Extract the GIF utilities still required by image features into imageGif.
Validate the Node suites and add standard-interface and GIF regressions. Two existing failures remain in docsLinksResolve and ruleDetailsLocalization; browser regressions are registered but require a running server.
Thanks to xet7 !
Apply the existing LDAP migration password guard before the REST route can check a local hash. Preserve uniform failure timing and cover the browser hook, REST ordering, and negative response wiring.
Thanks to akitzing and xet7 !
Fixes#4419,
Route existing and first-time LDAP username credentials through Meteor server login handlers instead of requiring a local bcrypt password. Preserve uniform failures, throttling, two-factor checks, REST token creation, and local-password behavior.
Thanks to mariogalan, ViViDboarder, mgiacomoli, HaKePlan and xet7 !
Fixes#3707,
POST /users/register guarded itself with
Accounts._options.forbidClientAccountCreation, which NOTHING IN WEKAN EVER
SETS:
* the only Accounts.config() call, in server/accounts-common.js, sets
loginExpirationInDays and nothing else;
* forbidClientAccountCreation: disableRegistration in config/accounts.js
is passed to AccountsTemplates.configure() - the useraccounts package's
own options object, not Meteor's Accounts;
* and that disableRegistration is only assigned inside an async
Meteor.call('isDisableRegistration') callback that fires AFTER
configure() has run, which the file's own comment already records.
So the condition was always falsy and the endpoint never refused anybody.
Turning registration OFF in the Admin Panel closed the sign-up form and
left POST /users/register creating accounts for whoever asked - on an
instance whose administrator had decided nobody else may join. The setting
is read from where it actually lives now, the same way the
isDisableRegistration Meteor method reads it, and a missing Settings
document still means registration is allowed rather than locking a fresh
instance out.
Every call that reaches the refusal is an attempt, because there is no
legitimate caller once the admin has turned registration off, so it is
recorded and shows in Admin Panel / Problems under authz.register /
SignupBleed.
Found while reviewing PR #6598 by AhmedLukman, filed against #4774 - a 403
nobody could reproduce, and which this line cannot produce. Looking for it
turned up the opposite fault.
Nine tests, four of them negative, on a route that had none at all: that
the setting is read where the Meteor method reads it, that the dead Meteor
option is not consulted again AND is still never set anywhere (so a future
change cannot quietly reintroduce two sources of truth that disagree), that
an enabled instance still creates the user and gets its token, and that no
Settings document does not refuse everybody.
Thanks to AhmedLukman and xet7 !
The security event log said what a guard DID - a request blocked, a filename
sanitized - which answers "is WeKan defending itself" and not the question an
admin asks next: who did that, and from where. It also could not tell a browser
that got confused from somebody working through the Hall of Fame one entry at a
time.
A CANARY is a tripwire at a point that only a permission-override attempt
reaches. Ordinary use never gets there - the code path runs when a request asks
for something the rules forbid - so a trip is not noise, and it is worth an
admin's attention with the actor attached. Design:
docs/Security/Remediation/WeKan.md §12.
Three properties, each enforced by a test:
SILENT. Tripping one changes NOTHING the caller can observe. tripCanary()
always returns false and tripCanaryDeny() always returns true, so a call site
reads as the refusal it replaces:
if (forbidden) return false; // before
if (forbidden) return tripCanary('card.vote-field', { userId });
The return value is decided before any reporting is attempted and the reporting
is wrapped, so a canary can never throw into, delay or disturb the request it
watches. The REST handler re-throws the ORIGINAL error object. This is not
politeness: a canary that announces itself is a map of which paths are watched,
and a probe would simply avoid them.
BOUNDED. A canary sits where an attacker can loop, so one row per attempt would
be a denial of service they get for free. models/lib/canaryTokens.js - pure, no
Meteor, no clock of its own - records the first trip of a (canary, actor) pair
at once, COUNTS the rest of the window, flushes one summary carrying the total
when the window closes, and stops writing after 60 summaries for a pair that
never gives up. The tracked-pair map is capped at 5000 and evicts the LEAST
RECENTLY seen, so a long-running attacker is not pushed out by a passing one and
a botnet varying its address cannot grow it. Idle pairs are swept on a timer. A
thousand attempts in a minute cost ONE row, and a suppressed trip costs one map
lookup. The username lookup is cached and capped, and neither it nor the insert
is awaited on the caller's path.
ATTRIBUTED. Every event carries userId, username, ip and count. The username is
denormalised at write time on purpose: it is what the account was CALLED when it
tried, so a rename does not rewrite history and a deletion does not erase it.
The address uses the same spoofing-safe resolver as the login throttle -
X-Forwarded-For only as far as HTTP_FORWARDED_COUNT says to trust it - or an
attacker could write a colleague's address into the security log by sending a
header. `detail` says what was attempted in the words of the feature, never the
payload.
Seventeen canaries are wired at the permission checks that refuse the attempts
behind BoardBleed, ParentBleed, ChecklistBleed, PathBleed and CommentBleed, plus
the direct vote/poker field writes and a stored path that points outside the
storage root. All server-side: no Playwright, no browser, nothing to install.
Admin Panel / Problems / Security gains Username, IP address and Attempts
columns, and both new columns are searchable - the thing an admin does with one
security event is pivot on it.
tests/canaryTokens.test.cjs (25 checks) drives the limiter through bursts, an
endless probe, eviction order and junk input; tests/canaryCoverage.test.cjs (18)
pins every canary to its call site and asserts none of them changes what the
caller gets back.
Thanks to xet7 !
GHSA-2g94-9x3m-hv37. Two verified weaknesses on the login path chained into
account takeover, and both are fixed here.
1. The bundled wekan-accounts-lockout brute-force protection was completely
inert. Its two Accounts.validateLoginAttempt hooks decided whether an attempt
failed by comparing the error's reason string ('Incorrect password' /
'User not found'), but Meteor's accounts-base ships ambiguousErrorMessages
defaulting to true, so _handleError rewrites every credential failure to
"Something went wrong. Please check your credentials." before those hooks run.
The literals never matched, both hooks returned early, the failure counter
was never incremented, and no account ever locked. The hooks now decide from
the attempt's structural fields (new loginFailureDecision.js): any genuine
password failure counts, while the benign 'no-2fa-code' step (password already
correct, second factor still to come) never counts, so 2FA users are not
locked out of their own sign-in.
2. The login path leaked which accounts exist by timing: a real user runs bcrypt
(~50 ms) while a missing one returns in ~2 ms. A dummy bcrypt comparison
against a fixed cost-10 hash (loginTimingDefense.js) equalises the missing-user
path on the DDP login method (loginTimingNormalization.js, a handler that runs
ahead of the built-in one and never authenticates) and on the REST endpoint.
The REST POST /users/login twin also enumerated by message (a distinct
"...not found." string) and never ran the lockout hooks at all. It now fails
missing-user and wrong-password identically, runs the timing equaliser, and
throttles failed attempts per client address (loginAttemptThrottle.js), keyed
safely behind HTTP_FORWARDED_COUNT, resetting on success.
Tests: loginFailureDecision, loginTimingDefense, loginAttemptThrottle and
loginBruteForceEnumerationWiring (four new plain-Node suites).
Thanks to NinjaGPT and xet7 !
Fixes GHSA-2g94-9x3m-hv37.
- #2769: refresh drag geometry when the DOM changes mid-drag - cards no
longer drop into the wrong swimlane while someone adds a card.
- #1992: board import restores all five card date fields (and creator)
with fallbacks; receivedAt/endAt were never imported at all.
- #2292: archiving a swimlane archives its cards (mirroring lists);
restore brings back exactly the cards archived with it.
- #2494: client noCache card lookup returned a Promise since the
Meteor 3 port - multi-select board moves wrote sort: NaN everywhere.
- #1853: subtask "View it" falls back to the subtask's boardId when the
deposit board is not loaded, instead of silently doing nothing.
- #1554: restore the reactive dependency lost in 7673c77c5 so cards
added after board render accept sidebar label/member drops.
- #2306: "filter to selection" and every bulk action are board-scoped;
foreign-board cards can no longer be silently archived.
- #1437: new POST /users/logout API endpoint revokes the presented
resume token, or all tokens with {"all": true}.
All with positive+negative regression tests (see tests/*.test.cjs).
Closes#1389: already fixed - the standalone pencil edit button
(0cc63b810) plus the wrapped viewer (bf2b3b40c) guarantee an edit target
even when a full-width link fills the description.
Thanks to hever, Cactusbone, Vermeille, Vanclief, Miffe, IcedQuinn,
ppouliot, GhassenRjab and xet7.