Commit Graph
24 Commits
Author SHA1 Message Date
Lauri Ojansivu 11bed26788 Companion repositories are found in .tools/w, .tools/xet7 and .tools/Secretchronicles.
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 !
2026-11-07 23:32:43 +02:00
Lauri Ojansivu 43c4d41877 Tests: the Hall of Fame guards read a linked vulnerability name too.
hallOfFameProblemsCoverage and securityRegressionCoverage collected the
names from <td valign="top"><b>Name</b></td>, so a name that was a link to
its page was never seen. Now that every name is one, the match takes the
link; the four it had missed - ImportPlacementBleed, SamlSubjectBleed,
StampBleed and UploadBleed - are listed as guarded by the suites that name
them, and the inventory count goes from 137 to 141.

Thanks to xet7 !
2026-10-30 00:20:47 +02:00
Lauri Ojansivu 9927adcb44 Companion repositories are read from .tools/ only, never from ../w/.
wekan.fi, charts and docker-cleanup-volumes used to be checked out in ../w/
beside the repository, and several places kept that as a fallback after
they moved to .tools/ (CLAUDE.md). With no .tools/wekan.fi, the Hall of Fame
tests read a stale ../w/wekan.fi and failed on markup the site no longer
has.

- tests/hallOfFameProblemsCoverage.test.cjs and
  tests/fixedVulnerabilityClasses.test.cjs read only .tools/wekan.fi (and
  skip, saying so, when it is not there).
- release-charts.sh, backfill-charts.sh, reindex-charts.py and version.sh
  look for the charts checkout only in .tools/charts.
- docker-build.sh clones and runs docker-cleanup-volumes in .tools/.

tests/noLegacySiblingRepos.test.cjs fails when a script, test or document
under releases/, tests/, docs/ or tools/, or at the root, looks in ../w/
again; tests/reindexCharts.test.cjs now requires ../w/charts to be gone.

Thanks to xet7 !
2026-10-27 23:13:02 +02:00
Lauri Ojansivu 314c153c9b Admin Panel / Problems: AuthBleed attempts are recorded.
copyBoard, copyCard, copySwimlane and createCardWithDueDate - four of the
AuthBleed methods - refused with plain not-authorized errors, so an
attempt left no trace in Admin Panel / Problems. AuthBleed was on the
PENDING list of tests/hallOfFameProblemsCoverage.test.cjs.

A new catalog key, authz.copy (AuthBleed, high, CWE-862), is recorded
where no legitimate client can be:

- a signed-out caller of any of the four - no WeKan client copies while
  signed out, and with no userId nobody can be blocked;
- any refusal of createCardWithDueDate, which no WeKan client calls.

The membership refusals of copyBoard, copyCard and copySwimlane are
deliberately NOT recorded: a member who is not admin of a shared or
default board template, or a stale Copy Card / Copy Swimlane dialog,
reaches them in ordinary use, and a high-severity record naming the
account disables that login (server/lib/blockOnSecurityEvent.js). Each
record is wrapped so logging cannot break the guard.

tests/authBleedCopyMethods.test.cjs runs the real method bodies and pins
both: what is recorded, and that the ordinary-use refusals are not.
AuthBleed leaves the PENDING list.

This was in CHANGELOG TODO Later as needing a maintainer decision.

Thanks to xet7 !
2026-10-27 21:29:17 +02:00
Lauri Ojansivu a7628504f1 Make header login settings environment-only.
With HEADER_LOGIN_ID and HEADER_LOGIN_TRUSTED_IPS set, a proxy at a trusted
address signs in as anyone it names. Since the 2026-10-05 Admin Panel work a
site administrator could switch that on from People / Header login, so a
stolen administrator session was enough to open every account. Per the
maintainer decision of 2026-10-08 the six HEADER_LOGIN_* settings now come
from the environment only: a value stored in the Admin Panel is ignored, the
pane shows the values in effect read-only with no Save button, and a save sent
by hand is refused and recorded in Admin Panel / Problems as ProxyBleed
(authn.header-login-env-only). Every other login section stays overridable.

New text is added in English only, pending Transifex.

Thanks to xet7 !
2026-10-08 10:41:59 +03:00
Lauri Ojansivu ad6117cc65 Account for the thirteen Hall of Fame names published on 2026-10-02.
Thanks to xet7 !
2026-10-02 12:04:19 +03:00
Lauri Ojansivu a8e836efd3 Fix BypassBleed's rule-loop denial of service: a chain of rules started by rules stops at a depth limit.
BypassBleed (2022) reported, besides the authentication bypass, that two rules
undoing each other - label added: remove it; label removed: add it - recursed
without end: a rule's action writes a card, the write inserts an activity, and
the activity runs the rules again in the same awaited chain. That part was
never fixed. Rule runs started by a rule are now counted in async context, and
a chain deeper than five stops and is reported to Problems as BypassBleed
(detected, medium: usually an honest mistake). Separate activities are not
affected. The test runs the real executeRules with the reported loop;
BypassBleed moves from the recorded gaps to guarded and from pending to keyed;
two tests that load RulesHelper in a vm get the guard as a pass-through.

