Commit Graph
23 Commits
Author SHA1 Message Date
Lauri Ojansivu 214b20e7ad ListLockBleed: a list's write refusal holds for the checklist REST routes too.
GHSA-4734-8vrg-8j3w. A board admin can refuse a role write access in one
list (#4527, list.roleExceptions). The card and comment REST routes and the
DDP checklist writes applied that refusal; the six checklist and
checklist-item REST routes asked only the board, so a member the list
refused still created, renamed, ticked and deleted its cards' checklists
and items with an API token.

They now call assertListNotRefused with the card's list, as the card routes
do, and answer 403. The refusal is recorded in Admin Panel -> Problems as
ListLockBleed (authz.list-locked, medium: recorded, never disables the
account): no screen offers such a write, so it is the lock being stepped
round. The card routes' refusals are recorded through the same gate.

tests/listPermissions.test.cjs scans every REST write route of the tree that
names a card and fails on one that does not ask the list - not only the
per-list card routes it checked before - naming the three that follow their
own rule (a comment's edit and deletion, dependency lines, a bot run's
report), and checks the refusal is recorded. It fails on the old routes.
tests/playwright/specs/list-lock-checklists.e2e.js refuses all six writes in
a locked list with 403, leaves the checklist and item untouched, records the
attempt, and still lets the same member write in an open list and the board
admin in the locked one.

Thanks to tsurutanmen and xet7 !
2026-11-09 19:41:49 +02:00
Lauri Ojansivu d231df56fc REST API: a missing checklist, or one under another card, answers a JSON 404, not an empty 500.
GET /api/boards/:boardId/cards/:cardId/checklists/:checklistId answered 500 with
no body when the checklist did not exist or belonged to another card. It now
answers 404 with the same error text the checklist update and delete routes
use; board access and the parent-card check are unchanged. Route tests drive
the registered handler (found, missing, other card, other board, denied, lookup
failure) and a browser spec reads the checklist over REST and after a reload.

Thanks to AhmedLukman and xet7 !
2026-11-03 20:43:06 +02:00
Lauri Ojansivu 742996dcce Deleting a checklist deletes its items.
Every way to delete a checklist - the card's checklist menu, DELETE
/api/boards/:boardId/cards/:cardId/checklists/:checklistId, the
removeChecklist rule action and the durable rule plans - removed only the
checklist document; Checklists.before.remove writes the removeChecklist
activity and nothing else. Every item stayed in the database with a
checklistId pointing nowhere: invisible on the card and never cleaned
up. One production database had 2335 of them from 690 deleted
checklists.

Checklists.after.remove now removes the checklist's items with
ChecklistItems.direct.removeAsync, as deleting a card already removes
its children: no activity per item, the checklist's own removeChecklist
activity records the deletion. Items orphaned before this are left for
the administrator to decide. From the reporter's patch.

Thanks to Raymond-Voogt and xet7 !

Fixes #6816.
2026-10-27 15:06:32 +02:00
Lauri Ojansivu 4bd6a7f088 Dragging a checklist item on one's own board is no longer reported as a cross-board attack.
Dragging a checklist item within its card sets cardId and checklistId
to where the item already is. The ChecklistBleed deny rule
(GHSA-gv8h-5p3p-6hx7) checked only that the destination board was
writable, so for a comment-only member or a Worker - whose own board is
one they cannot write to - an ordinary drag tripped the high-severity
canary checklist-item.cross-board-move and named them in Admin Panel /
Problems / Security as if they had attacked another board.

The board the document is already on is no destination now. That board
is the one of its SOURCE CARD, which the allow rule decides on - not
the document's own denormalized boardId, as the reporter's patch read
it: the insert hooks kept a boardId the client sent, so an item on the
attacker's card could carry a victim board's id and would have passed
as staying while moved onto a victim card. Those hooks (checklists,
checklist items, and now text notes on the server) set boardId from the
card always. A move to another unwritable board, and an unknown
destination, are still denied and still reported.

Thanks to Raymond-Voogt and xet7 !

Fixes #6813.
2026-10-27 14:52:06 +02:00
Lauri Ojansivu 5b2ed17e6b Board role permissions apply to every board view and every path to a card.
AssignedBleed follow-up, GHSA-r4gm-mjj9-g3x8. An assigned-only member
(isNormalAssignedOnly, isCommentAssignedOnly, isReadAssignedOnly, and custom
roles through those flags) sees only the cards assigned to them. The Board
Email View checked board.isVisibleBy() alone, so it published the title,
description and email metadata of every card in a list or label, counted
them, and searched them. It now merges assignedOnlyCardScope into its folder
and search selector for the page and the count, and a reply on another card
is refused.

An audit of every path that returns or changes a card found the same shape -
"a member of the board, so every card of it" - elsewhere, all fixed here:

- reads: the board publication's ancestor cards, linked source cards with
  their subtasks and dependency targets, and comment reactions; All Boards
  tile counts; a board's activities from linked boards; the Chat view and
  the All Boards feed, which also let card MEMBERS through (assignees is the
  rule); My Attachments' card; GET /api/user/cards; position history of a
  card; the cross-board subtask picker; Scrum rollover counts; and the
  notification publications, which kept sending the full documents of cards
  named in old notifications - also to members removed from the board;
- writes on a card the member cannot see: the canonical
  canEditCardOrLinkedCard / editableCardIds (every Cards.allow update,
  checklists, items, attachments, text notes, custom fields, the shared
  description, card methods) now ask the card - the role's `write` is a
  board answer, and the card is read when a caller passed it without
  assignees; DDP and REST comments, button rules on a card, checklist moves,
  issue state, watching, the card-opened webhook, moveBoardObjects,
  moveSwimlane and attachment moves;
- REST writes: checkBoardWriteAccess refuses assigned-only members, as
  checkBoardAccess already does for reads - those routes act on any card,
  list or swimlane by id. The GHSA-f396 canary still fires for a role
  without the write capability.

A refusal no view would produce is recorded under AssignedBleed in Admin
Panel -> Problems (authz.assigned, medium: never disables); opening a view,
searching and REST calls are narrowed or refused without a record.

tests/boardRoleViews.test.cjs runs the Email View selector, pins every path
above, and fails when any server file that serves card data has no role
rule and no stated exemption; the "assignee or card member" rule is
rejected anywhere in server/ and models/. server/lib/tests/editableCardIds
adds an assigned-only case for both edit checks (meteor test; not run here).
Seven guards that pinned the old lines now pin the new ones.

Thanks to crypto-nidh, binary-lover and xet7 !
2026-10-16 13:03:34 +03:00
Lauri Ojansivu 21d7848d47 Run rule checklist creation and removal through durable Sync.
addChecklist and removeChecklist rule actions now have saved commands,
like the other durable rule actions. addChecklist inserts a checklist
whose id is derived from the rule invocation, so a replay inserts it
once, and records the hook's addChecklist activity and History lifecycle
row from the document as it was stored. removeChecklist saves every
checklist the ordinary selector matches, one unit each, and for each
writes the removeChecklist activity before the removal and the 'removed'
History row after it, refusing a checklist that changed since capture.
The checklist hooks are deferred only for the checklist a command names.

Thanks to xet7 !
2026-10-02 15:40:57 +03:00
Lauri Ojansivu 6d99ad73c4 Preserve time history and record reversible move reasons
Keep card and checklist activity after deletion, retain card snapshots for
flow reports, and show recorded hour adjustments by their actual author in
Time and its PDF/Excel exports. Record whole positions centrally, including
optional move reasons and direct REST edits. Append undo/redo checkpoints
so blocker intervals and time corrections follow reversals through time.

Audit the open time-related requests against existing features. Exact inline
activity timestamps requested in #1673 already exist in dateDisplay and the
activities template; add a browser regression for that existing behavior.

Reuse established locale terminology for the new compact labels. Labels
outside English and Finnish are low-confidence glossary combinations for
human review; existing translations remain untouched.

Validation: 43 focused Node suites pass. Fifteen Chromium scenarios pass
across flow analytics, time history and existing REST move coverage, including
real chart and Time PDF/Excel exports, undo/redo, retention and access denial.

Thanks to ladistrupl, zombah and xet7 !

Fixes #1598,
Fixes #1673,
2026-09-26 23:00:58 +03:00
Lauri Ojansivu 70202a849b Add checklist deadlines and expose checklist item dates in REST
Add optional checklist dueAt with the shared selected-calendar picker and badge. Return checklist and item deadlines from checklist and single-card GETs. Accept validated timezone-qualified ISO deadlines in checklist/item POST and PUT; null clears, omission preserves. Keep existing write permissions and ownership checks. Node regression and Chromium save/clear test pass.

Thanks to rmb82 and xet7 !

Fixes #6693,
2026-09-15 00:54:45 +03:00
Lauri Ojansivu 9b1fb5214f Require board write capability for list moves and sibling mutations
Enforce the canonical role policy for both sides of list, swimlane and checklist moves, scoped imports, attachment renames and history writes. Record denied attempts through bounded Problems summaries without allowing logging failures to bypass authorization.

Add role-matrix decisions, the reported moveList attack, sibling guard inventory and a browser regression. Targeted Node suites pass; live browser execution remains pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:47:29 +03:00
Lauri Ojansivu 099ab39dd4 Add PUT endpoints for a checklist's title and a comment's text over the REST API.
Auditing the REST API surface against #1037 found two clean CRUD gaps:
every other board sub-resource with GET/POST/DELETE already had a
matching PUT, but a checklist and a comment did not, so editing either
meant deleting and re-creating it.

PUT /api/boards/:boardId/cards/:cardId/checklists/:checklistId renames
a checklist (title only), mirroring the existing DELETE's lookup and
checkBoardWriteAccess check.

PUT /api/boards/:boardId/cards/:cardId/comments/:commentId edits a
comment's text, reusing validateCommentBody and the same
assertCanMutateComment rule (and foreign-edit canary) the DELETE
handler already applies.

tests/restApiEditGaps.test.cjs pins both routes as source-pattern
tests, the same way tests/restApiIdorBatch.test.cjs already does for
this REST surface.

Thanks to mayjs and xet7 !
2026-09-10 21:11:34 +03:00
Lauri Ojansivu 828fc2d718 Revert Legacy HTML4 browser interface and parity changes
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 !
2026-09-07 17:03:59 +03:00
Lauri Ojansivu 5791df505e Add accessible checklist item conversion 2026-09-06 21:37:59 +03:00
Lauri Ojansivu b66ced92cb Add accessible checklist copy and move 2026-09-06 21:21:08 +03:00
Lauri Ojansivu b5bf9ac1d8 Add accessible HTML4 checklist controls 2026-09-06 21:14:10 +03:00
Lauri Ojansivu 1fa0b158ca Fix REST authorization and error handling.
Thanks to Char0n1507, senti-man and xet7 !
2026-08-22 23:50:26 +03:00
Lauri Ojansivu f0bce67a3b More Import Export and Rules features.
Thanks to xet7 and Claude !
2026-06-15 04:07:33 +03:00
Lauri Ojansivu 08ae61161c Fixed TokenBleed: unauthenticated login-token minting via un-awaited auth check in
`POST /api/createtoken/:userId`](https://github.com/wekan/wekan/blob/main/CHANGELOG.md)
(CWE-863, CWE-287). `Authentication.checkUserId` in `server/authentication.js` is an
`async` function, so its 401 (undefined `userId`) and 403 (not an admin) throws become
rejected promises rather than synchronous exceptions. The REST handlers in
`server/models/users.js` and `server/models/boards.js` called it without `await` inside a
plain synchronous `try/catch`, which cannot catch a rejected promise, so the failed check
never stopped execution. `POST /api/createtoken/:userId` then went on to mint and return a
usable login token for any user ID in the URL — including an admin — with no credentials at
all (unauthenticated account takeover). The same detached-rejection bypass also affected
`GET /api/users`, `GET /api/users/:userId`, `PUT /api/users/:userId`, `POST /api/users/`,
`DELETE /api/users/:userId`, `POST /api/deletetoken`, `GET /api/boards`,
`GET /api/boards_count`, `DELETE /api/boards/:boardId`, `GET /api/users/:userId/boards` and
`POST /api/boards/:boardId/copy`. Fixed by awaiting every async `Authentication` check (and
making the two non-`async` handlers `async`) so a failed check rejects before any privileged
code runs. The same un-awaited pattern in the board/card/Excel/PDF export handlers
(`models/export.js`, `models/exportExcel.js`, `models/exportExcelCard.js`, `models/exportPDF.js`,
which were backstopped by `exporter.canExport()`) and in the checklist-create handler
(`server/models/checklists.js`) was given the same await pass. Affected Wekan v9.35 and earlier.

Thanks to Zion Boggan, xet7 and Claude.
2026-06-10 19:39:05 +03:00
Lauri Ojansivu 075e86b00e **Fixed new checklists (and checklist items) on a newly added card not being
visible until logout/login.** The `board` publication batched checklists,
checklist items, comments and attachments into board-level cursors filtered by
`cardId: { $in: cardIds }`, where `cardIds` was a one-time snapshot. In
`reywood:publish-composite` a child cursor only re-runs when its parent (the
board) document changes, so the snapshot never refreshed when a card was added
— a checklist on a card created after subscribing matched no published card and
only appeared on the next subscribe (logout/login). This was a regression from
the "Optimized board loading" change, which had replaced the original reactive
per-card child cursors with these batched snapshots. Fixed by **denormalizing a
`boardId` field onto `Checklists` and `ChecklistItems`** so they can be
published with a single board-level cursor filtered by `boardId` — one cursor
per collection (keeping the load optimization) that still reacts to checklists
on newly added cards, because a new checklist is created already carrying the
board's id. `boardId` is set on insert (server `before.insert` hooks, plus
explicitly in the Trello/WeKan board importers, which use `direct.insert` and
bypass hooks), re-derived when a checklist/item or its card moves to another
card (`before.update` on `cardId`) or the card moves to another board
(`Cards.after.update` cascade), and backfilled for existing data by an
idempotent startup migration. New `{ boardId: 1 }` indexes were added on both
collections. Comments and attachments instead remain reactive as per-card
children of the cards cursor. Assigned-only board members still only receive
checklists for cards assigned to them (the board-level cursor falls back to the
assigned cards' ids for those roles).

Thanks to ahlgrimma and Claude !

Fixes #6361
2026-06-06 04:02:48 +03:00
Lauri Ojansivu 72767ad9a7 - Fixed SyncedCron crash.
**Fixed deleting archived lists (or many cards) crashing the server with
  `SyncedCron: Fatal error encountered (unhandledRejection): TypeError: Cannot
  read properties of undefined (reading 'boardId')` at
  `server/models/checklistItems.js`.** Deleting a list cascades into removing its
  cards, and each card's checklists, checklist items, comments and attachments
  (`cardRemover` in `models/cards.js`). `Cards.before.remove` called `cardRemover`
  **without `await`** (and was not `async`), so the card document was deleted
  first and the cascade then ran with the parent card already gone; the
  `ChecklistItems.before.remove` / `Checklists.before.remove` hooks dereferenced
  the now-undefined card (`card.boardId`) and threw, and because the promise was
  unhandled, SyncedCron caught the rejection and tore down all running cron jobs.
  Fixed by making `Cards.before.remove` `async` and awaiting `cardRemover` (so
  sub-items are removed while the card still exists), and the REST card-delete
  handler now runs `cardRemover` before removing the card. As defense in depth,
  every card-activity hook and helper that looked up a card and used its
  `boardId` / `listId` / `swimlaneId` now skips (with a warning) when the parent
  card — or, for checklist-completion activities, the parent checklist — is
  missing, instead of throwing: `before.remove` on checklist items and
  checklists, `Checklists.after.insert`, the `Cards.before.update` timing
  activity, and the shared `itemCreation` / `publishCheckActivity` /
  `publishChekListCompleted` / `publishChekListUncompleted` / `commentCreation`
  helpers (matching the guards already present in
  `server/models/cardComments.js`).

Thanks to titver968 and Claude !

Fixes #6366
2026-06-06 03:10:13 +03:00
Lauri Ojansivu 39f3c89b0a Fixed upgrade crash.
Thanks to poc-sm and Claude !

Fixes #6367
2026-06-06 02:53:58 +03:00
Lauri Ojansivu 357de728c0 Fix [CloneBleed](https://wekan.fi/hall-of-fame/clonebleed/) and other security issues. Added more security tests to test suite.
Thanks to dizconnectz for the coordinated disclosure, and Claude.
2026-06-05 21:40:24 +03:00
Lauri Ojansivu 8baa9124a6 Fix CRITICAL SECURITY ISSUE BFLABleed https://wekan.fi/hall-of-fame/bflableed/
Thanks to Fredrik Dietrichson and xet7 !
2026-05-21 09:33:25 +03:00
Harry Adel 63ce45c538 Split shared models from Meteor 3 server runtime 2026-03-24 01:50:39 +02:00