Commit Graph
156 Commits
Author SHA1 Message Date
Lauri Ojansivu 4fad2a9000 Fix InviteBleed's remainder: six-digit invitation codes and the unthrottled sign-up method.
GHSA-rg85-qx5c-qx67 reported the InviteBleed brute force again, now as a
GitHub Security Advisory. The 128-bit code of the first fix was still in
place, but two things it left were open:

- An invitation made before the fix, and not used yet, kept its six-digit
  Math.random() code and was still accepted at sign-up; a re-invite even
  mailed the same code again. A code shorter than the 22 base64url
  characters of a 128-bit code is now refused at sign-up, in both places it
  is looked up, and hasUsableCode() treats it as missing, so a re-invite
  replaces it with a strong one (models/lib/invitationCodeEmail.js
  isStrongInvitationCode).
- The DDPRateLimiter rule was on createUser, which a client is refused
  anyway, while the sign-up form creates the account through useraccounts'
  ATCreateUserServer, which had no limit. It now takes at most 10 attempts
  a minute per address, and each refusal is an InviteBleed row in Admin
  Panel -> Problems (brute.invite).

The other two advisories of the same report were checked against the
current code and are already fixed: GHSA-6944-p22h-3qpx (OIDC shared
serviceData race) since #4897 on 2026-07-17, whose per-login objects are
locals of the callback, and GHSA-j4x8-689m-h4hv (stale impersonation record
allows export), where every export route authorizes through
canExportBoardData() only and the impersonation record is just the audit
row written after it.

Thanks to meifukun and xet7 !
2026-11-20 07:48:22 +02:00
Lauri Ojansivu 42959d02f1 Edit Profile saves a member's own new username when Username change is allowed.
setUsername wrote only for a site admin, so with Admin Panel / People /
Login Username change allowed a member's new username was not saved, and
the popup closed as if it had. It now follows setEmail: an admin renames
any account, a member their own when the setting allows it, and anything
else is refused with not-authorized instead of returning quietly.
setUsernameAndEmail asks for both changes to be allowed.

Thanks to xet7 !
2026-11-20 04:20:05 +02:00
Lauri Ojansivu 040d853c8e RedirectBleed hardening: a direct client write of an avatar URL follows setAvatarUrl's rule.
setAvatarUrl refuses javascript:, file:, data:text/html and every scheme but
http(s), data:image and local paths, but the Users allow rule permits every
profile.* field, so Users.update({$set: {'profile.avatarUrl': ...}}) from the
browser console stored what the method refuses. Not exploitable as reported:
the URL is rendered only as an <img src>, and the server fetches it only
through fetchSafe (http/https). The rule is now models/lib/avatarUrlScheme.js,
used by both avatar methods and by a Users deny rule, which logs the refused
write to Admin Panel / Problems as file.avatar-url. No WeKan client code
writes the field directly, which the test checks.

Verified while checking meifukun's GHSA-g98f-44gc-hqcc, GHSA-x6fh-wrr5-3426,
GHSA-28hr-j65r-grj2, GHSA-mrhx-8xm7-chrq and GHSA-83qj-w8mp-w4qf against the
current code: all five were already fixed (tests/securityMeifukun.test.cjs).

Thanks to meifukun and xet7 !
2026-11-16 13:54:08 +02:00
Lauri Ojansivu d4c0d3e882 Security: a REST write that changes nothing answers 404, and a card deletion naming another list keeps the card's children.
DELETE /api/boards/:boardId/lists/:listId/cards/:cardId found the card by
board alone, removed its checklists, checklist items, comments and
attachments, and then removed the card by board AND list. With the wrong
list id the card stayed, emptied, and the reply was 200. Only the named list
was asked, so a member a list refuses could strip that list's cards by naming
a list they may write (ListLockBleed follow-up, GHSA-4734-8vrg-8j3w). The card
now has to be in the named list, and its own list is asked too, which records
the attempt in Admin Panel / Problems as authz.list-locked.

The siblings of #6900, #6905 and #6906 answered 200 for a change that changed
nothing: the swimlane, list, card, dependency and board-domain deletions; the
custom-field update, dropdown-item add and rename; the dependency update; the
board-member add and remove; and the token deletion of an unknown user. Each
looks the record up first and answers a JSON 404, and removing a board's last
admin answers 409. Member removal deactivates the user's active entry, not
the first one.

tests/restWriteRoutes404.test.cjs runs each handler with the record missing
and present, and fails for any id-addressed REST write in server/ without a
not-found answer. tests/playwright/specs/rest-write-routes-404.e2e.js replays
them against a running server. Three guards that pinned the old code shape
were updated, keeping what they protect.

Thanks to xet7 !
2026-11-14 21:26:30 +02:00
Lauri Ojansivu a8e25952aa REST takeOwnership awaits the board update, and removeMember awaits its user lookup.
PUT /api/users/:userId with action takeOwnership called the async
board.changeOwnership() without await: the reply was sent before the board
was changed, and a failed update was an unhandled rejection behind a 200.

Boards.removeMember tested `!ReactiveCache.getUser(memberId)`. On the server
that lookup is async and returns a Promise, which is always truthy, so the
#5330 branch that hard-removes a member whose account was deleted never ran
on the server; such a member was only deactivated and lingered.

