Custom URL schemes in card text link only when Admin Panel -> Features ->
URL lists them, and never javascript:, data: or another scheme that runs
code in the page. A listed operating-system handler was linked, though, and
some have a public code-execution history: ms-msdt (Follina,
CVE-2022-30190), search-ms and search, ms-officecmd, ms-appinstaller,
ms-cxh and ms-cxh-full, and telnet - the last step of the 2026 Edge full
chain, where Windows ran telnet.exe from a user-writable PATH directory.
An administrator listing one would let any board member plant a link that
runs something on whoever clicks it.
- They are never linked, listed or not, by the app's parser and by the
markdown package's copy of the rule (the two lists must be identical),
and a click on one does nothing should such a link reach the page.
- A card title or description, comment, checklist or checklist item that
ADDS a link to one is shown in Admin Panel -> Problems (HandlerLink,
CWE-939), with who wrote it; the text is saved as written and the writer
is told nothing. The word in prose, or a link the text already had, is
not recorded.
- docs/Features/Admin-Panel/Settings/Visibility.md lists both kinds of
never-linked scheme, and says what a listed file: does on Windows (an SMB
link outside the network sends the clicker's NTLM hash).
Tests: tests/urlSchemeAllowlist.test.cjs (positive and negative, through
the real DOMPurify, both sanitizer passes and the detector; fails on the
old code), and custom-url-schemes.e2e.js, which passes in Chromium and
WebKit: listed handlers do not link, a description saved with one through
the editor is recorded for its writer, and a kept link or a comment that
only mentions the word is not. Firefox does not start in this
environment.
Thanks to xet7 !
Admin Panel / Settings / Features could turn one "<prefix><number>" pattern
into links (#3069). The reporter wanted "[Task:3384]" and "[Incident:3384]"
to link to their tracker, and "[TK:1223]" with TK an abbreviation of Task.
"More link rules" now takes one "<token> = <url>" per line, with {number}
and {identifier} in both, and "Abbreviations" maps an identifier to the
word the address needs. All rules are matched in one pass, earliest first,
after the #3069 pattern, and text that is already a link is never rewritten,
so no rule relinks another's link. Only an http(s) rule with exactly one
{number} is used, and the values are URL-encoded into the address.
The markdown package carries a copy of models/lib/externalLinkRules.js;
tests/externalLinkRules.test.cjs keeps the two identical and covers the
reporter's examples and the refusals. The release risk baseline records the
example addresses in the new comments, and the default avatar's, which it
had not. New text is in English, pending Transifex.
Thanks to rzoss and xet7 !
Fixes#1463.
The fix makes HTML comment markers in rendered card text visible so nothing can
be hidden from readers, but used String.replace with a string pattern, which
replaces only the first occurrence - a second comment stayed hidden, and
DOMPurify then dropped it unseen. Every occurrence is replaced now. The test
applies the real replacement to text with two comments; the negative test fails
on any first-only comment replacement. InvisibleBleed moves from the recorded
gaps to guarded.
Thanks to xet7 !
Admin Panel → Features → URL already stored "automaticLinkedUrlSchemes", but
nothing read it: eight schemes were hardcoded, recognised by linkify, then
refused by markdown-it's validateLink and both sanitizer passes, so none was
ever clickable. The listed schemes now pass all three filters and nothing
else does; the setting is empty by default. javascript, data, vbscript and
similar schemes are never linked, in the app's parser and again inside the
markdown package. A listed scheme opens its application in place rather
than through an empty tab.
Fixes#3218,
Thanks to chrisi51 and xet7 !
A fenced block with a known language is coloured by highlight.js; a block
with no or an unknown language stays plain, as before. Both sanitizer passes
keep only hljs-* and language-* classes, only on code and span inside pre,
through a hook added for that call; every other class is still removed.
Thanks to xet7 !
The markdown package rendered "- [ ] Task" as a disabled checkbox, but its
"only a task checkbox" rule sat in a HOOKS config key that DOMPurify does
not have, so it never ran. The card viewer then sanitized the output again
with a config forbidding every input, so no checkbox reached the page, and
forms.css hides bare checkboxes app-wide anyway. Both sanitizer passes now
install a real afterSanitizeAttributes hook for the call that keeps only a
disabled checkbox and removes every other input, and the viewer shows it.
The dead HOOKS keys are removed from all three sanitizer configs.
Refs #2419.
Thanks to rodrigocipriani and xet7 !
Expose the renderer through a Meteor main module, synchronize security settings without repeated reactive invalidation, and route canonical avatar downloads around the automatic Meteor-Files handler. Update browser tests for the visible Board View and list menus, correct fixture IDs and authentication headers, and wait for the settings publication where direct Mongo updates are used.
substring check, an overly-permissive regex range and a no-op replace.
- models/lib/cardUrlAutolink.js and packages/markdown/src/
template-integration.js (kept in sync, per their own comments): the
card-title markdown-link escape only escaped ']', not the backslash
that precedes it, so a title ending in a raw backslash escaped the
']' this code inserts to close the label instead of the label
actually closing. Escape '\' before ']'.
- server/lib/documentGif.js: plainSearchText's control-character strip
used literal raw control bytes inside the regex character class
instead of \x escapes, so CodeQL flagged the range as unverifiable
(adjacent control bytes are visually indistinguishable, so a
boundary could silently shift). Rewritten with explicit \x escapes,
byte-for-byte equivalent to the original range.
- tests/notificationEmailUrlLink.test.cjs: built a dynamic RegExp by
hand-escaping only '/', leaving every other meta-character -
including backslash itself - unescaped. Added the same escapeRegExp
helper already used elsewhere in the codebase.
- tests/oauthLogoutUrl.test.cjs: asserted a returned URL did not
contain a hostname via `.includes()`, a substring check a
confusable/query-embedded hostname can fool either way. Compare the
parsed `new URL().hostname` instead.
- tests/boardCreationAdminOnly.test.cjs: `.replace(/ /g, ' ')` was a
no-op (replacing a space with itself); the actual intent was to
collapse runs of spaces, `.replace(/ +/g, ' ')`.
Every fix has a positive test proving the corrected behaviour and a
negative test reproducing the exact bypass/bug CodeQL flagged. None of
these cross a security boundary on their own (the markdown-link title
escaping is a rendering-correctness fix - DOMPurify still sanitizes
the final HTML regardless, per the existing code comments; the rest
are test-only assertion bugs), so no Admin Panel security-log entry
applies.
Thanks to GitHub CodeQL and xet7 !
wekan/wekan#2419: a card description/comment containing task-list syntax
rendered the literal text "<input disable=\"\" type=\"checkbox\"/> Task"
instead of a checkbox, because the markdown-it renderer had no task-list
extension (so it never emitted an <input> at all) and the sanitizer
forbade the input tag outright, so even a typed-in <input> would have
been stripped.
Add a small markdown-it core rule that turns a leading "[ ]"/"[x]"/"[X]"
marker on a list item into a disabled <input type="checkbox">, and allow
that exact shape through secureDOMPurify.js: only type="checkbox", and
never one carrying name/value/form/formaction, so nothing but a plain
checkbox can reach the page. The checkbox is left disabled - click-to-
toggle would mean mapping a rendered click back into the raw markdown
source and saving it, a separate, larger feature from this rendering fix.
Thanks to rodrigocipriani and xet7 !
Fixes#2419,
A card description or comment containing a plain, pasted URL to another
WeKan card ("/b/<boardId>/<slug>/<cardId>", optionally with the
#comment-/#activity- fragment from #4757) rendered as a raw, unlabeled
link. models/lib/cardUrlAutolink.js is a pure parser/rewriter that finds
such URLs in text and replaces one not already inside a markdown/HTML
link with "[title](url)", given a title resolver - mirrored inline in
packages/markdown/src/template-integration.js (that package cannot
import app code, the same reason externalLinkAutolink.js is mirrored
there for #3069) and run in the 'markdown' Blaze helper just before
markdown-it's own render.
The resolver is wired in client/components/main/editor.js's existing
Meteor.startup as Markdown.resolveCardTitle, a plain function calling
ReactiveCache.getCard(cardId). Because that lookup is itself a reactive
Tracker dependency read inside the markdown helper's own reactive
computation, the rendered title updates automatically if the target
card is later renamed, and resolves to nothing - leaving the bare URL
untouched - for a card this client's Minimongo has not received: a
deleted card, or one on a board the current viewer cannot see. That
fallback is exercised directly with a mocked resolver in
tests/cardUrlAutolink.test.cjs, alongside URL parsing (boardId/slug/
cardId, fragments, rejecting unrelated links) and the "already inside a
link" no-double-linking guard.
Thanks to justinr1234 and xet7 !
Closes#2453,
"A card whose description or a comment contains a `file://` URL cannot be opened.
Clicking the minicard plays the open animation but the card details panel never
mounts. There is no visible error by default because Blaze swallows the render
exception." Captured, it was:
TypeError: this.__schemas__[t.toLowerCase()].validate is not a function
testSchemaAt / matchAtStart / markdown-it (tokenize -> parse -> render)
WeKan registers eight custom URL schemes so links like `thunderlink:` and
`file://` are recognised, and it registered them the linkify-it 4/5 way:
Markdown.linkify.add(scheme + ':', 'http:') // "behave like http:"
linkify-it 6 removed string aliases and builds the definition by SPREADING it:
const def = { normalize: ..., ...definition };
Spreading the string 'http:' produces {0:'h',1:'t',2:'t',3:'p',4:':'} - an entry
with no `validate` - and testSchemaAt then calls `.validate(...)` on it. So every
one of those eight schemes was a landmine in any card's text, and the card holding
one could not be opened again. Reproduced here against the installed linkify-it,
not from the report: the test builds that same registration and watches it throw.
Each scheme now carries a validate of its own, which is all the alias was standing
in for: the URL after the scheme - an optional `//`, then everything up to
whitespace or a bracket - with trailing sentence punctuation handed back, so "see
file://server/share/doc.xlsm." does not swallow the full stop.
WHAT THAT DOES NOT DO, because the list promises more than it delivers.
Registering a scheme makes markdown-it RECOGNISE it; two filters then decide
whether a reader gets a clickable link, and both refuse these. markdown-it's own
validateLink blocks file: (with javascript:, vbscript: and data:), and the
viewer's DOMPurify allows only http/https/ftp/ftps/mailto/tel/callto/cid/xmpp
hrefs. So none of the eight has ever produced a clickable link - its only
observable effect was the crash. Making them clickable means relaxing both
filters for schemes that launch local applications, which is the security decision
#3218 asks for and not something to slip in while fixing a crash. It goes to TODO
Later; the tests pin today's answer so the day it changes is a decision.
And the guarantee behind the fix, which is worth more than the fix: nothing a card
contains may make that card impossible to open. The markdown render is wrapped, so
a throw from a plugin, a pathological formula or the next markdown-it upgrade
shows the text as written - escaped, sanitised, unformatted, and readable - instead
of a panel that never mounts.
tests/markdownCustomUrlSchemes.test.cjs runs the real linkify-it and markdown-it
from node_modules: the old registration throwing, every scheme having a working
validate, the reported strings rendering, punctuation staying in the sentence, a
bare `file:` and junk input returning zero rather than throwing, and the viewer's
fallback returning sanitised text rather than nothing.
Verified by running the suite and the whole node suite (382 suites, 0 failed). Not
verified in a browser: this sandbox has none, so the crash and the fix are
exercised against the same dependency the browser would load.
Thanks to rmb82 and xet7 !
Fixes#6588.
- client/lib/tests/renderLinksPlainText.tests.js: the 'render links as plain text'
toggle and XSS hardening. Config assertions (stripLinks adds <a> to FORBID_TAGS,
default does not, KEEP_CONTENT) plus real sanitizeHTML() behavior: <a> stripped to
its text when stripLinks, kept by default, and javascript: hrefs / event handlers /
<script> removed regardless.
- client/lib/tests/alwaysShowCodeAsText.tests.js: escapeHtmlSource (exposed on the
Markdown export) escapes <script>/comments/quotes/ampersand-first so code is shown
not executed; leaves plain text and empty strings unchanged.
- server/lib/tests/impersonationReportQuery.tests.js: the Impersonation report search
selector (extracted to models/lib/impersonationReportQuery.js so it is testable
without re-registering the publication) builds a case-insensitive $or across the
identity fields, escapes regex metacharacters, and is empty for a blank term.
The MimeBleed fix (fileValidationBypass.security.tests.js), SortBleed
(boards.security.tests.js) and import/export anonymization
(importExportSecurity.tests.js) already carry positive + negative tests.
New optional toggle under Admin Panel / Features / Security. When enabled,
rich text is never rendered as markdown or HTML -- the entire source is shown
as escaped plain text in every rich text field (board and card titles,
descriptions, comments, checklists, etc.), so hidden content is always
revealed: HTML comments (<!-- -->), the target URL inside a markdown link,
JavaScript and any other code. All code is always visible, not clickable, and
not running.
This extends the existing invisiblebleed protection (which already showed raw
source for description-less markdown links) to all content, and complements
the "Render links as plain text" toggle.
Implementation:
- New global setting alwaysShowCodeAsText (models/settings.js), published in
the public setting publication, default off.
- Admin Panel / Features / Security gains a second materialCheckBox toggle.
- The markdown helper has the raw text, so the decision lives there. Because
the wekan-markdown package cannot import app code, the setting is bridged via
a ReactiveVar on the exported Markdown object; the rich text viewer
(editor.js) keeps it in sync with the setting reactively, and the markdown
helper reads it and renders the fully HTML-escaped source in a <pre> when on.
Full escaping (not DOMPurify stripping) ensures tags like <script> are shown
as text rather than removed. The description-less-link branch now uses the
same full escaping so it too reveals all source.
The GitHub wiki is disabled (has_wiki=false) and wiki/LaTeX now redirects to the
repo home; wiki content was moved into docs/. Link the in-repo docs page instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Math rendering ($...$ inline, $$...$$ block) was silently dropped in
63ce45c53 during the Meteor 3 refactor; the markdown-it-mathjax3 dependency
was left orphaned in package.json.
Restore it using Temml, which converts LaTeX to native browser MathML, instead
of bundling all of MathJax (which also had a render-twice bug). Wired via the
markdown-it-math@6 no-default-renderer entrypoint, calling temml.renderToString
directly to avoid a top-level await that the Meteor/rspack bundler dislikes.
The emitted MathML is allow-listed in the markdown package's DOMPurify config
(tags + presentation attributes), and MathML elements are exempted from the
"delete element if it has a style attribute" rule so block formulas
(style="display:block math") are not silently removed; style/class/scripts and
annotation-xml stay blocked, so security posture is preserved.
Net dependency change: removes MathJax (9 packages), adds markdown-it-math and
temml (3 packages).
Docs: docs/Features/LaTeX.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
markdown-it renders ~~text~~ to <s>...</s>, but the DOMPurify ALLOWED_TAGS list
did not include s/del/strike, so the sanitizer stripped the tag (keeping the bare
text), losing the strikethrough. Add s, del and strike to both DOMPurify configs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>