GHSA-3vjg-3p4q-8fwh. The REST card DELETE looked the card up on the board
the caller was authorised for, destroyed its checklists, checklist items,
comments, attachments and subcards by cardId, and removed the card itself
last, keyed on that board and list. A move to another board landing in
between left the card alive on a board the deleter cannot read, stripped of
every child, with both requests answering 200 (CWE-367). Every hooked
removal had the same shape: collection-hooks runs Cards.before.remove (where
the cascade was) and then removes by the caller's original selector - by
swimlane, delete batch or parent - which a moved card no longer matches. The
custom-field link clean-up did the same to the cards linked to it.
The card document is now the claim (models/lib/claimedCardRemoval.js): the
single and bulk REST deletes remove the card first and cascade only when
that removal matched, and the hooked removals cascade from Cards.after.remove
only when the card is really gone. A list deletion removes a card only while
it is still in that list. The REST board move that loses to a delete is a
404 instead of a 500 from cardMove.
A delete that lost the race, or arrived after the card was moved away from
the named board, is refused and recorded in Admin Panel / Problems as
RaceBleed (authz.card-delete-race, medium, never disables the account): a
stale view is not an attack, and PurgeBleed's critical record used to
disable the member who deleted a card somebody had just moved.
tests/claimedCardRemoval.test.cjs replays the reported race and scans
server/ for any cascade before or without the card's removal;
tests/playwright/specs/race-bleed.e2e.js races 12 moves against deletes
and checks that a surviving card always keeps its checklist.
Thanks to xingmuse and xet7 !
The repositories under .tools/ are now grouped by their GitHub owner:
github.com/wekan/* in .tools/w/, github.com/xet7/* in .tools/xet7/ and
github.com/Secretchronicles/* in .tools/Secretchronicles/. build.sh,
build.bat, the release and debug scripts, the tests and the docs looked
for .tools/FerretDB, .tools/wekan.fi, .tools/charts, .tools/node-patches,
.tools/mongo-tools-patches and .tools/TSC, and now use the new places.
ensure_tool_repo takes the owner from the clone URL through a new
tool_repo_dir, so a missing companion repository is cloned into the same
place the scripts read it from. tests/toolsDirectoryRepos.test.cjs runs the
mapping and checks that nothing lands flat in .tools/ any more.
Finding the website checkout again let securityRegressionCoverage compare
the Hall of Fame, which it had been skipping: CreateBleed is published and
is now in the inventory with its unit and UI tests. The exceljs fork test
reads npm-packages/exceljs, the copy WeKan builds with, instead of a clone
under .tools that is not part of the build.
Thanks to xet7 !
Restore protected activity placeholders in locale data, align source-based assertions with the current implementations, exclude diagnostic and runtime-only paths from parity checks, and allow the reactive browser test its observed bounded delivery time.\n\nThanks to xet7 !
Neither of these gave a wrong answer. They asked the right question one document
at a time, and each await is a full round-trip that starts only once the last
one finished - invisible on a board with four cards, and the whole cost of the
request on a real one.
The bulk label endpoint (PUT .../cards/labels) awaited a getCard per id and then
an update per id. At BULK_CARDS_MAX = 500 that is ONE THOUSAND sequential
round-trips for a single request. The reads are all the same question, so they
are one `$in` query indexed into a Map; the writes genuinely differ - each card
merges its own labelIds - so they stay individual updates, but they are issued
together and awaited once instead of each waiting for the last.
Two details that had to survive: the loop still iterates cardIds rather than the
query result, because a batch read comes back in the database's order and
without the ids that matched nothing - iterating it would silently reorder
`updated` and lose `notFound`. And every write is awaited before the 200 is
sent, so the response still means what it says.
The bulk DELETE beside it is deliberately left alone: its per-card work is real
(cardRemover runs the sub-item hooks, each card gets its own activity), so
batching the reads would save one query inside a loop that does far more than
query.
Global search resolved each `user:`/`member:`/`assignee:`/`creator:` name with
its own awaited findOne, so `member:ann member:bob member:carol` was three
serial round-trips before the search itself could start. They are all the same
question - which of these names is an account - so it is asked once, with `$in`,
and answered from a map. A name typed under two operators is one lookup now, not
two. Unknown names are still reported against the operator they were typed
under, because "ann is not a user" is not useful without saying where ann was
typed.
tests/queryBatching.test.cjs pins both, including the negatives: no per-card
read remains in the label handler, no per-username query remains in search, the
response order and notFound list are preserved, and the delete handler is still
per-card on purpose.
Thanks to xet7 !