Tests pin both, and fail the tree for any un-awaited changeOwnership() or
negated un-awaited ReactiveCache lookup in server/ and models/.

Thanks to xet7 !
2026-11-13 17:45:05 +02:00
Ahmed Lukman 4b4db92a1b Fix ownership transfer selecting ordinary board memberships
Match the target user and administrator flag within the same board member, following the existing membership query pattern. Leave boards where the target is only a normal member unchanged.

Cover selection, successful transfers, unchanged unrelated memberships, repeated requests, authorization, and retained browser access.
2026-11-13 11:51:40 +03:00
Lauri Ojansivu 8dc77a89d8 Indexes for the LDAP id, cards' assignees and members, and History by entity and hash.
On a large installation the database-problems page filled with collection
scans of queries WeKan makes constantly but never indexed: a user looked
up by services.ldap.id at every LDAP login and sync pass (13,000+ users,
~430 ms per login), cards by assignees or members across every board for
My Cards and the filters (1.1M cards, 1-3.7 s, dozens of times a minute),
and changeHistory by entity and by integrity hash (120,000+ rows, and
growing). Each now has an index, created at startup with ensureIndex like
every other one: services.ldap.id sparse, assignees and members both so
their $or uses an index on each branch, and changeHistory's
{ entityType, entityId, createdAt } and { integrityHash }.

Thanks to Raymond-Voogt and xet7 !

Fixes #6892.
2026-11-11 20:29:31 +02:00
Ahmed Lukman fd59a8ff70 Await REST token deletion before reporting success
Wait for Accounts.destroyToken to finish so deletion completes before a success response and rejected database writes reach the existing error handler.

Add regression coverage for delayed and failed deletion, authorization, existing token input behavior, session isolation and browser logout.
2026-11-11 14:43:56 +03:00
Ahmed Lukman 0766a65fef Return 404 for updates to missing users.
Thanks to AhmedLukman and xet7 !
2026-11-05 20:47:06 +03:00
Lauri Ojansivu 144777ae6b Member Settings: a per-member switch to hide the focus outline.
Change Settings has Show focus outline, on by default: the blue ring round the
focused control is an accessibility feature (WCAG 2.4.7), and it also shows
after a click on a minicard. A member who turns it off - profile.hideFocusOutline,
a toggle method that takes the signed-in user only - gets a class on body that
hides the outline and its halo for them and nobody else. The label is translated
into every language file (best effort; the low-confidence ones are listed in the
changelog).

Thanks to mimZD and xet7 !

Refs #6755,
2026-11-03 16:04:44 +02:00
Lauri Ojansivu 1ded34dfdd REST API: a single-item GET that finds nothing answers 404, not 200 with an empty body.
The scoped card GET (/api/boards/:boardId/lists/:listId/cards/:cardId) sent
200 with no body for a missing, wrong-list, wrong-board or archived card. The
list, swimlane, custom field, comment and integration GETs did the same, and
the user GET threw a TypeError for an unknown name. Each now answers 404 after
the board check, so a stranger still learns nothing about which ids exist.

Thanks to AhmedLukman and xet7 !
2026-11-03 00:22:24 +02:00
Lauri Ojansivu 4e28465964 Daily jobs run once per installation: notification cleanup and the file integrity audit.
The notification cleanup ran at every start and daily on every server, reading
and rewriting the same users 24 times at a rollout; a notification added by
another server between a read and its write was lost. A run now claims a
document per job and day in dailyJobRuns, and the timer looks hourly for an
unclaimed day. The file integrity audit read 'lastRun', checked it, then wrote
it, so two servers could both scan; one atomic update now claims the run.

Continuous backup has no leader: that is documented as single-server, and the
lease it needs is not built, so #6861 item 3 stays open and this commit does
not close it.

Thanks to Raymond-Voogt and xet7 !
2026-11-02 18:49:19 +02:00
Lauri Ojansivu c99aa7f845 Admin Panel / Problems / Password length, and a changed password signs every session out.
PASSWORD_MIN_LENGTH (default 8) is now the length below which a sign-in
is REPORTED, in the new Admin Panel / Problems / Password length, and
PASSWORD_MIN_LENGTH_ENFORCE (off by default) is what makes it a rule: a
shorter new password is refused, and an account that signs in with an
older shorter one sees only "Change your password" until it has a long
enough one. Signing in is never refused, enforced or not, so nobody is
locked out by a minimum set after their password. LDAP, OAuth2, OIDC,
SAML, CAS and Sandstorm accounts are neither reported nor asked: their
password is their provider's. An administrator's Set password no longer
applies WeKan's policy to such an account.

Meteor sends a password hashed, so only the browser knows its length: it
notes it on the sign-in form and, after a sign-in that worked, says "it
was short" - never the password or its length.

The page has both settings and a table, one row per account: username,
first and last short-password login, the latest IPv4 and IPv6 address
with the country's flag and city when a CDN says where it is, the count,
and when it was fixed, with the Too short (default) / Fixed / All filter.
Fixed is a changed password not seen short since; a short one seen
again reopens the row.

Changing one's own password - Member Settings, the forced change, a
reset link - now signs EVERY session of the account out, the one that
changed it too, and only the new password signs in again. The browser
goes to the sign-in page as soon as it is signed out, since the server
closes the connection before the answer can arrive.

