Read 2026-10-23
triliumnext/trilium: technical due diligence, read from its repository
What Borehole read in triliumnext/trilium's code and history at 72167f4: its licence, security advisories, releases, review practice, tests, dependencies and operations. Every finding cites the file and line it rests on. The full report also covers the team and asks the questions the code cannot answer.
| Dimension | Rating |
|---|---|
| Architecture & Codebase — including AI provenance | strong |
| Engineering Process & SDLC Maturity | strong |
| Product & Engineering Maturity | strong |
| Security & Reliability Posture | adequate |
| Observability & Operations | adequate |
| Fit with the Acquirer | not assessable |
What the repository says
CONTRIBUTING.md:106: states a policy on AI-generated contributions
Architecture & Codebase — including AI provenance
strongpackages/pdfjs-viewer/viewer/viewer.mjs is 26,437 lines, 192× this codebase's median file
adequateThe median source file here is 137 lines. 11 files exceed 1,370 lines, the largest being 26,437. Size is not a defect on its own — some problems genuinely live in one place — but these are where merge conflicts, review fatigue and single-owner knowledge concentrate, and they are the first thing that slows an inheriting engineer down.
packages/pdfjs-viewer/viewer/viewer.mjs:1 — 26,437 lines (192× median) |
packages/commons/src/lib/script_api.ts:1 — 3,110 lines (22× median) |
apps/client/src/widgets/react/hooks.tsx:1 — 2,627 lines (19× median) |
apps/client/src/widgets/note_tree.ts:1 — 1,968 lines (14× median) |
apps/client/src/widgets/sidebar/AttributeList.tsx:1 — 1,872 lines (13× median) |
Engineering Process & SDLC Maturity
strongTests are retried until they pass
adequateThe suite is configured to retry failing tests (packages/pdfjs-viewer/playwright.config.ts). A retry turns a flaky test green without saying why it failed, so a green build means the tests passed eventually. Ask how many retries a typical run needs, and which tests need them.
packages/pdfjs-viewer/playwright.config.ts:15 — test retry |
Product & Engineering Maturity
strongEffort is shifting from building to rewriting
adequateDeleted lines per line added rose from 0.48 to 0.88 between the first and second halves of this history. Rework is normal and often healthy, but a rising ratio means an increasing share of the team's time is spent replacing code that already exists rather than building what does not. Whether that is deliberate repayment or churn is a question for the team.
| first half 0.48, second half 0.88 (split 2022-02-06) |
Security & Reliability Posture
adequate1 credential-shaped string committed to the tree
adequateMatches for private key block appear in tracked files outside test and fixture paths. They stay in the history even after they leave the tree, so what matters is whether each was rotated. The code cannot tell whether any of them is live, and that decides whether this matters: none sits in production configuration, and none is in a format its provider keeps for live keys. Is any of these live? Show that each was rotated after it was committed, and when.
| private key block pattern matched |
1 Dockerfile runs the application as root
adequateNo USER instruction switches away from root, so the process runs with full privileges inside the container. It is a one-line fix and an ordinary expectation, which is why its absence is worth asking about: it usually says more about whether anyone has reviewed the deployment than about this container specifically.
apps/server/Dockerfile — runs as root |
4 environment files are committed
adequateapps/client/.env, apps/client/.env.production, apps/standalone/.env and more are tracked in git. Environment files are where credentials usually live, and committing one usually means nobody decided how secrets reach the running application. Whatever is in it is in the history for good. Check 05.1 says whether it holds anything credential-shaped.
apps/client/.env — committed environment file |
apps/client/.env.production — committed environment file |
apps/standalone/.env — committed environment file |
1 SQL statement built from strings
adequate1 places in product code build SQL by formatting or joining strings rather than passing parameters. 1 of them put a value into the string; in the rest, what the code shows going in is a table or column name, a constant, or something the line does not show. Ask whether any value reaches these strings, rather than a parameter.
packages/trilium-core/src/services/entity_changes.ts:167 — SQL built from a string |
2 shell commands built from strings
adequate2 places run a command through a shell (`shell=True`, `os.system`, `exec` with a template) rather than passing arguments. Where any part comes from outside, it is command injection. Ask where each one's input comes from.
.claude/skills/ckeditor5-plugin-development/ck_css.mjs:44 — command run through a shell |
.claude/skills/ckeditor5-plugin-development/ck_css.mjs:70 — command run through a shell |
5 locked dependencies have published vulnerabilities, 3 high or critical
adequate5 of 2,382 locked dependencies match 5 published advisories in OSV, 3 of them rated high or critical. A lockfile says which version is installed, not whether the flawed code is reachable from this product, so each needs a look. Most are fixed by an upgrade, and the advisory names the version. None of the high or critical ones is in what the product ships: they are development dependencies.
pnpm-lock.yaml — http-cache-semantics 4.2.0: GHSA-ch52-4w7c-c8xp (high); a development dependency |
pnpm-lock.yaml — image-size 0.7.5: GHSA-w3rx-r6r6-pgpr (high), fixed in 2.0.3; a development dependency |
pnpm-lock.yaml — node-forge 1.4.0: GHSA-86w9-cpqp-85rv (high); a development dependency |
71 places insert HTML from a variable without sanitising it
adequate71 places set HTML from a value that is neither a literal nor passed through a sanitiser. Where the value can come from a user, that is stored cross-site scripting, and it is the first thing a buyer's security review looks for in a frontend.
apps/client/src/print.tsx:120 — HTML from a variable |
apps/client/src/services/code_note_preview.ts:68 — HTML from a variable |
apps/client/src/services/content_renderer.ts:1006 — HTML from a variable |
The app allows plain HTTP to any server
adequateThe app's manifest allows unencrypted HTTP app-wide (NSAllowsArbitraryLoads, or cleartext traffic permitted), rather than for named domains. Anything sent over plain HTTP can be read on the network, and enterprise security reviews ask about it. Some apps need it by nature (a podcast or feed reader fetches whatever URL a feed gives), so ask which case this is.
apps/mobile/android/app/src/main/res/xml/network_security_config.xml:6 — cleartext allowed app-wide |
apps/mobile/ios/App/App/Info.plist:29 — cleartext allowed app-wide |
27 advisories against this project in the last 24 months, 17 high or critical
adequateThe newest was published on 2026-09-13. A project that publishes advisories is telling its users about its fixes, and the count and pace say how much security work it carries. Whether 18 of them are fixed in the code you ship could not be told from this history: its version is only known to be at least 0.106.0. Answer lives in: the release you run, set against each fixed version. The record is incomplete: NVD: 1 record names Trilium with nothing tying it to this repository (CVE-2026-91021).
| 2026-09-13: GHSA-xv62-84hw-fc56 (high), fixed in 0.105.0: Safe Import Bypass: Stored XSS via type=file + image/svg+xml Notes Served Unsanitized by /open |
| 2026-09-13: GHSA-jj83-rfrw-r7gq (moderate), fixed in 0.105.0: LLM subsystem bypasses the project's safeFetch SSRF guard — authenticated blind SSRF via config.baseURL |
| 2026-09-13: GHSA-7c7g-7c3p-v53w (high), fixed in 0.105.0: Stored XSS in share renderer (`renderWebView`) via iframe `src` attribute breakout |
| 2026-09-13: GHSA-qf5g-qf5g-q6x9 (high), fixed in 0.105.0: Server-Side Request Forgery via note image auto-download (scheme-only "SSRF protection") |
| 2026-08-20: GHSA-6rxv-6w3q-7mv9 (high), fixed in 0.104.0: TriliumNext/Trilium: unauthenticated share-search bypasses `shareCredentials` / `shareHiddenFromTree`, disclosing protected shared-note titles, paths and conten |
Observability & Operations
adequateNo structured logging library is in use
adequateNothing references a structured logging library. Logs that are written to be read by a person are not searchable by a machine, which means incident response here is proportional to how well someone remembers the codebase rather than to what the tooling can find.
| searched 4,813 files for 10 structured logging libraries; 0 matched |
No error reporter is wired in
adequateNothing in the service initialises an error reporter (Sentry, Rollbar, Bugsnag, Honeybadger or an APM agent). An exception in production reaches a person only if someone is reading the logs, which usually means a customer reports it first.
| no error reporter initialised |
2 of 3 deployed images carry no version, or `latest`
adequate2 images in the deployment configuration are named without a version or as `latest`. A redeploy can change the software without a commit, a rollback has nothing to roll back to, and nobody can say from the repository what is running.
apps/server/docker/nginx-proxy-manager/docker-compose.yml:3 — image without a version |
docker-compose.yml:7 — image without a version |
Fit with the Acquirer
not assessableNot rated: structurally not assessable from a repository.
Read more, or read your own
The full report on triliumnext/trilium: every dimension, the questions for the room, and the audit log.
Survey a repository: free on public repositories. Private code is read on your own machine by a collector whose source you can read first.