Thanks to xet7 !
2026-10-02 11:13:18 +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 d914ca02c6 Count RelayBleed and EmailBleed in the security coverage lists, matching names in any case.
EmailBleed (2021, SMTP password readable in the Admin Panel) is published as
Emailbleed, which the case-sensitive Hall of Fame match skipped, and a comment
had called it an unpublished alias. Both coverage tests now match in any case,
EmailBleed is guarded by tests/adminMailSettings.test.cjs (passwords are never
published), and it is a deliberate Problems omission. RelayBleed is guarded by
tests/relayBleed.test.cjs.

Thanks to Georg Krause and xet7 !
2026-10-02 10:22:17 +03:00
Lauri Ojansivu de67550476 Fix RelayBleed: send the Trello credential only to Trello's own hosts during live import.
The live Trello import downloaded attachments, the board background and member
avatars with the importing user's Trello API key and token in an OAuth
Authorization header, whatever host the URL named. A link attachment is a URL
anyone who can edit the Trello board chooses, and one renamed to look like a
file was downloaded like an upload, so its host received the importer's token.
The background and avatar downloads retried with the credential after a public
download failed, with the same effect.

The header is now built in one place, only for https://trello.com and
https://api.trello.com on the default port; every other download goes without
it, and fetchSafe still drops it on a redirect off the origin.

tests/relayBleed.test.cjs runs the real import code with the network stubbed
and checks which hosts receive the credential, including Trello lookalikes, and
fails if the header is built anywhere else. The live import calls the fixed
api.trello.com, so there is no browser test. A link elsewhere is ordinary board
content, so withholding the credential is not recorded as an attempt.

Thanks to xet7 !
2026-10-02 10:20:24 +03:00
Lauri Ojansivu 77c3957e5c Fix CacheBleed: serve attachments and avatars as private, revalidated responses.
GHSA-w3qg-pf27-g68r: attachments were answered with
Cache-Control: public, max-age=31536000 and no Vary after the board access
check, so a shared cache (CDN, caching proxy) could store a member's copy and
serve it to anyone without credentials for a year, also after the member was
removed from the board. The same header was in setFileHeaders, both ?download=1
branches, both avatar routes, and Meteor-Files' own /cdn/storage route sent its
default public, s-maxage one-year header.

Every file response, its 304 and the thumbnail now send
Cache-Control: private, no-cache and Vary: Cookie, Authorization, X-Auth-Token
through models/lib/fileCacheHeaders.js, for public boards too, because a board
made private later would leave a public copy behind. Both FilesCollections pass
the same cacheControl. The ETag keeps revalidation a bodiless 304.

tests/fileCacheHeaders.test.cjs drives the policy against the shared-cache rules
the report used, checks each route, and fails on any public Cache-Control, a
FilesCollection left on the Meteor-Files default, or an ETag-sending file without
the policy, anywhere in the tree. The thumbnail Playwright spec checks the
headers on every route. Nothing is refused, so there is no Problems key.

Thanks to alham-rizvi and xet7 !
2026-10-02 08:42:18 +03:00
Lauri Ojansivu 0c862047b5 Prevent assigned-only members from exporting unfiltered board data
Share authorization across all nine exporters and retain access only for already scoped Scrum reports. Return HTTP 403 for denied document exports. Document ExportScopeBleed and cover policy, source-wide guards and HTTP behavior.

Thanks to xet7 !
2026-09-27 18:21:58 +03:00
Lauri Ojansivu 285c1db24f Enforce current access when reading and restoring universal History
Filter historical rows before search, counts and contributor aggregation using current board visibility and assigned-card scope. Gate all reversal paths with the same scope and current card/linked-card edit permission so revoked access or an old board cannot authorize hidden-card writes.

Verified 10 focused Node runner entries and eight Chromium scenarios across History and rule undo/redo, including allowed restores and negative cases. Document detection limits to avoid treating legitimate stale permissions as attributable attacks.

Thanks to xet7 !
2026-09-27 17:38:27 +03:00
Lauri Ojansivu 55c6b48c16 Repair full-test regressions and align local release preparation
Follow moved documentation and component-owned templates, preserve reviewed translations, update date-format guards and account for AuthTraceBleed coverage. Recognize the backup containment guard and select the release npm version locally.

Exercise invitations with a separate member and an open sidebar, match the multiline swimlane composer, and wait for an interactable sign-in field before keyboard navigation.

Verified all 1216 Node suites, targeted checks in three browsers and nine real backup/restore integration checks.

Thanks to xet7 !
2026-09-25 01:42:55 +03:00
Lauri Ojansivu c4c6e34ec4 Repair node regressions and align security problem names 2026-09-15 10:35:31 +03:00
Lauri Ojansivu e54b123c10 Validate XLSX sheet colors before CSS serialization
Thanks to rbbjinioeq and xet7 !
2026-09-05 23:51:02 +03:00
Lauri Ojansivu 90158d5012 Audit security coverage and recovery failures 2026-09-05 23:51:02 +03:00
Lauri Ojansivu 3b88b285bb Document three security fixes
Add the required CRITICAL Upcoming entries and record why avatar and legacy attachment response hardening has no attributable runtime event. Preserve the earlier distinct AvatarBleed name by publishing the new response flaw as AvatarMimeBleed.