Documented in docs/Features/Admin-Panel/Problems/Password-length.md, the
settings on every platform. The new strings are in every locale in
English for now. Tests: passwordPolicy, passwordChangeRequired and
shortPasswordLogins (node); password-min-length-signup-login,
password-length-report and password-change-other-sessions (Playwright,
Chromium and WebKit), which change each setting on the page and check
what it does, and that sign-up with no mail server registers and signs
the user in.

Thanks to xet7 !
2026-10-31 14:54:22 +02:00
Lauri Ojansivu d7abe9910a Password policy for new passwords, and compulsory two-factor authentication.
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 !
2026-10-31 00:07:58 +02:00
Lauri Ojansivu 8556459f97 Invite via Email adds the invited new user, not the first user of the database.
Meteor 3's server Accounts.createUser is createUserAsync. inviteUserToBoard
called it without await, so the new user's id was a Promise; findOneAsync
read the Promise as the empty selector {} and returned the FIRST user,
usually the site administrator. That user was added to the board and got
the invitee's language and invitedBoards, while the invitee was created but
not added. It was not FerretDB: any database did the same.

createUser and sendEnrollmentEmail are awaited (an enrollment email that
fails is logged, as the invitation email is), and the user found must be
the one just created. Every server ReactiveCache getter now refuses a
Promise as its id or selector, so a missing await fails loudly instead of
picking the first document. Tests: the guard and the reporter's case in
memory, a scan that no server file calls an async Accounts API without
await, and a browser test that inviting a new address adds exactly that new
account - it fails on the previous code.

Thanks to momosari and xet7 !

Fixes #6831.
2026-10-29 17:35:21 +02:00
Lauri Ojansivu 70de255333 Add card: the form closes after the card is added, unless Member Settings keeps it open.
A list's Add card form stayed open after a card was added, for the next
card, which the reporter found unexpected. It now closes once the card - or
every card of a multi-line paste - is added. Member Settings has a new
switch, "Keep the Add card form open after adding a card", off by default,
for who types several cards in a row. The close happens after the last
title, not at submit, because addCard still reads the form between the
titles of a paste; a failed add keeps the form and its text.

The two new strings are translated into every locale. Low confidence: ace,
ak, am, an, ary, as, ast-ES, ay, ba, bho, bi, bm, bo, br, bua, chr, ckb, co,
csb, cv, dz, ee, ff, fj, fo, fur, gn, gv, ha, haw, hsb, ig, iu, kl, kok, ks,
kw, lb, lg, lld, mai, mg, nah, nap, nd, nso, ny, om, or_IN, pap, ps, qu, rn,
rup, rw, sah, sc, scn, sd, se, sm, sn, so, ss, st, szl, ti, tig, tlh, tn,
to, tpi, ts, uz-AR, ve, ve-CC, ve-PP, vo, wa, wa-RR, wal, wo, wuu-Hans, zgh.

tests/keepAddCardFormOpen6827.test.cjs pins the switch, its default and
where the form is closed, with negative cases for a paste and a failure.
tests/playwright/specs/keep-add-card-form-open-6827.e2e.js drives it: closed
after one card and after a paste, kept open with an empty title once the
switch is on. multiline-titles opens the form again for its second card, and
assist-due-from-title keeps it open to check the next card's form has no
leftover hint.

Thanks to brlin-tw and xet7 !

Fixes #6827,
2026-10-28 04:46:52 +02:00
Lauri Ojansivu ebcd02be6f Hall of Fame regression audit: every fixed vulnerability still fixed, siblings of six of them closed.
Every Hall of Fame vulnerability without a test naming it (24 names, 30
advisories) was checked against the current source. No fix had been
reverted. Looking for the same mistake elsewhere found siblings:

- FloppyBleed: the fs-path-heal upgrade step joined an attachment's
  stored name into candidate paths as-is; a record a client inserted
  named ../../../etc/passwd made the next upgrade copy that file into
  storage - an arbitrary file read. Only the name's last component is
  used now; the bulk move limits a legacy name's extension the same way.
- FilePathBleed (GHSA-g6vm-7757-pr88): the insert guard looked only
  inside versions; with versions left out ostrio:files falls back to a
  top-level path, which removing the record deletes and validation
  reads. A client's top-level path is refused for attachments and
  avatars, recorded by the existing canaries.
- MoveStorageBleed: validateAttachment, which deletes a file failing the
  current upload rules, was open to anybody who could see the board, a
  public one included. Only who may change the file, or a site admin,
  validates now; a refusal is recorded (authz.attachment-validate).
- HookUrlBleed / IntegrationBleed: the REST reads of a board's
  integrations gave the webhook URL - whose path is its secret - to
  every member reading the board; non-admins get what the publication
  gives them.
- AttachmentMigrationBleed: four migration methods answered any
  logged-in user about any board, deleteDuplicateEmptyLists.getStatus
  with a private board's list titles; they require a visible board and
  record refusals (authz.migration-board).
- LegacyAttachBleed (GHSA-xcxp-hx9w-q5q9) and MimeStorageBleed
  (GHSA-rv5g-5p4g-3v89): the legacy route judged a name dangerous only
  for .svg, the response policy missed x-javascript, ecmascript, xsl and
  +xml types, and the sniffers missed <tag/onx= handlers.

