Commit Graph
67 Commits
Author SHA1 Message Date
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 5c1f6088f4 Fix CreateBleed: "Only admins can create boards" holds on every path.
GHSA-qcfm-2g4w-wqcc. Admin Panel / Settings / Visibility / "Only admins
can create boards" (#4475) was checked only inside
createBoardWithInitialSwimlanes, the Add Board form. A non-admin still
created working boards by a client Boards.insert (Boards.allow.insert
approves any signed-in user), POST /api/boards and both board import
routes, as reported, and also by importBoard, cloneBoard, copyBoard,
POST /api/boards/:boardId/copy and createBoardFromCard.

One decision (models/lib/boardCreationPolicy.js) and one guard
(server/lib/boardCreationGuard.js) are asked by every one of those paths
before they write, and by a new Boards.deny insert rule. A board template
stays every member's own; boards WeKan makes itself (a Templates container,
a board's subtasks board) are not created by the user. A REST refusal is
403. A refusal is recorded in Admin Panel / Problems as CreateBleed
(authz.board-creation, low, CWE-863, blocks no account), and Duplicate and
"Create board from card" are hidden like Add Board, so only a client
bypassing the interface reaches it.

tests/createBleed.test.cjs drives the decision, the guard and the real deny
rule against the reporter's console insert, and fails if any path that
creates a board for a user does not ask the guard, or if anything else
reads the setting. tests/playwright/specs/createbleed-board-creation-admin-only.e2e.js
replays the report against a running server. The guards that pinned the
old inline check now pin the shared one.

Thanks to tsurutanmen and xet7 !
2026-11-07 00:51:53 +02:00
Lauri Ojansivu e3458004ec Fix GroupLinkBleed: board admins can no longer attach foreign teams or add members by direct board writes.
GHSA-v544-rmr5-38gx. Boards.allow lets a board admin update any field of
their board, and two checks existed only inside Meteor methods: a board
admin may add only the organizations and teams they belong to (#5141,
setBoardOrgs/setBoardTeams), and inviteUserToBoard's checks (who may
invite, disabled accounts, the #6116 same organization/team policy). A
client calling /boards/update or /boards/insert directly skipped both.

New Boards.deny rules refuse any client insert or update naming orgs,
teams or domains - the UI changes them only through the board methods,
which write server-side - and any client update that adds a member or
switches a removed member back on (models/lib/boardWriteGuards.js). Role
changes and removals, which the client writes itself, still pass. A
refusal is recorded in Admin Panel / Problems as GroupLinkBleed
(authz.group-link, authz.member-add, medium).

tests/groupLinkBleed.test.cjs runs the real deny rules in a vm against
the reported writes and every legitimate client write, and fails if a
method-guarded board field is client-writable; it fails without the fix.
tests/playwright/specs/group-link-bleed.e2e.js replays the attack over DDP.

