Repository navigation
Tine code audit report #564
Replies: 3 comments
Tine dependency auditAudit date: 2026-09-18 ConclusionThe dependency set should not currently be marked as fully trusted. The recommended disposition is The audit covered the exact locked Rust graph, checksums, Git revisions, dependency build scripts, procedural-macro capability surfaces, OSV/RustSec advisories, and npm advisories. It was not a line-by-line audit of all 668 Rust crates or all JavaScript package source files. Rust dependency scope
Commands: CARGO_HOME=/tmp/tine-dependency-cargo-home cargo fetch --locked
CARGO_HOME=/tmp/tine-dependency-cargo-home cargo metadata --locked --format-version 1
cargo tree --locked -e features
cargo tree --locked -i <affected-package>All registry sources were fetched with the lockfile, and Git dependencies were pinned to the exact revisions above. Cargo checksums were used for registry packages. Rust advisory findingsHigh priority:
|
|
Thank you for both reports. They were specific enough to act on finding by finding. We re-checked every item against current code; here is where each stands. Code audit
Dependency audit (on the Beta line now, in the next Beta, 0.8.0-beta.1)
Claude (working on Martin's behalf) |
|
Follow-up: the runtime part of the dependency update is now also in the stable line, released as Tine 0.7.1:
Nothing else changed in 0.7.1. Stable keeps WebdriverIO at 9.29.0. It is test tooling only, not part of the shipped app, and 9.32.0 broke one of our release E2E journeys. The Beta line carries the full update described above. The retained items (glib, katex, test-only tooling) are unchanged, for the reasons given there. Thanks again for the audit. If you rerun your scans on 0.7.1 and something still shows up, comment here. Claude (working on Martin's behalf) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Before I use new software, i always have GPT (Codex) run a code audit. It looks for vulnerabilities, code quality issues, etc.
Here is what it wrote about the main project - another report about the dependencies will follow below. (spoiler: it looks quite good, just a couple of things that could be improved)
+++
Tine code audit report
Audit status: complete for the repository contents and local test/dependency checks available in this environment.
No source files were modified. Final git status --short was clean.
Executive conclusion
I found no confirmed exploitable vulnerability in the reviewed code paths.
The main confirmed hardening issue is that the Tauri application disables its Content Security Policy. There is also an unbounded backend asset-read option and a frontend test-suite reliability problem.
Dependency advisories require follow-up triage, but were not individually validated as exploitable application vulnerabilities.
The Rust core suite passed. The frontend suite did not complete successfully because its first Vitest stage failed one guard test due to a 5-second timeout; rerunning that test alone passed in 4.232 seconds.
Findings
M-1 — Tauri Content Security Policy is disabled
Severity: Medium hardening/security risk
Location: src-tauri/tauri.conf.json:40
Evidence:
"security": {
"csp": null
}
Impact:
The application receives no browser-enforced CSP defense-in-depth. If a future rendering, sanitizer, dependency, or templating defect introduces script injection, the webview has no CSP restriction to limit
script execution, resource loading, framing, or object/plugin content.
This is particularly relevant because the application renders user-controlled graph content and raw HTML-derived content.
Recommendation:
Define and test a restrictive Tauri CSP appropriate to the application’s actual IPC and asset-loading behavior. At minimum, explicitly constrain script, object, base, frame, image, style, font, and connection
sources. Validate it in packaged builds, not only development mode.
L-1 — read_asset permits an optional unlimited read
Severity: Low
Location: src-tauri/src/commands.rs:1781
Evidence:
max_bytes
.map_or_else(
|| g.read_asset(&name),
|limit| g.read_asset_limited(&name, limit),
)
The frontend callers currently pass explicit limits:
Impact:
A future caller, or an overlooked call path, can request an arbitrarily large asset into memory. Because this is a local desktop application, the likely impact is resource exhaustion rather than remote
exploitation.
Recommendation:
Prefer a mandatory backend limit, or enforce a conservative default when max_bytes is omitted. Keep the frontend limits as additional policy checks.
L-2 — Frontend guard test has a fragile 5-second timeout
Severity: Low; test reliability, not confirmed product failure
Location: src/conflictAuthority.guard.test.ts:127
Full frontend run result:
Test Files 1 failed | 238 passed | 1 skipped (240)
Tests 1 failed | 3884 passed | 1 skipped (3886)
FAIL src/conflictAuthority.guard.test.ts
has no markConflict call outside the save-result path
Error: Test timed out in 5000ms
The failing source scan took 4.232 seconds when rerun alone:
Test Files 1 passed (1)
Tests 8 passed (8)
Duration 5.64s
tests 4.24s
Impact:
The full frontend test command can fail nondeterministically under normal machine load even when the guard logic is correct.
Recommendation:
Either optimize the source scan or increase the test’s timeout to a justified value. Keep the focused test and add a bounded performance expectation if the scan is intended to remain fast.
Informational — Dependency advisories require triage
npm ci reported:
422 packages added
18 vulnerabilities
4 moderate
14 high
The command did not provide enough detail to determine which advisories affect production code versus development tooling, and no automatic remediation was applied.
Recommendation:
Run and review npm audit --omit=dev and the complete development dependency report. Prioritize exploitable runtime dependencies, then update or pin affected packages through normal review.
The Rust security catalog assessment also found no reusable review for this exact build identity:
No review exists for exact build identity
reusable = false
advisoryRefreshRequired = true
This is a review-coverage gap, not evidence of a known Rust vulnerability.
Positive controls observed
Asset path resolution is performed through the graph filesystem abstraction before reading.
Current frontend asset callers apply explicit image and PDF size limits.
Raw HTML is passed through DOMPurify with an allowlist and additional URI checks.
Embedded raw HTML frames use a sandbox attribute:
allow-scripts allow-same-origin allow-popups allow-forms
External links are routed through the backend/native allowlist rather than directly navigating the webview.
Plugin execution is isolated through the worker/WASM boundary with timeout/termination handling.
Build scripts reviewed for the application and relevant vendored components did not show unexpected shell downloads or first-party code-generation behavior.
The repository contains extensive security and regression guard tests, including sanitizer, IPC, asset-size, external-link, plugin-boundary, storage-authority, and frontend/Rust parity checks.
Commands and outcomes
Repository and toolchain inspection
git rev-parse HEAD
Outcome: audited commit was:
e90023f
sha256sum Cargo.lock
Outcome:
c25c8955efa4e69b52dfadb9055063b7084366ffe7267882e53726037a90504f
rustc --version
cargo --version
Outcome:
rustc 1.96.0 (ac68faa20 2026-05-25)
cargo 1.96.0
cargo metadata --locked --format-version 1 --no-deps
Outcome: metadata resolved successfully with the lockfile. The workspace includes tine-core, the Tauri application, plugin SDK components, and the iOS picker component. Git dependencies resolved to the lockfile-
pinned revisions.
Static inspection commands included searches over:
rg -n 'read_asset|read_local_image|DOMPurify|sandbox|openExternal|MAX_IMAGE_BYTES|MAX_PDF_BYTES' src src-tauri
Outcome: reviewed the IPC command surface, asset readers, external-link handling, sanitizer paths, iframe handling, and frontend size limits.
Rust supply-chain review
swamp model method run rust-security-catalog assess
--repo-dir /home/dieter/.codex/rust-security-catalog
--input-file /tmp/tine-rust-review-assess.json
--json
Outcome: exact build identity was not present in the catalog; no reusable review was available and advisory refresh was required.
Cargo test attempts and cleanup
Earlier concurrent/duplicate Cargo jobs were identified with:
ps -eo pid=,ppid=,stat=,etime=,args= | rg '(^| )((cargo|rustc)( |$)|.*cargo test|.*rustc)'
Those stale audit-started jobs were terminated after confirming their PIDs. The process table was then clean.
The first isolated build attempt failed because the temporary filesystem quota was exhausted. The audit-created temporary targets consumed approximately 10.8 GB:
/tmp/tine-core-audit 4.6G
/tmp/tine-audit-target 6.2G
Only those audit-created directories were removed; the repository’s target/ directory was not touched.
Final core command:
CARGO_TARGET_DIR=/tmp/tine-core-audit
CARGO_INCREMENTAL=0
CARGO_BUILD_JOBS=1
cargo test --locked --offline -p tine-core
Captured exit code:
0
Outcome:
Frontend dependency installation
npm ci
Outcome:
Frontend suite
npm test
The repository’s test script expands to:
vitest run
vitest run --config vitest.render.config.ts
node scripts/test-deploy-profile.mjs
npm run test:anonymize-graph
npm run test:e2e-harness
npm run test:script-identifiers
npm run test:e2e-provenance
npm run test:fdroid-monitor
The first vitest run stage stopped the && chain after one timeout:
Test Files 1 failed | 238 passed | 1 skipped (240)
Tests 1 failed | 3884 passed | 1 skipped (3886)
The focused rerun:
npx vitest run src/conflictAuthority.guard.test.ts --reporter=verbose
Outcome:
Test Files 1 passed (1)
Tests 8 passed (8)
Because the first stage failed, the later render, deployment-profile, anonymization, E2E, provenance, identifier, and F-Droid commands were not reached by the npm test chain.
Final repository check
git status --short
Outcome: clean; no tracked or untracked repository changes.
Limitations
The canonical external working-agreement files under /aux/koutecky/logseq/tine-agents/ were unavailable on this machine. Per your instruction, they were treated as developer-local context and excluded from the
audit.
No packaged desktop application was launched for dynamic webview/CSP validation.
No fuzzing, penetration testing, or hostile plugin execution campaign was performed.
Dependency advisories were reported by npm but not individually mapped to production reachability.
The frontend full chain was blocked at its first Vitest stage by the timeout above; later frontend test stages remain unverified.
The audit assessed the checked-out commit only and did not review deployment infrastructure outside this repository.
Final disposition
The repository is not showing a confirmed high-severity security defect from this audit. Before treating it as fully hardened, I recommend:
All reactions