OIDCBleed refusals are now recorded in Admin Panel / Problems too. New
suites name the vulnerabilities they guard, existing ones name the
advisories they already covered, and tests/securityRegressionCoverage
counts 128 of 137 published vulnerabilities with a named test (was 125).

Thanks to xet7 !
2026-10-27 16:28:12 +02:00
Lauri Ojansivu f89c8f8030 Add card: [Text] at the start of a title becomes a label only when turned on in Member Settings.
Since #3986 a new card's title starting with [Text] followed by more
text lost the prefix and got the label Text, created on the board when
it had none - for everybody, without a hint. Titles pasted from ticket
systems, mails and monitoring tools ([Follower] #123456 - ...,
[EXTERNAL] ...) were changed and filled the board with unwanted labels.

It is a Member Settings switch now, Turn [label] at the start of a new
card title into a label (profile.titleBracketLabel), off by default: a
title is kept as typed. Who wants #3986's behaviour turns it on. Both
texts are translated in every language; low confidence for the
constructed and rarest ones (tlh, vo and some 35 others).

Thanks to jullbo and xet7 !

Fixes #6810.
2026-10-27 15:04:31 +02:00
Lauri Ojansivu 91c12ebcce Drawing: custom colors are kept with the user's account when signed in, and in the browser on a public board without signing in.
The custom colors added to the Drawing popup's palette are stored in the
user's profile (profile.drawingColors, through the new setDrawingColors
method), so they follow the user to every browser. The method takes only
#rrggbb codes, each once, at most 16, and refuses a caller who is not
signed in; the schema holds only #rrggbb. Someone drawing on a public board
without signing in keeps them in this browser, as before.

Thanks to xet7 !
2026-10-25 12:09:52 +02:00
Lauri Ojansivu 058a2dcbce List sort indexes are made from key objects, not from "-modifiedAt" strings.
Admin Panel / Problems showed "Created the missing index "-modifiedAt" on
lists" at every start, from every pod. server/models/users.js passed the
list sort options ('-modifiedAt', 'title', ...) to ensureIndex as
strings: the driver read each as a field name, so lists got indexes on
fields named "-modifiedAt", "-title" and "-sort" (on no document, kept up
to date on every list write), and ensureIndex compared a string's JSON
with an index key object's, which never matched, so all six were
re-created and reported every time.

models/lib/indexKeys.cjs turns the sort options into one single-field
index per field ({ modifiedAt: 1 }, { title: 1 }, { sort: 1 }; one serves
both directions) and finds the stray single-field "-x" indexes, which
startup now drops; a compound index containing such a field is left
alone. ensureIndex turns a string key into the key it means, with a
warning, instead of indexing a field named after it.

tests/listSortIndexes.test.cjs uses the reporter's real index list, runs
ensureIndex itself against a fake collection (a string key creates the
real index once and reports it once), and fails on any ensureIndex call
in the tree whose key is not an index key object.

Thanks to Raymond-Voogt and xet7 !

Fixes #6794,
2026-10-22 15:16:50 +03:00
Lauri Ojansivu 193fb449bd Adding a board member: email invite is case-insensitive, and search filters before it limits.
A board member who was not a board admin could not add a colleague from
Board / Members / +.

- inviteUserToBoard matched the typed email address exactly. LDAP and OIDC
  store an address as the directory spells it ("Jan.Jansen@Example.com"), so
  "jan.jansen@example.com" found nobody, and WeKan tried to create a new
  account instead: "This user is not created" with registration off,
  otherwise a raw 403 "Email already exists". The match is now
  case-insensitive, anchored and escaped.