Thanks to bhaswanthc and xet7 !
2026-11-06 16:15:34 +02:00
Lauri Ojansivu a40c4495d4 Lists: a WIP limit is set by a board admin, on every path.
The applyWipLimit, enableWipLimit and enableSoftLimit methods have always
required a board admin ("You must be a board admin to modify WIP
limits."), but a member with write access could still set wipLimit with a
plain list update - the Lists allow rule grants write members every field
- or with REST PUT /api/boards/:boardId/lists/:listId. A WIP limit is a
board-wide workflow rule, so the methods' rule now holds everywhere:

- a Lists deny rule refuses an update touching wipLimit unless the caller
  is admin of the list's board. Every WeKan client path goes through the
  methods, so it refuses nothing in ordinary use;
- the REST PUT asks for a board admin (checkBoardAdmin) when the body
  carries a wipLimit; write access still edits title, color and starred.

tests/wipLimitAdminOnly.test.cjs runs the real deny rule, pins the REST
check before the write, and fails on any list method that changes a WIP
limit without a board admin check first.

This was in CHANGELOG TODO Later as needing a maintainer decision;
decided: board admins only.

Thanks to xet7 !
2026-10-27 21:45:43 +02:00
Lauri Ojansivu 51111e1958 StampBleed and UploadBleed: documents on one's own card stamped with another board, and unauthorized attachment uploads.
StampBleed (found reviewing the patch for #6813): checklists, checklist
items and text notes carry a denormalized boardId, by which the board
publication publishes them, and items a checklistId, by which a
checklist draws them. The insert allow rules check write access on the
document's card only, and the server's insert hooks kept a boardId the
client sent. So a member of any board could insert, on their own card,
a document stamped with a private board's id - published to that
board's members - and an item with that board's checklist id, drawn in
it. 4bd6a7f088 made the server take boardId from the card; now the
forged insert is refused outright and recorded, for those three and for
a direct attachment insert with a foreign meta.boardId. WeKan's own
client never sends a mismatch.

UploadBleed: Meteor-Files' upload pipeline (_FilesCollectionStart_
attachments / Write and its HTTP twin) inserts the stored attachment
SERVER-side, so the allow rules were never asked, and the attachments'
onBeforeUpload only cleaned the file name: any DDP client, signed in or
not, could put a file on any card of any board - published to its
members with an addAttachment activity and its notifications - and the
admin's uploads-blocked switch was skipped too. The upload is
authorized on every chunk now: signed in, allowed to edit the card (or
write the board, for a background or map image), uploads not blocked,
and a card attachment's board, list and swimlane are its card's.

Both are recorded in Admin Panel / Problems (authz.card-child-stamp,
authz.attachment-upload), once per upload. tests/stampBleed.test.cjs and
tests/uploadBleed.test.cjs run the real decisions, and fail on a card
child with no insert board check or a FilesCollection without a server
upload check; upload-stamp-bleed.e2e.js attacks the running server.

Thanks to xet7 !
2026-10-27 15:38:58 +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 425b4ddea7 An ordinary refused edit on one's own board no longer disables the account.
Accounts were disabled for members working on their own board; one
instance lost four in three days, each user then refused at login 81
times.

- A Worker may move a card (#3189) and tick a checklist item (#3307),
  but canUpdateCard and the checklist item rule asked
  canEditCardOrLinkedCard first, which recorded authz.linked-write (high,
  blocked) before the Worker carve-out allowed the change, and that
  record disables the account. Both now ask without recording first, and
  record only a change that is still refused after the carve-outs.
- A read-only or comment-only member whose screen still offered an edit
  (a role changed while the board was open) was refused with the same
  record. authz.linked-write keeps being recorded and the write keeps
  being refused, but it no longer disables the account (blocksAccount:
  false, as ssrf.webhook since #6782).

tests/workerNoSelfBlock.test.cjs runs canUpdateCard and the checklist
item rule from their own source: a Worker's move and tick are allowed
with nothing recorded, other refused edits are still recorded, the
catalog entry never blocks through blockOnSecurityEvent's own decision,
and no rule with a Worker carve-out records before it. It fails on the
code before this commit. boardRoleViews follows the two-step check.

Thanks to Raymond-Voogt and xet7 !

Fixes #6798,
2026-10-22 19:28:49 +03: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 7ca1489279 Checklist items get a person responsible, and dated items show in the calendar and Gantt.
Each checklist item gets a "who is responsible" button: the board's
active members to pick from, or nobody; the avatar then shows on the
item. A deny rule keeps the responsible person an active member of the
item's board. Checklist items with a due date (#4755) now appear in the
calendar and in the Frappe and dhtmlx Gantt views as "card: item", with
their own `ci:` ids: opening one opens its card, a calendar drag of one is
refused, and moving one in a Gantt moves only the item's own due date -
never the card's dates.

models/lib/checklistItemSchedule.js collects dated items (not of archived
or missing cards) and decides who may be responsible;
tests/checklistItemSchedule.test.cjs covers both and the wiring of the
three views. tests/checklistItemDueDate.test.cjs, which pinned #4755 as
"due dates only", now says the assignee is #1618's own field. The new
strings are English placeholders until the next translation pass.

Thanks to martinbruno90 and xet7 !

Fixes #1618.
2026-10-14 15:24:57 +03:00
Lauri Ojansivu 509f1d97fc Refuse a rule naming another board's trigger, and match rules on their own board (RepointBleed sibling).
Reviewing the legacy direct Rules writes: a board admin of their own board
could save a rule that named a trigger of a board they do not administer.
Only that board's own rules run on its activities, but the matcher took a
trigger's rule from Trigger.getRule() - whichever rule named it first - so
the other board's own rule could silently stop running. The matcher now
looks up the trigger's rule on the activity's board, and a DDP insert or
update of a rule naming another board's trigger is refused and recorded in
Admin Panel / Problems under RepointBleed (no client names one: the rule
editor creates the trigger on the rule's board first).

Tests: tests/repointBleed.test.cjs (the decision for insert, $set,
$addToSet and $push, the negatives, and the matcher's source), and a server
test that, without the change, accepted the foreign rule and lost the
victim board's rule.

Thanks to xet7 !
2026-10-03 10:26:48 +03:00
Lauri Ojansivu 6d3b27aeb6 Refuse a card insert naming another board's list or swimlane (BoardBleed sibling).
A client could insert a card on a board it may write to while naming the
list and swimlane of another, private board. The card stayed on its own
board, but its creation activity carried that list's and swimlane's titles
and the board's rules saw them, so a member could read the names of
another board's lists by id. The server's own copies already check their
destination (server/lib/cardCopyDestination.js); DDP inserts now do too,
and refuse such a card. No client sends one, so the attempt is recorded in
Admin Panel / Problems under BoardBleed (canary card.foreign-placement).

Found while reviewing the client-side template copy writes, which go
through the same Cards insert rules: a template or linked card is always
created on the board that owns its list.

Tests: a server test that refuses another board's list and swimlane with
no card or activity written and allows the board's own, failing without
the rule; the canary catalogue and coverage suites; and the template,
linked-card, card-copy and card browser specs in Chromium.

Thanks to xet7 !
2026-10-03 10:20:29 +03:00
Lauri Ojansivu c15f9486d8 Name today's fixes for the Hall of Fame and give two of them their own Problems keys.
TrayBleed (notification tray writes) and CasTokenBleed (a CAS callback from
a browser that did not start the login) get catalog keys of their own; each
new fix's test names its vulnerability. ReadOnlyBleed gets the permissions
test it was recorded without, pinning the six Custom Field handlers and
requiring a write-level decision on every mutating REST route.

Thanks to xet7 !
2026-10-02 11:53:09 +03:00
Lauri Ojansivu cd07d8db18 Let clients only mark and remove notification entries, never add them.
profile.notifications fell under the client-writable profile.*, and an entry
names an activity whose card, comments, checklists and attachments the
notification publications then send from any board. A client may now only
set an entry's read state and pull entries; anything else is denied and
recorded in Admin Panel -> Problems.

Thanks to xet7 !
2026-10-02 11:39:25 +03:00
Lauri Ojansivu f9d9596e2a Restore models/lib/boardBackground.js, which the BackgroundBleed fix overwrote.
146d58df27 created models/lib/boardBackground.js for isOwnBoardBackground - but
that file already existed: computeBoardBackground, which the client uses to
switch board backgrounds (#4978). Overwriting it broke background switching in
the UI and tests/boardBackground.test.cjs. The original is restored, and the
BackgroundBleed rule lives in models/lib/boardBackgroundOwnership.js, used by
both download paths and the Boards deny rule.

Thanks to xet7 !
2026-10-02 11:16:50 +03:00
Lauri Ojansivu ebcaac1962 Close the OwnerBleed DDP sibling: a client board insert names only its creator as member.
The REST fix ignores owner and role fields, but Boards.insert from a client
accepted its own members array, so a user could create a board that names
somebody else as its admin, or adds people as members who never joined. The UI
sends no members (the schema makes the creator the sole admin), so a client
insert naming anyone else is refused and recorded as OwnerBleed - which now has
a Problems key and leaves the pending list.

Thanks to xet7 !
2026-10-02 11:06:41 +03:00
Lauri Ojansivu e14671efa6 Close the AvatarMimeBleed prefix-route sibling, and stop clients changing a file's type or board.
The /cdn/storage/avatars and /cfs/files/avatars routes in the universal file
server answer before avatarServer.js, and served an avatar inline under its
stored type unless that type exactly matched a short dangerous list -
'text/html; charset=utf-8' did not - with no CSP. An avatar's owner could set
that type from the client, so an image-looking upload could be re-labelled
and served as HTML on WeKan's origin. Only known raster image types are now
served inline, under their canonical name with a restrictive CSP; anything else
is a sandboxed download.

The client rules for avatars and attachments allowed updating type, extension,
size and meta - meta names an attachment's board and card, so a file could be
moved onto another board's card. No client updates these documents; only the
name may change now.

Thanks to xet7 !
2026-10-02 11:05:59 +03:00
Lauri Ojansivu 3d080956be Close the PositionHistoryBleed sibling: no client-written history, and undo/redo stay within the entry's boards.
Clients could insert position-history entries as long as the entry's boardId
and previousBoardId were boards they belonged to. Nothing tied the entry's
card, list, swimlane or checklist item to those boards, and redo had no check
at all, so a member could forge an entry naming another board's card - or a
newBoardId, or a delete/restore action - and undo/redo would move it into
their own board or soft-delete another board's list with its cards.

The server records history itself (trackChange), so client inserts are now
refused outright. Undo and redo first check that the entity is still on one of
the entry's own boards (a cross-board card move is recorded under the board it
left) and that the user can write there and on the destination. Refusals trip
the existing history.cross-board canary. Unit and browser tests; the test that
pinned the weaker insert rule pins the stronger one.

Thanks to xet7 !
2026-10-02 11:04:02 +03:00
Lauri Ojansivu 146d58df27 Fix BackgroundBleed: a board's background can only be one of its own attachments.
GET /api/attachment/download-background/:boardId and the
api.board.downloadBackground method returned whatever attachment
board.backgroundImageId named, checking only board membership, and a board
admin could set that field to any attachment id. Anyone could create a board,
point its background at an attachment on someone else's private board, and
download the file.

Both download paths now serve only a live attachment of the same board, and a
Boards deny rule refuses setting backgroundImageId to anything else. Refusals
record BackgroundBleed (the UI only offers the board's own backgrounds). The
negative test fails on any server code that streams a backgroundImageId
without the check; a browser test covers both the update and a planted pointer.

Thanks to xet7 !
2026-10-02 10:41:31 +03:00
Lauri Ojansivu c5eb9fc060 Close the MegaBleed/TenantBleed Translation sibling: custom translations are site-admin only.
The Translation collection's client rules let any logged-in user insert,
update or remove a document whose _id equalled their own user id - the same
mistake TenantBleed removed from Org and Team. Custom translations replace UI
and e-mail text for everyone and several render as HTML
({{{_ 'board-public-info'}}}, the legal notice), so a member could plant markup
that runs in an admin's browser. The MegaBleed fix had guarded only the
methods. All three rules now use the shared site-admin rule, which records a
refused attempt in Problems; the negative test fails on any permissions file
that authorizes by document id. Browser test included.

Thanks to xet7 !
2026-10-02 10:40:19 +03:00
Lauri Ojansivu f02da1bfd2 Fix RepointBleed: board-owned rule, webhook and custom-field documents cannot be moved to another board.
Triggers, Actions, Rules and Integrations were allowed to a board admin of the
board the document was on BEFORE an update; nothing refused the update itself
changing boardId. Any registered user, admin of a board they created, could
move a rule trigger to '*' or unset its board - which the rule matcher matched
on every board - and have a send-email action mail them cards, comments and
attachments from every private board; or move a webhook integration onto a
private board and receive its activity, or rewrite its comments through a
two-way hook. Custom fields accepted a board list if the caller could write to
ANY board in it, so a field could be planted on (or pulled from) a board
without access; comment reactions could be moved onto another comment.

A shared deny rule now refuses any client update that changes those
documents' board, custom fields need write access on every board they are put
on or taken off, and the rule matcher runs a rule only for activity on its own
board. Refusals record RepointBleed in Admin Panel -> Problems (high: no client
changes these fields). Unit, negative (every board-owned permissions file) and
browser tests.

Thanks to xet7 !
2026-10-02 10:34:38 +03:00
Lauri Ojansivu a904ca8807 Let a card be a subtask of several parent cards.
"A must be done before B and C can start, so A is a subtask of both." A card
now keeps every parent in parentIds, with parentId still the primary one
(parentIds[0]), so everything that reads one parent keeps working and a card
written before this has its one parent. Picking an existing card as a
subtask adds this card as a further parent instead of replacing the one it
had; Card -> More lists the other parents and removes one, and choosing the
primary parent keeps the others. Children are found under any parent - the
subtask list and counter, the parent filter, rule email Details and the
exports - and the loop guard and the board publication walk every parent.
Archiving or deleting a card takes only the subtasks it is the one parent
of; a shared subtask just loses it. Every parent written must be on a board
the writer can see (GHSA-jvv9-498p-hxrg), and board copy and WeKan import
remap all of them. The old single-parent walker is removed.

Thanks to ikomhoog and xet7 !

Fixes #3626,
2026-09-29 17:59:21 +03:00
Lauri Ojansivu f122a8287c Add semi-open boards, visible to every signed-in user.
A board's visibility can now be "Signed-in users" (permission 'instance'):
every signed-in user of this WeKan reads it, nobody signed out does, and
only its members edit it, as on a public board. One pure rule,
models/lib/boardPermission.js, feeds isVisibleBy and the shared selector
builder, so the board and card publications, All Boards, search, exports,
attachments, backgrounds, watching, filter presets and rule destinations
follow it. Anonymous paths - link previews, public avatars, the no-token
export branch and archived lists - stay public-only, and a source suite
lists every remaining public-only check so a new one is reviewed. The
Public page and GET /api/boards list instance boards for a signed-in caller
only; "private boards only" refuses them like public ones; a WeKan export
keeps the setting on import. New strings are English, pending Transifex.

Fixes #3249,

Thanks to relikd and xet7 !
2026-09-29 16:28:44 +03:00
Lauri Ojansivu 89a65ee7ce Enforce admin-only custom fields across server boundaries
Fix AdminFieldBleed (GHSA-m8gh-2h78-f57x): redact protected values from publications, API responses, method results, History and analytics; constrain value searches and refresh live permissions.

Guard inserts, full-array modifiers, copying and shared definitions at the request write boundary. Require authorized exports and summarize explicit attacks in Admin Panel Problems. Add positive, negative and Chromium regression coverage.

Thanks to Hama1cco and xet7 !
2026-09-28 21:46:56 +03:00
Lauri Ojansivu 29872ab9f5 Protect private webhook comment evidence across reads writes and copies 2026-09-28 12:55:11 +03:00
Lauri Ojansivu c50d7b4ea7 Authorize subtask deposit reads and destination writes
Remove unvalidated deposit and null board IDs from source-card scope. Publish deposit content beneath its own reactive visibility-filtered board cursor, applying destination assignment restrictions and reactive card children. Filter status counts by visible assigned scopes.

Require destination write access before pointer changes and subtask landing structures, and deny client pointer rename bypasses. Summarize blocked writes in Problems. Positive decisions, scope/dispatcher inventory and existing subtask/status suites pass; browser regression syntax-check passes with live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 12:09:35 +03:00
Lauri Ojansivu 26e9e70304 Prevent linked cards from promoting non-writing source roles
Require source write access for authoritative and DDP link creation, including pointer changes. Treat explicit non-writing source roles as a ceiling on delegated writes, covering legacy self-created links. Match UI permissions and remove the link action from the non-writer menu. Record denied writes in bounded Problems summaries.

Actual shared permission decisions for every role, creation/deny inventory and existing link and role suites pass. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 12:05:14 +03:00
Lauri Ojansivu 055cf42d49 Protect server-issued invitations from client profile updates
Reject invitation field writes, array mutations, parent replacement and rename destinations. Inspect actual modifier paths so top-level profile field reporting does not block ordinary preference updates. Record denied invitation changes through bounded Problems summaries.

Profile guard and existing invitation suites pass. Browser regression syntax-check passes; live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:55:21 +03:00
Lauri Ojansivu d7ac619d63 Bind comment inserts to the authorized card board
Reject foreign-card REST and DDP comment inserts and prevent DDP rebinding from bypassing the boundary. Keep card-authoritative legacy comment listing. Add bounded Problems summaries and attack, negative insert inventory and browser regression coverage.

Targeted Node suites pass; browser regression is syntax-checked with live execution pending.

Thanks to Wenhao Wu, Southeast University and xet7 !
2026-09-14 11:49:40 +03:00
Lauri Ojansivu dce2898382 Attachments: soft delete on the card, restore from the card history, hard delete only with the archived board.
Delete on an attachment used to remove the document and its file at once.
It is now the 'attachments.softDelete' method (History.md section 12): the
document gets deletedAt/deletedBy/deleteBatchId with the same helpers lists
use, the file is kept, and the card's cover is unset if this was it. Every
card-facing read - the opened card's gallery and "Attachments (N)" count,
the minicard paperclip badge, the slideshow, the cover, the board-background
picker, My Attachments, the API list endpoints and the exporters - filters
to live attachments with liveAttachments(); the publications keep sending
the deleted ones so the card history can reach them.

The card history records who deleted it and when, with the filename in the
row. Restore - the table's selection + Restore, or the row's own Restore
button, both through changeHistory.restore and applyAttachmentContent -
clears the mark, so the card, its count and the minicard badge include the
attachment again; the cover is never re-set. An attachment row previews
with the existing attachmentViewer slideshow and downloads with the same
link the gallery draws, and never offers cover or background. Uploads and
renames are recorded through the existing history hooks.

There is no per-attachment hard delete any more: api.attachment.delete,
DELETE /api/attachment/delete/:id and removeBoardBackground soft-delete,
permanentlyDeleteAttachmentFromFilesReport and the Files report's delete
button are gone, Attachments.allow remove and onBeforeRemove refuse every
client remove and log the attempt under Admin Panel / Problems. The one
hard delete is Admin Panel / Problems / Delete enabled, board archived,
board deleted from the archive: boardRemover now removes every attachment
of the board, live and soft-deleted, with its file.

One new i18n key, attachment-soft-delete-pop, replaces the "permanent, no
undo" confirmation text; it is inserted in English into every locale at
the same position for translation.

Thanks to xet7 !
2026-09-11 21:17:33 +03:00
Lauri Ojansivu bc8caeba5d Add a per-card markdown text note, editable in a popup (#595).
A card's own description was the only place to put markdown text, so anything
beyond a single block had to be crammed into it. This adds CardTextNotes: a
small collection of named markdown notes per card, modeled on Checklists (a
denormalized boardId, the same publish/allow/deny shape, the same
GHSA-gv8h-5p3p-6hx7 cross-board-move guard).

Each note renders as a tile with its title and a markdown-rendered preview
(the `viewer` template). "Add text note" and a note's "Edit" open a popup
that reuses the description's own `editor`/`viewer` widgets verbatim - no new
markdown editor was written. "Delete" removes the note, scoped to its own
_id.

Wired into the reactive cache (getCardTextNote/getCardTextNotes, matching the
CardComments pattern), the board/linked-card/lazy-window/single-card
publications, and server/permissions/cardTextNotes.js.

tests/cardTextNotes.test.cjs pins: the model's cardId/boardId scoping, the
allow/deny permission shape, the popup's reuse of `editor`/`viewer` (positive:
+editor is used; negative: exactly one `editor` and one `viewer` template is
declared anywhere under client/components/{cards,main} - the whole tree, not
just the new files, so a competing widget cannot be introduced elsewhere
either), and that add/edit/delete are scoped calls rather than broad
selectors.

Thanks to Lapin0t and xet7 !

Closes #595,
2026-09-10 21:29:22 +03:00
Lauri Ojansivu 76dcb6575a Add an "Admin only" flag on custom field definitions (#3141).
A custom field marked Admin only has its value hidden from - and cannot be
set by - a non board-admin board member: not on the card detail view, not on
the minicard, not in the card's "assign a custom field" popup list, and not
through the setCardCustomFieldCheckbox/setCardCustomFieldCurrency Meteor
methods or a direct client write of customFields.<index>.value. The toggle
itself, in the custom-field definition editor, is only rendered for and only
writable by a board admin (CustomFields.allow's update/insert rules now check
board.hasAdmin() specifically for the adminOnly field, on top of the existing
write-access check every other field edit already requires).

models/lib/customFieldsWD.js gets a small pure filterAdminOnlyDefinitions()
helper so the gate has one tested choke point: models/cards.js's
customFieldsWD() - shared by both the card-detail and minicard templates -
filters admin-only definitions out before matching them to a value, and
client/components/cards/cardCustomFields.js reuses the same helper for the
popup's field list.

Thanks to CarloRampini and xet7 !

Closes #3141,
2026-09-10 20:34:30 +03:00
Lauri Ojansivu 4d9282359e Let a global Admin Panel admin edit/delete any board, not only their own.
A board's own admin/member could leave the organization (or be removed)
and leave nobody - not even a global site admin - able to edit its
settings, add members to it, or archive/delete it: Boards.allow's
update/remove rule only checked board.hasAdmin(userId) against the
board's own member list. inviteUserToBoard already had a bypass for
Meteor.user().isAdmin; the whole-board update/remove rule did not.

server/lib/utils.js gets isBoardAdminOrSiteAdmin (pure, unit-tested) and
allowIsBoardAdminOrSiteAdmin (the async Meteor.users-aware wrapper), and
server/permissions/boards.js's update/remove rules now use it instead of
the board-only allowIsBoardAdmin. Scoped to the whole-board rule only -
the narrower rules/actions/triggers/comments allow rules keep the
board-only check, pinned by a negative test.

Thanks to relikd and xet7 !
2026-09-10 20:04:07 +03:00
Lauri Ojansivu af847bd088 Let a Worker check/uncheck a checklist item without editing or deleting it.
A Worker's checkbox was gated behind the same canModifyCard/write check that
also gates editing and deleting a checklist item, so it never drew a
clickable box at all - the server's allow rule refused the write too. Give
checking/unchecking its own, narrower capability (like the existing
move/self-assign carve-out for cards, models/lib/workerCardWrite.js): a
Worker may $set isFinished and nothing else on a checklist item
(models/lib/workerChecklistItemToggle.js), enforced field by field in
server/permissions/checklistItems.js. The client mirrors it with
Utils.canCheckChecklistItem / the canCheckChecklistItem Blaze helper, so
client/components/cards/checklists.jade now draws the checkbox under that
helper while everything else on the row (title edit, drag handle, due-date
edit, delete) still requires the full write capability.

Thanks to mweiss237 and xet7 !

Fixes #3307,
2026-09-10 20:00:09 +03:00
Lauri Ojansivu 9947e0138a Fix 4 security advisories in Attachments/Avatars (ostrio:files 3.0.1).
CRITICAL - Unauthenticated Arbitrary File Write via Path Traversal in
Attachment Upload namingFunction: Attachments overrode ostrio:files'
sanitize() to an identity function and used the client-supplied fileId
verbatim as the on-disk file name, so an anonymous upload with
fileId: "../../../../tmp/pwn" could write attacker-controlled content
anywhere the WeKan process can write. sanitize() is restored to the same
whitelist models/avatars.js already used for the same tokens, and
namingFunction now validates the (sanitized) fileId against the ObjectId
shape WeKan itself generates, regenerating a fresh one otherwise.

CRITICAL - Unauthenticated DDP Methods _FilesCollectionRemove_attachments/
_FilesCollectionRemove_avatars Allow Instance-Wide Deletion: ostrio:files
registers its own remove method, gated only by allowClientCode and never
routed through Attachments.allow/Avatars.allow (those only gate the
ordinary Mongo .remove() call). Attachments had no onBeforeRemove at all
and Avatars' unconditionally returned true, so any anonymous DDP caller
could pass selector {} and wipe every attachment or avatar on the
instance. Both now require this.userId and check every matched file:
attachments need the caller's board-write access, avatars need ownership
or site-admin status.

High - Avatars Collection Lacks `protected` Callback: unlike Attachments,
Avatars never set `protected`, so ostrio:files' own library-native
download route (its _checkAccess defaults to allowing everything when
`protected` is unset) served any avatar to anyone, bypassing
isAuthorizedForAvatar entirely. Avatars.protected now mirrors
Attachments.protected: any authenticated caller, or an anonymous one only
when the avatar's owner is on a public board.

High - serveLegacyAvatar Serves Legacy CollectionFS Avatars Without Any
Authentication: both call sites in server/routes/avatarServer.js streamed
a legacy avatar to any caller who knew its old filerecord id, one of them
(/cfs/files/avatars) with no check at all. Both now require an
authenticated caller (isLegacyAvatarAuthorized) - legacy records carry no
owner/board link that can be safely checked for the public-board
exemption current avatars get, so this is deliberately narrower rather
than reusing that exemption on an unverifiable claim.

Both CRITICAL fixes log a blocked attempt through the shared security log
(new authz.file-remove/WipeBleed catalog key, and the existing
authz.file-path/PathBleed key), so Admin Panel / Problems shows an
attempt was made. tests/attachmentAvatarSecurityAdvisories.test.cjs pins
all four fixes and the negative cases (no dangling anonymous bypass, no
regression to the legitimate admin avatar-delete and public-board
redirect flows).
2026-09-09 18:15:10 +03:00
Lauri Ojansivu 5c48be8e67 Add board-wide list-width/swimlane-height resize locks (#6680).
Adds three independent per-board toggles in the top header, right of the
drag-handles toggle:

  - list-width resize lock: left-right arrow icon plus a lock/unlock icon
    that flips when clicked. Locked, the drag-resize handle between lists
    does nothing for anyone on the board.
  - swimlane-height resize lock: same shape, up-down arrow icon, gates the
    drag handle at the top of each swimlane.
  - "same width for all lists": the board-wide equivalent of the existing
    per-user "Set width" popup's fixed-width mode. An admin can force every
    list on the board to one shared width for every viewer, overriding each
    member's own personal choice while it is on.

All three are board settings (models/boards.js: listWidthResizeLocked,
swimlaneHeightResizeLocked, sameWidthForAllLists, sameWidthForAllListsValue),
shown only on a board page and only to board admins (client) - turning a
toggle itself on/off is admin-only on the server too
(server/permissions/boards.js's default allowIsBoardAdmin rule). Dragging
the shared same-width VALUE, though, is allowed for any board member with
write access, via a new sole-field Boards.allow rule
(canUpdateBoardSameWidthValue in server/lib/utils.js) shaped exactly like
the existing canUpdateBoardSort rule: it approves a modifier ONLY when
sameWidthForAllListsValue is the one field touched, so a lower-privilege
member can never smuggle another board field into the same update.

client/components/lists/list.js's canResizeList/effectiveListWidth/
saveListWidth and client/components/swimlanes/swimlanes.js's resize
startResize are the actual enforcement points - the lock is checked before
a drag can start, and the board-wide fixed width takes priority over each
viewer's personal fixed-width mode.

Added the 3 new tooltip strings to all 235 locale files (not just English),
per this repo's translation policy; a handful of lower-resource languages
(Klingon, Wolof, Cherokee, and similar) were translated with lower
confidence and will be replaced by a human Transifex translation
automatically when one arrives. tests/listSwimlaneResizeLock.test.cjs pins
the schema, the header wiring, the permission rule shape, and that each
resize handle actually checks its lock.

Thanks to Hallsie and xet7.

Fixes #6680,
2026-09-09 01:30:08 +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 059a4dd104 Add complete Legacy HTML4 locked-user administration 2026-09-07 08:26:35 +03:00
Lauri Ojansivu a6612a25c0 Add Legacy HTML4 email administration 2026-09-07 07:50:24 +03:00
Lauri Ojansivu 83690596f6 Add accessible HTML4 Login settings 2026-09-07 07:30:58 +03:00
Lauri Ojansivu 48bf99220b Add accessible HTML4 People roles
Share the invite-role policy service between Jade and semantic cookieless HTML4 controls, expose the enforced role capability matrix, and block direct DDP writes. Restore complete Admin Panel navigation and separate exact-language runtime translations from the bounded admin search publication.
2026-09-07 07:13:53 +03:00
Lauri Ojansivu bd0e7eb4c2 Add accessible HTML4 translation settings
Share bounded admin translation services between the modern and HTML4 views, keep literal search selectors server-owned, block and report direct DDP writes, and provide complete semantic create, edit, search, paging and confirmed-delete controls. Verify both views on the same live route and keep their 25-row counters aligned.
2026-09-07 06:59:57 +03:00
Lauri Ojansivu 174fb65c72 Add accessible HTML4 Visibility settings 2026-09-07 06:47:14 +03:00
Lauri Ojansivu 51570b2c31 Add secure accessible HTML4 global webhooks 2026-09-07 06:30:47 +03:00
Lauri Ojansivu 31a4c2fdc2 Add secure accessible HTML4 PWA settings 2026-09-07 06:19:26 +03:00
Lauri Ojansivu 4b41897403 Add accessible HTML4 Accessibility settings 2026-09-07 06:08:46 +03:00
Lauri Ojansivu c8e9c40ac3 Add accessible HTML4 comment reactions 2026-09-06 20:57:34 +03:00
Lauri Ojansivu a1dfa88b49 Report blocked security attempts
Add bounded, attributed Problems events for denied MiniProfileBleed, PositionHistoryBleed, and CasBleed attempts. Keep UserSearchBleed and SubtaskExportBleed silent because their safe paths are indistinguishable from ordinary use. Also prevent clients from rewriting validated position history.
2026-08-25 01:26:28 +03:00
Lauri Ojansivu 4ce5cf6e10 Fix six reported security issues
Authenticate and minimize user publications, escape and throttle user search, enforce board boundaries for position history and exports, and require explicit CAS account linking.

Thanks to Char0n1507, Reload3d, crypto-nidh and xet7 !
2026-08-25 01:04:52 +03:00
Lauri Ojansivu 216146edc9 Restrict Organization and Team DDP writes.
Thanks to Char0n1507 and xet7 !

Fixes GHSA-p4cq-83j9-7g73.
2026-08-21 23:41:09 +03:00
Lauri Ojansivu 49de60eb04 Edit linked card content from either board.
Delegate source-card edits through a visible active link when the user has write access on the board containing that link. Route content fields, attachments, checklists, subtasks, watchers, labels, custom fields, voting and poker to the source while retaining placement on the linked card.

Thanks to hever and xet7 !

Fixes #1995.
2026-08-18 18:45:14 +03:00