Thanks to crypto-nidh and xet7 !
2026-08-29 06:01:39 +03:00
Lauri Ojansivu 8d427583ef Harden avatar attachment and swimlane boundaries
Serve browser-executable avatar and legacy attachment MIME types as sandboxed opaque downloads, and require board write permission before creating a default swimlane. Summarize rejected swimlane creation attempts in Admin Panel Problems and add positive plus repository-wide negative regression coverage.

Thanks to crypto-nidh and xet7 !
2026-08-29 06:01:38 +03:00
Lauri Ojansivu b5a36bd3af Make hostname examples exact in translation coverage
Replace dynamic regular expressions for the Marathi tenant hostname examples with literal containment checks, so dots cannot act as wildcards. Add positive, negative, and repository-wide HostnameBleed coverage for CodeQL alerts #435 and #436, and record why this test-only finding has no runtime Problems event.\n\nThanks to GitHub CodeQL code scanning and xet7 !
2026-08-27 18:24:40 +03:00
Lauri Ojansivu 12f2fddc2c Fix OIDC and account metadata security boundaries.
Thanks to crypto-nidh and xet7 !
2026-08-26 22:41:44 +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 ed4b8cd648 RouteBleed: remove incomplete route-pattern escaping.
CodeQL alert #434 found that boardExportScope escaped only forward slashes before interpolating an export path into a RegExp. Replace the pattern with an exact route-literal inclusion check, so there is nothing to escape and metacharacters cannot change the match.

Add positive and negative cases with backslashes and regex metacharacters, reject the reported partial-escape shape across tracked JavaScript, and remove a second partial dynamic pattern from release bundle coverage. This was test-only code with no runtime request path, so there is no attributable attempt for Admin Panel Problems.

Thanks to GitHub CodeQL code scanning and xet7 !
2026-08-17 14:50:07 +03:00
Lauri Ojansivu 3d08c65bb2 Admin Panel Problems: one summary row per problem, with who tried and how often.
A guard on a path an attacker controls fires as fast as they can send. One
document per event meant the database grew with the attack, the Problems page
became a scroll of near-identical lines, and the one event that mattered was
buried under ten thousand that did not. The admin's question is never "list
every attempt" - it is what is happening, how much, since when, and who.

So each problem is ONE row that accumulates:

  count            how many times this problem has happened
  firstAt … at     the window it happened in
  actors           who, each with their own count:
                     username1 25, 100.100.100.100 30
  username/ip      the most recent occurrence

WHAT MAKES TWO EVENTS THE SAME PROBLEM is the whole design. Identity is the KIND
of thing that happened - stream, bleed, category, action, source, severity, CWE,
and the database stream's own type/db/kind. The actor is NOT part of it: a
username or an address in the key gives a row per attacker per attempt, which is
the cost being removed.

A USERNAME AND AN ADDRESS ARE TALLIED SEPARATELY, not as a pair. They answer
different questions - which account, and where from - and an unauthenticated
attempt has an address and no name. Pairing them would split one attacker across
a line per address and answer neither.

THE TALLY IS CAPPED at 50 actors, with the rest counted in actorsOverflow.
Otherwise an attacker rotating addresses grows the row with the attack and
reintroduces the same bug one level down - and "and 9,412 others" is itself the
signal that the source is spread rather than single. The cap needs to know
whether an actor is new to the row, so the row's actor keys are cached per
process: reading it on every attempt would double the database work of the thing
being made cheap, and under attack the same few actors repeat.

All three loggers share the fold (server/lib/eventLogFold.js) - a slow query in
a loop and a test failing on every run repeat just as a guard under attack does.
Still fire-and-forget and still unable to throw into the caller.

EXISTING PER-EVENT ROWS ARE FOLDED IN PLACE at startup, in batches, in JS so it
behaves the same on FerretDB as on MongoDB, and idempotently - a row with firstAt
is already a summary. Nothing is lost that the summary does not carry: counts are
summed, the earliest becomes firstAt, the latest becomes at, and the latest
occurrence's actor and detail are what the row keeps.

AND A COVERAGE CHECK, as asked: tests/hallOfFameProblemsCoverage.test.cjs
requires every hall-of-fame vulnerability to be keyed, deliberate (with the
reason, as HashBleed is), or pending. 30 of 66 are keyed; the other 35 predate
the rule and are listed as pending rather than judged here, because deciding
whether a given fix has anything to detect means reading that fix and claiming
otherwise would be worse than the gap. The pending list may shrink and may never
grow, so a NEW vulnerability without a key fails.

It found one real fault immediately: the catalog said OidcBleed and the site says
OIDCBleed, so attempts were grouping under a name nobody could look up.

Thanks to xet7 !
2026-08-16 14:57:18 +03:00