- searchUsers read five users and filtered afterwards: disabled accounts
  (which the invite then refuses, #1894) and, for non-admins, people outside
  the user's organization or team (#6116). Five non-matching users ahead of
  the colleague hid them. It reads 50, filters, then returns 5.

From the patch by Raymond-Voogt. tests/inviteMemberEmailCase.test.cjs pins
both, including that the pattern is anchored and its dot literal.
tests/playwright/specs/invite-member-email-case.e2e.js covers:
- an invite with a lower-cased address adds the stored colleague, and no
  second account is made;
- negative: a similar but different address is not taken for them;
- the search returns the colleague past six disabled matches, offering none
  of them.

Thanks to Raymond-Voogt and xet7 !

Fixes #6788.
2026-10-20 13:24:14 +03:00
Lauri Ojansivu b933a69cd4 People shows everyone's Last active; inactive users can be disabled; LDAP sync honours its search filter.
Admin Panel / People showed "Last active" as "-" for every user but the
administrator: the people publication did not carry lastConnectionDate.

USERS_DISABLE_INACTIVE_AFTER_DAYS disables, once a night, accounts that have
not used WeKan for that many days, and revokes their logins. Admins are
never disabled. An account with no recorded activity starts its count on the
first run rather than from createdAt, and re-enabling an account restarts it.
The setting is in Admin Panel / People / Login as well as in the
environment, and the job resolves it every night, so a change there needs no
restart. Every platform's settings file lists it.

LDAP background sync looked a user up by id without LDAP_USER_SEARCH_FILTER,
so an account the filter excludes - one disabled in Active Directory - could
not log in but was still "found". It was never disabled, and a manual
disable was undone on the next run. The filter is now ANDed into the lookup.
An account disabled for inactivity is not re-enabled by the sync.

From the patch by Raymond-Voogt, with the setting moved into the Admin
Panel's login settings. Tests: tests/inactiveUsers.test.cjs,
tests/ldapBackgroundSync.test.cjs, tests/ldapUserIdFilter.test.cjs,
tests/authConfigCatalog.test.cjs and
tests/playwright/specs/inactive-users-last-active.e2e.js.

Thanks to Raymond-Voogt and xet7 !

Fixes #6783,
Fixes #6784,
Fixes #6785.
2026-10-19 17:35:51 +03:00
Lauri Ojansivu b7589737f5 File docs/Features the way the WeKan menus are.
A feature's guide now sits under the menu it is used from, read from the
templates rather than from where somebody once put it: Header-Bar,
All-Boards, Pages, Board-Header (search and every Board View), Board-Sidebar
(Board Settings, Filter, Members, Labels, Archive), Rules, Swimlanes, Lists,
Cards, Member-Settings, Admin-Panel and Login-Page. Topics used from several
menus (editor, history, theme, translations, email, troubleshooting) are in
General.

- Each area has a README mapping its menu entries to their guides and to the
  template or server module that implements them. Board-Header/README.md
  lists all 40 Board View entries with the template boardBody.jade renders;
  five views (Table, Calendar Mode, Time, Timeline, Map) have no guide of
  their own yet and say so.
- Board-View.md listed 25 views while BOARD_VIEWS has 40; it now lists all
  of them with their English labels.
- Pages keep their file names. Where a released changelog links an old path,
  a "# Moved" page stays there and points to the new one; test-menu.sh skips
  folders holding only those.
- Undo was filed under Login; it is General/Undo now.
- Every link in docs, code comments, scripts and tests follows the move;
  docsLinksResolve checks them all.

Tests that read a doc follow it to its new place. boardViewSettings now fails
when Board-View.md or Board-Header/README.md differs from BOARD_VIEWS, or
names a template boardBody.jade does not render.

Thanks to xet7 !
2026-10-16 23:45:35 +03:00
Lauri Ojansivu a539429fce SQRL: sqrlonly and hardlock lock an account to SQRL.
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 !
2026-10-14 21:45:34 +03:00
Lauri Ojansivu d8690a26f5 Cards changed since a member last opened them are marked, as a Member Settings switch.
Member Settings / "Mark cards changed since I last opened them", off by
default. With it on, a minicard gets a blue edge when anything of the
card changed after the member last opened it - its own fields (title,
description, dates, labels, members), its checklists and their items,
attachments and comments - until they open it. Turning it on records
when, so the cards a member never opened are not all marked at once, and
closing a card counts as having seen it, so their own edits made while
it was open do not mark it.

models/lib/unreadChanges.js takes the latest change across those
documents and compares it; tests/unreadChanges.test.cjs covers each kind
of change, seen since, off, older than the switch and the wiring. The
new strings are English placeholders until the next translation pass.

Thanks to Lacour20, martinpospech and xet7 !

Fixes #2111,
Fixes #1604.
2026-10-14 15:37:02 +03:00
Lauri Ojansivu 63ef900d56 Passkey (WebAuthn) login, and Log out everywhere.
Member Settings gets Passkeys: add a passkey on this device under a name,
see the account's passkeys and remove one. The sign-in page gets "Sign in
with a passkey": the browser offers this WeKan's passkeys, no user name
needed. Verification is @simplewebauthn/server 14.0.3 (MIT, pinned)
against ROOT_URL's host and origin, so a passkey cannot sign in to another
site or through another address; each sign-in signs a fresh challenge
that is used once and expires in five minutes, and the signature counter
must move forward, so a copied passkey is refused. A disabled account
cannot sign in with one (the existing validateLoginAttempt hooks apply).
Passkeys are a top-level user field, never published and not writable
from the client; up to 20 per account. Not offered on Sandstorm.

Member Settings also gets Log out everywhere: after a confirmation every
login token of the account goes, so Meteor ends every session - other
browsers, phones, the desktop app - and this one. Nothing else changes.

models/lib/passkeys.js holds the relying party, base64url and the
browser conversions; client/lib/passkeys.js uses navigator.credentials
directly. tests/passkeys.test.cjs signs assertions with a software ES256
authenticator: a real signature verifies, and another key, another
origin, another challenge or a counter that went back are refused; it
also checks single-use challenges, the unpublished field and the pin.
server/lib/tests/passkeys.tests.js runs in Meteor (2 passing): the module
bundles, login options name no account, and registration needs a user.
Documented in docs/Features/Login/Passkeys.md. The new strings are
English placeholders until the next translation pass.

Thanks to xet7 !

Fixes #5847.
2026-10-14 14:59:25 +03:00
Lauri Ojansivu a6b2938e1c Updates 2026-10-14 14:04:07 +03:00
Lauri Ojansivu 7595727917 Boards every signed-in user may edit, per-list permissions, board keys and shared labels.
A board can let every signed-in user edit it, when Admin Panel / Settings /
Visibility allows it: a non-member then comments, edits and moves cards like
a Normal member, and their first edit makes them one. Board-wide settings
stay members-only.

Lists can allow or refuse editing and commenting per role (list menu, board
admins): built-in roles, custom roles and, on an open board, everyone signed
in. The server applies it to card, checklist, attachment and comment writes
and to moves into the list; the REST API honours a list's refusal on every
per-list card route. A direct client write of the setting is refused and
shown in Admin Panel / Problems.

Every board has a key, unique in the instance, suggested from its title and
set for existing boards at startup; card numbers show as KEY-7 and searching
for KEY-7 finds the card.

Shared labels in Admin Panel / Labels, for every board or an organization's
or team's boards; a board uses them beside its own, and a rename or colour
change reaches every board that uses it.

New strings translated in all languages. Low confidence: chr, tlh, wal, ay,
ace, nah, gn, iu, zgh, rup, wo, se, ff, tig, vo, bm, kl, bua, nap, mai, to,
ks, qu, bo, fj, haw, om, ss, ts, ve-PP, lld, scn.

Thanks to Meeques, justinr1234, tiFabGrinch, ejlkemper and xet7 !

Fixes #4575,
Fixes #4527,
Fixes #2449,
Fixes #2450,
Fixes #2761,
Fixes #4698.
2026-10-14 09:28:45 +03:00
Lauri Ojansivu 50bb989eb8 Custom board roles, and team memberships that leave with the team.
#3022 (decided 2026-10-14): a site admin builds named roles in Admin
Panel / People / Roles from the capability matrix - sees all cards,
comments, edits, moves cards, invites - and a board admin gives one to a
member in the same popup as the built-in roles. Board admin stays
built-in. Every permission check asks boardRoleCapabilities, which
answers a custom role from the role; the member's built-in flags carry
the strongest built-in role that grants nothing more (fallbackRoleFor,
checked for every combination), so code reading a flag never grants
more, and a deleted role leaves exactly that. Where a role is asked by
name (hasWorker, isCommentOnly, ...) a custom role reads as the built-in
role that does what it does; commenting is asked as a capability
everywhere. Invites, REST whole-board reads, imports (a foreign custom
role is dropped) and member mapping (all eight flags now, not four)
follow it. The six new strings are translated in all 234 locales.

#4178 (decided 2026-10-14): a team or organization that gives board
memberships takes them away again when the user leaves it - only those:
each records where it came from (grantedBy), a direct membership is
never touched, a board admin is kept, and a board admin's own add or
removal is final. Teams through user edits, LDAP, OIDC and the board
sidebar; organizations where they propagate members.

Also: the Roles Status table gets a Move cards column; the comment form,
reactions and chat ask the comment capability (a No comments member was
offered reactions the server refused).

Tests: customBoardRoles and groupBoardMembership node suites, and the
runtime suites (9 passing) against a real database.

Thanks to xet7 and mfnalex !

Fixes #3022,
Fixes #4178.
2026-10-14 08:20:49 +03:00
Lauri Ojansivu ddb33d21d0 Board views Email and Chat.
Email shows the board as a Gmail-like mailbox in the board's own theme:
the Inbox is the list email to card puts new cards in, Sent and All mail
follow the cards' email, the board's lists are folders and its labels are
Gmail labels, coloured on every message. The messages are the shared
table page, newest first, paged on the server; a message opens as the
card popup, its comments the conversation. Compose and Reply send From
the member's own board address, so the answer returns to this board, and
by In-Reply-To to the same card as a comment.

Chat shows the board as a Slack / Rocket.Chat workspace in the current
theme: a tree of Workspaces, boards, swimlanes, lists and cards as
channels; the selected card in the middle; its comments as chat on the
other side. Tree | card | chat left to right, mirrored right to left.
Each pane folds, the two borders drag (and move with the arrow keys),
and widths and folds are saved on the member's profile. Swimlanes, lists,
cards, workspaces and boards reorder by drag and drop through the same
paths the board and All Boards use.

The new strings are translated in every locale.

Thanks to xet7 !
2026-10-13 16:56:29 +03:00
Lauri Ojansivu a325cfe991 Support Nextcloud ExApp identities and publish WeKan with embedded SQLite 2026-10-11 17:41:28 +03:00
Lauri Ojansivu 80fb317fda Remember the board view per board.
The view menu sits on a board, but choosing a view there changed it for
every board, so one board could not stay on Calendar while another stayed
on Swimlanes. A view chosen on a board is now that board's own
(profile.boardViews, published to its owner beside the shared value). A
board without its own choice uses the view every board shared before, then
the board's default, so nothing changes for anybody until they choose a
view on a board. A choice made off any board still sets the shared view,
and the browser's stored view follows only that one. The server accepts only
a known view under a safe board key. Label text visibility per board, the
other half of #4256, was done earlier.

The guards that pinned the single shared view now pin both; a new test runs
the stored-view logic per board, and a Playwright case checks two boards.

Thanks to DimDz, Meeques and xet7 !

Fixes #4906,
Fixes #4256.
2026-10-08 12:12:24 +03:00
Lauri Ojansivu dfcd115ff3 Let accounts created by an OAuth2/OIDC login join a default organization.
Organizations could gain new users automatically by email domain, but users
who register through one identity provider - the reporter's Nextcloud -
often share no domain, so they could not be grouped. OAUTH2_DEFAULT_ORGANIZATION,
or its field under Admin Panel / People / OAuth2, names an existing
organization (by short name, display name or id) that every account created
by an OAuth2/OIDC login joins, beside the domain rule. A name that matches no
organization creates none: the login goes on and the server log says so.

Listed on every platform, with snap help lines for it and for
DEFAULT_AVATAR_URL and OAUTH_PROVIDERS_ALLOWED_EMAIL_DOMAINS, which lacked
them.

Thanks to vasyugan and xet7 !

Fixes #5339.
2026-10-08 11:58:16 +03:00
Lauri Ojansivu d560e2fcf8 Make LDAP- and OIDC-synced team members members of the team's boards.
A user added to a team becomes a normal member of the boards that team is
assigned to (#4593, addUserToTeamBoards). The Admin Panel paths did that,
but the login providers' group syncs - LDAP_SYNC_TEAMS and OIDC groups with
PROPAGATE_OIDC_DATA - pushed the team onto the user with a plain $push. Such
users could see the team's boards but not work on them. Both now run the same
board sync after adding a team: LDAP imports it, and the wekan-oidc package,
which cannot import app code, reaches it through a global as it already
reaches authEnv.

tests/teamBoardsFromLoginSync.test.cjs pins both paths and fails if any code
pushes a team onto a user without the board sync; the OIDC concurrency test
now checks each concurrent login syncs only its own team's boards.

Thanks to xet7 !
2026-10-08 11:43:32 +03:00
Lauri Ojansivu 29bca6f757 Keep a merged account on its boards.
Merging a login into an existing account (OIDC with
OAUTH2_MERGE_EXISTING_USERS, and the Meteor OAuth providers with their
merge setting) happens in Accounts.onCreateUser: the existing user is
removed and returned, and Meteor inserts it again under the same _id. That
removal ran Users.after.remove, which is the account-deletion cleanup: it
pulled the user out of every board's members and watchers and every card's
members and assignees, and deleted their avatars. A merged user came back
signed in with no boards. Both paths now remove through collection-hooks'
.direct, which skips the hooks.

tests/mergedUserKeepsBoards.test.cjs pins both paths and fails if any code
removes an account through the hooks and then returns it; the OIDC merge
test's stub now throws on a hooked removal.

Thanks to xet7 !
2026-10-08 11:23:40 +03:00
Lauri Ojansivu eb49a4b1b6 Override every login environment variable in Admin Panel / People.
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 !
2026-10-05 19:48:48 +03:00
Lauri Ojansivu 8ddce924ec Record the Problems keys nothing recorded.
Nine catalog keys had no caller, so their Hall of Fame names could never
appear in Admin Panel -> Problems. Now recorded: a hostname resolving to an
internal address (DnsBleed) and a webhook refused by the SSRF guard
(IntegrationBleed), a Trello import carrying a non-http source URL
(SourceBleed), a client call of the OIDC-login-only org/team methods
(OIDCBleed), a sign-up with a wrong invitation code (InviteBleed), and a
read-only member writing over REST (ReadOnlyBleed). The three keys that
nothing can attribute are listed with their reasons in the test.

Thanks to xet7 !
2026-10-02 11:50:37 +03:00
Lauri Ojansivu bb4c892254 Gate the REST API as Express routes it, and keep impersonation status private.
With WITH_API off, the API gate refused req.url.startsWith('/api') - but
Express matches routes case-insensitively and on the decoded path, so /API/...
and /%61pi/... reached every API handler anyway. The gate now decides the
same way. The test covers the spellings Express routes and those it must not.

The isImpersonated method answered for any user id, to anyone, signed in or
not; it now answers only about the caller, or to a site admin.

Thanks to xet7 !
2026-10-02 11:22:54 +03:00
Lauri Ojansivu d3a94fd2d9 Close StaleBleed and ManageBoardBleed siblings: removed members no longer reach board ids or copies.
GET /api/user and the attachmentMigrationStatuses publication found the
caller's boards with a dotted 'members.userId', which also matches boards the
caller was removed from, so a removed member kept seeing those board ids (and
the publication looked for public boards by a field that does not exist). Both
match active memberships now, and boards readable without membership by the
shared rule. POST /api/boards/:boardId/copy hand-wrote its admin check without
isActive, so a removed former admin could still copy the board; it uses
Authentication.checkBoardAdmin. Negative tests fail on any REST handler or
publication that finds the caller's boards by a dotted members.userId, or that
hand-writes the admin check.

Thanks to xet7 !
2026-10-02 11:19:19 +03:00
Lauri Ojansivu fd458543f9 Close the MutationBleed siblings: shared board display settings need write access.
applyListWidth, setBoardAutoWidth and setStickyListHeaders change board-wide
state that every viewer sees, and refused only non-members, so read-only,
comment-only and worker members could change them. They now require write
access (not recorded as attempts: the menus may still offer them).
applyListWidth also awaits its write, which it had fired and forgotten. The
negative test fails on any server method that writes board content after a
membership-only check.

Thanks to xet7 !
2026-10-02 11:09:01 +03:00
Lauri Ojansivu 8fc9bd5a94 Close the HashBleed siblings: board member REST routes never answer with the user document.
POST /api/boards/:boardId/members/:userId/add and /remove read the target user
into the variable they answered with, so any action other than add or remove
sent the whole user document back - password hash and login-token hashes
included - to any board admin, which anyone becomes by creating a board. An
unknown action is now refused before the user is read, and the user is held
apart from the answer.

The negative test fails on any REST handler in the server that sends a
variable read from the users collection without withoutSecrets(); a browser
test calls both routes with an unknown action.

Thanks to xet7 !
2026-10-02 10:38:08 +03:00
Lauri Ojansivu 875a0065ed Fix PrototypeBleed: user-chosen ids can no longer pollute Object.prototype in the server.
The per-user layout methods keep maps keyed by the ids a client sends -
collapsed lists, cards and swimlanes, list widths and heights, board sort
indexes, workspace assignments - and wrote them as
map[boardId] = map[boardId] || {}; map[boardId][listId] = value. With boardId
'__proto__', map[boardId] is Object.prototype, so any logged-in user could set
a property on every object in the server process until a restart
(Meteor.call('setListCollapsedState', '__proto__', 'isAdmin', true)).

Every function in models/users.js and server/models/users.js that writes such
a map now checks its keys with assertSafeMapKey (models/lib/safeMapKey.js):
never __proto__, constructor or prototype, nor a '.' or leading '$' MongoDB
refuses anyway. A refusal is recorded as PrototypeBleed (no client sends one).
The test runs the real method bodies in their own vm context and shows the
pollution before the guard and none after; the negative test fails on any
id-keyed map write without the check. A browser test makes the reported call.

Thanks to xet7 !
2026-10-02 10:37:08 +03:00
Lauri Ojansivu 1167a2ae2f Close the SubtaskDepositBleed invite sibling: a deposit board admits invitees only from its own inviters.
Inviting someone to a board also added them to - or reactivated them on - the
board's subtask deposit board, checking the inviter's rights only on the board
they invited to. A deposit pointer needs only write access, so a writer (an
assigned-only member, or a normal member where only board admins may invite)
could point their own board's deposit at any board and invite anyone into it,
their own second account included, or reinstate someone removed from it.

The deposit board now admits the invitee only when the inviter may invite to
that board too (canInviteToBoard, the rule invitations use). It is not recorded
as an attempt: an inviter without rights on the deposit board is also an
ordinary configuration. The test drives the reported attack through the real
rule, and the negative test fails on any member write to a deposit board
before that check, anywhere in the server.

Thanks to xet7 !
2026-10-02 10:28:00 +03:00
Lauri Ojansivu cecf92cf57 Deliver board invitations to the invitee's notification bell.
The #3136 invite notification never ran: its params object was declared
inside the email block, so Notifications.notify() threw a ReferenceError
that its own catch logged. With it in scope, the tray would still have
refused an entry with no activity, and the email service would have queued
a second email beside the invitation. The invite now delivers the
membership's addBoardMember activity, which the bell already renders, to an
existing invitee's tray only, honouring their tray setting. A re-activated
membership records that activity; re-inviting an active member adds nobody.

Refs #3136.

Thanks to CondensedTea and xet7 !
2026-09-29 15:48:34 +03:00
Lauri Ojansivu c3caf87a13 Enforce disabled account status and revoke existing sessions.
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 !
2026-09-26 01:27:36 +03:00
Lauri Ojansivu 4f7d28637e Verify login provider exchanges and fix authentication failures
Exercise local LDAP, OAuth, SAML, CAS, SMTP and proxy identity servers through real WeKan login adapters. Fix optional LDAP mapping, simultaneous provider configuration, SAML certificate and profile mapping, async login controls, CAS callbacks and TOTP retry errors. Require consumption of remaining passwordless codes before issuing sessions.

Validated 34 Chromium integration checks, seven expanded social profile checks and focused Node regression suites on macOS ARM64.

Thanks to xet7 !
2026-09-23 20:31:35 +03:00
Lauri Ojansivu e13f4f6c29 Group member date preferences in the direct Date popup
Move week start and calendar system below Date Format and remove their controls and writes from Change Settings. Capture all selections before saving, await week-start persistence, and retain existing translations.

Thanks to xet7.
2026-09-23 14:59:46 +03:00
Lauri Ojansivu 94b59bef01 Move date format controls to global, board and member settings
Apply enabled member overrides before board and global defaults. Show inherited
status and saved formats using existing translations, and keep the card section
named Date. Cover rendering, exports, permissions, date-only formats and settings
isolation.

Thanks to xet7.
2026-09-23 13:58:24 +03:00
Lauri Ojansivu 16b1b307fc Add cleaner task board presentation and date-only formats.
Add board controls for minicard collapse, labels above the title, checklist due dates and the outer checklist heading. Keep previously collapsed content accessible when its control is hidden, and preserve stored content and existing defaults.

Add personal and admin date-only formats across calendars and exports. Extend the existing smaller font presets with compact checklist and settings spacing. Cover persistence, permissions, layout and date behavior with unit and browser tests.

Thanks to xet7 !
2026-09-19 15:56:01 +03:00
Lauri Ojansivu 1c47bcc4ac Await the Meteor 3 subscription transition during admin impersonation
Finish setUserId before returning to the client, so subscription recreation cannot race the client identity change. Add a deferred-promise regression and verify switch failures propagate.

Thanks to gleneindre and xet7 !

Fixes #6691,
2026-09-13 16:44:49 +03:00