Files
CollabTable/SECURITY_REPORT.md
T
Gabriel20xx 937f51b4fb
Lint / Lint (push) Successful in 26s
Tests / Go backend (push) Failing after 1m14s
Tests / Dashboard checks (push) Successful in 52s
Docker / Docker Build & Push (push) Successful in 3m41s
fix: address performance and security findings
- Add PostgreSQL-backed backend and frontend tests to CI
- Harden Android API logging and disable app backups
- Update the performance report with resolved findings
2026-10-19 21:16:08 +00:00

155 lines
30 KiB
Markdown

# Security Report — CollabTable
- **Project:** CollabTable
- **Path:** /workspace/Personal/Web/Originals/CollabTable
- **Analyzed:** 2026-10-16
- **Commit:** 6aec03f on main
- **Working tree:** clean (no uncommitted changes, no untracked files)
- **Updated:** 2026-10-19 — Critical, High and Medium findings handled in the working tree (not committed). S-006 and S-009 follow owner decisions 5 (trusted-proxy client IP) and 11 (LAN HTTP with a warning). A second Medium pass re-checked the open items: S-007 is fixed (full dashboard CSP), S-002 does not reproduce, and S-003 and S-005 stay open for owner or shared decisions.
- **Stack:** Go 1.26 (net/http, pgx v5) API server with PostgreSQL; identity delegated to a separate AuthGuard service via `shared/backend/auth`; SvelteKit 2 / Svelte 5 static dashboard embedded in the Go binary; Android client (Kotlin, Retrofit/OkHttp, Room, SharedPreferences); Docker multi-stage image on `scratch`; GitHub Actions.
- **Scope:** Read all first-party backend code (`backend/*.go`), the Docker and CI configuration, the frontend API client, routes and query layer, the Vite config, the Android API client, preferences, manifest, network security config and app Gradle file, and the shared auth, authclient, authproxy, coreconfig and postgres code that CollabTable calls. Git history was searched for credential-shaped strings and `.env` files. Excluded: `node_modules`, `frontend/.svelte-kit`, the Gradle wrapper, generated build output, lock files (read for versions only), and the rest of `shared/`. Tracked SQLite files were inspected read-only from a copy, schema and row counts only. No tests, audits, builds or network calls were made; the analysis is static.
## Summary
| Severity | Count | Fixed | Not reproduced | Open |
|---|---:|---:|---:|---:|
| Critical | 0 | 0 | 0 | 0 |
| High | 0 | 0 | 0 | 0 |
| Medium | 10 | 7 | 1 | 2 |
| Low | 7 | 0 | 0 | 7 |
| Info | 2 | 0 | 0 | 2 |
No critical or high-severity issues were confirmed. Authentication is delegated to AuthGuard and fails closed when it is not configured, and sync tokens are generated with 256 bits of randomness and stored hashed. The main concerns are a reflective CORS policy with credentials, a login-disabled mode that hands out sync tokens to anyone, the absence of object-level authorization on data (possibly intended, but unscoped), missing rate limiting and security headers, and several Android client exposures (the token written to logcat, cleartext traffic permitted, and the token stored in plain preferences).
## Issues
### S-001 · Reflective CORS with credentials on every route · **Medium** · Fixed
- **Location:** `backend/server.go:274-290` (`withCORS`), in particular `:276-281`.
- **Description:** The middleware echoes any request `Origin` into `Access-Control-Allow-Origin` and sets `Access-Control-Allow-Credentials: true` on all responses, including session-protected routes (`/web/data`, `/api/auth/users`, `/api/auth/token/regenerate`). If the browser sends the user's cookies, any origin can read those responses. The preflight `Allow-Methods` list also omits `PATCH`, which `server.go:181` accepts.
- **Impact:** Exploitability depends on the AuthGuard cookie attributes, which are not in this repository. With `SameSite=Lax`, a cross-site page will not receive the cookie, but a same-site origin will (another subdomain of the same site, or a sibling app on a shared cookie domain, which the authclient docs describe as a cross-project SSO option). Such an origin could read `/web/data` or call `POST /api/auth/token/regenerate` and read the new sync token. Rated Medium here; it would be High if the cookie is scoped to a parent domain. Needs verification against the deployed AuthGuard cookie.
- **Recommendation:** Replace the reflection with an explicit allow-list from configuration (for example `ALLOWED_ORIGINS`) and set credentials headers only for those origins. The dashboard is same-origin and needs no CORS headers at all, so the default should be none. Keep `Vary: Origin` and add `PATCH` to the allowed methods if it is needed.
- **Status:** Fixed 2026-10-19 — `withCORS` now reflects only origins listed in `ALLOWED_ORIGINS` (empty by default), sends credentials headers only for them, and allows `PATCH` in preflight. Browser clients on other origins lose cross-origin access, which the same-origin dashboard does not need. Files: backend/server.go, backend/server_test.go, backend/README.md, README.md.
### S-002 · Login-disabled mode lets anyone obtain a write-capable sync token · **Medium** · Not reproduced
- **Location:** `backend/server.go:186-188` (`POST /api/auth/token/regenerate` behind `RequireIfLoginRequired`); `shared/backend/auth/proxy.go:504-519` (`CurrentUser` returns the superadmin placeholder whenever login is not required); `backend/auth.go:194-210` (`handleTokenRegenerate` mints a token for the placeholder identity).
- **Description:** When login is not required (`AUTH_DISABLED=true`, or the login-required override pushed by ProjectConfigurator set to false), `RequireIfLoginRequired` lets any caller reach token regeneration without credentials. The endpoint mints a write-capable sync token for identity 0, and the bearer-token check on the sync API then passes for that caller.
- **Impact:** The sync API's token requirement protects nothing in that mode, and any network client can obtain full read, write and delete access. The README describes `AUTH_DISABLED` as "nothing gated", so this matches the documented intent. The override path can be set centrally in a shared deployment, however, and nobody may notice that the token API has become open.
- **Recommendation:** Keep token minting behind a real credential even when login is off (for example, always require a session for token regeneration), or document the consequence prominently and log a warning when the override is set to false.
- **Status:** Not reproduced 2026-10-19 — The last step of the chain fails. With login off, callers resolve to the placeholder identity 0, and `requireAPIToken` (`backend/auth.go`) never accepts identity 0, so the token minted without a session gets 401 on `/api/sync` and `/api/lists`. Test `TestTokenMintedWithoutASessionDoesNotOpenTheSyncAPI` (`backend/db_test.go`, run against PostgreSQL) pins this. Write and delete access through the token API is not reachable. What login-off mode does open is the dashboard (`/web/data`, user management), as `AUTH_DISABLED` documents; `backend/README.md` now says so. Side effect: with login off, devices cannot get a working sync token; accepting identity 0 would fix that and open the sync API, so it is an owner decision. The `auth.go` comment that called such a token functional is corrected.
### S-003 · No object-level ownership or roles on list, field, item or value data · **Medium** · Open
- **Location:** `backend/auth.go:129-149` (`requireAPIToken` only checks that a token exists); `backend/server.go:195-219` (all data routes); `backend/data.go` (all handlers); `backend/sync.go:61-209`; `backend/db.go:40-189` (no owner or tenant columns); `backend/sync.go:198-203` and `backend/data.go:549-558` (item values upserted by `id` alone).
- **Description:** Any valid sync token (one per account) and any logged-in account can read, overwrite, soft-delete and move every list, field, item and value. The item-value conflict clause updates only `value` and `updatedat`, so a write that names a different `itemId` or `fieldId` than the stored row is silently applied to the stored row. The schema has no owner column, and `api_tokens.user_id` is used only for token regeneration. Item values are hard-deleted when their item or list is deleted (`sync.go:88`, `:129`, `:140`, `:166`), so those deletions cannot be undone by a later sync, even though lists and items are soft-deleted.
- **Impact:** For a collaborative tool this may be intended, in which case every account is effectively an administrator of the data. If it is not intended, it is an authorization gap. Either way, one compromised device token can wipe or rewrite the database, and some of that loss is permanent.
- **Recommendation:** Confirm the intended model and document it. If the data is shared, make item-value upserts reject writes whose `itemid` or `fieldid` do not match the stored row. If per-list access is needed, add a membership table and check it in every handler.
- **Status:** Open 2026-10-19 — Partly addressed: item values apply only to a stored row with the same `itemId` and `fieldId` (sync and REST; tests in `backend/db_test.go`), stale writes are ignored (see Q-006), and the current access model is written down in `backend/README.md` ("Access model"). Still needed: an owner decision on the model (shared data, or per-list membership, which needs a membership table checked in every handler), and whether item values should be soft-deleted instead of removed for good (a schema change).
### S-004 · Managed-user routes require a login only, leaving the role check to AuthGuard · **Medium** · Fixed
- **Location:** `backend/server.go:178-182` (list, create, update and delete users, behind `RequireIfLoginRequired`); `shared/backend/auth/proxy.go:897-1013` (handlers forward the caller's session to AuthGuard without a local role check); `shared/backend/auth/proxy.go:618` (`RequireUserManager` exists but CollabTable does not use it).
- **Description:** The handlers document that AuthGuard enforces authorization, which holds only if AuthGuard rejects non-admin sessions. CollabTable does not check the role before proxying. If AuthGuard does not reject it, `GET /api/auth/users` returns every account's username, email and role to any logged-in account.
- **Impact:** No defense in depth. A bug or policy change in AuthGuard would expose administrative functions here. Needs verification against the deployed AuthGuard version.
- **Recommendation:** Gate these routes with `RequireUserManager` (or `RequireAdminIfLoginRequired`), which the shared package already provides, so the policy is visible in this repository.
- **Status:** Fixed 2026-10-19 — Managed-user routes now pass the shared `RequireUserManager` gate, so the role check happens in this repository as well as in AuthGuard; accounts without user-management rights get 403 locally. Files: backend/server.go, backend/routes_test.go.
### S-005 · Password change does not require the current password, and existing sessions stay valid · **Medium** · Open
- **Location:** `shared/backend/auth/proxy.go:664-705` (`UpdateMe` accepts only `email`, `username` and `password`); `backend/auth.go:39-43` (documented behavior: a credentials change "simply returns the updated account and leaves the current session valid").
- **Description:** Anyone holding a session cookie can change the account password without knowing the current one. Sessions on other devices also remain valid, and there is no re-authentication step.
- **Impact:** A stolen or unattended session can lock the owner out. The usual defenses (re-authentication, and revoking other sessions on password change) are absent.
- **Recommendation:** Require `currentPassword` (and the TOTP code when enabled) on `POST /api/auth/credentials` whenever the password changes, and have AuthGuard revoke other sessions on a password change.
- **Status:** Open 2026-10-19 — Re-checked, shared-dependent. `UpdateMe` in the vendored `shared/backend/auth/proxy.go` accepts no `currentPassword`, and the shared medium pass left this open pending a decision on the request shape. Needed: that decision, then the change in Web/shared (and AuthGuard revoking other sessions), re-synced here. CollabTable cannot add the check alone without changing the `POST /api/auth/credentials` request.
### S-006 · No rate limiting or request budgets on login, token use, writes or body size · **Medium** · Fixed
- **Location:** `shared/backend/auth/proxy.go:1093-1142` (`Login` forwards every attempt to AuthGuard with no local throttling); `backend/auth.go:129-149` (sync-token check, no throttling); `backend/server.go:188` (token regeneration); `backend/server.go:253-259` (up to 50 MB per request, see P-007).
- **Description:** A search of CollabTable and the shared auth packages finds no rate limiter, lockout or request throttle. Brute-force protection for passwords and TOTP codes depends entirely on AuthGuard. Sync tokens carry 256 bits of entropy, so guessing them is not a practical concern; the issue is request volume and availability.
- **Impact:** Credential stuffing against the login proxy, load from unthrottled token checks, and memory exhaustion from large bodies.
- **Recommendation:** Add per-IP and per-account limits on `/api/auth/login`, `/api/auth/totp/*` and `/api/auth/setup`, either in-process or at the proxy. Confirm AuthGuard's own limits. Enforce body size per route (see P-007).
- **Status:** Fixed 2026-10-19 — In-process budgets (owner decision 5) on setup, login, the TOTP routes and token regeneration: 30 requests per minute per client IP, and 10 failed logins per account identifier per 15 minutes, answered with 429 and `Retry-After`. The client IP is read from `X-Forwarded-For` only when the socket peer is in the new `TRUSTED_PROXIES` list, and is the socket address otherwise. Not throttled per request: the sync API and writes, because the bearer token is 256 bits and devices sync often; body size and concurrent syncs bound their cost (P-007). Still to confirm: AuthGuard's own login limits on the deployed instance. Verified by Go unit and route tests only, not against a running instance. Files: backend/clientip.go, backend/ratelimit.go, backend/server.go, backend/clientip_test.go, backend/ratelimit_test.go, backend/.env.example, backend/README.md, README.md.
### S-007 · No security headers on the dashboard or API · **Medium** · Fixed
- **Location:** `backend/server.go:118-125` (no header middleware); `backend/server.go:292-316` (`spaFileServer` writes `index.html` with only `Content-Type`); `backend/web.go:74-76` (cache headers only).
- **Description:** Responses carry no `Content-Security-Policy`, no `X-Frame-Options` or `frame-ancestors`, no `X-Content-Type-Options` and no `Referrer-Policy`. The app can be framed, which allows clickjacking of user-management and token-regeneration actions. Without a CSP, an injected script would have no restrictions. No unsafe HTML rendering was found in first-party code, which limits the immediate risk.
- **Impact:** Clickjacking of logged-in actions and a weaker defense against future XSS. HSTS belongs at the TLS terminator and is not set here.
- **Recommendation:** Add middleware that sets `X-Frame-Options: DENY` (or `frame-ancestors 'none'`), `X-Content-Type-Options: nosniff`, `Referrer-Policy: strict-origin-when-cross-origin`, and a CSP such as `default-src 'self'` with hashes or nonces for SvelteKit's inline bootstrap script. Set HSTS at the proxy.
- **Status:** Fixed 2026-10-19 — The dashboard page (`index.html` and the deep-link fallback) now sends a full Content-Security-Policy (`backend/csp.go`, set in `spaFileServer`): `default-src 'self'`, `script-src 'self'` plus the SHA-256 of the page's inline bootstrap script (read from the embedded `index.html` at request time, so it follows each build), `style-src 'self' 'unsafe-inline'` (the page shell uses a style attribute), `connect-src 'self'`, `object-src 'none'`, `base-uri`, `form-action` and `frame-ancestors 'none'`. Other responses keep `frame-ancestors 'none'`. HSTS stays with the TLS proxy, as recommended, and `backend/README.md` says so. Checked on a real build: the Go hash equals an independent computation, and the bundle has no eval, workers, external URLs or CSS `url()`. Not loaded in a browser (none available here), so open the dashboard once after deploying.
### S-008 · Android app logs full HTTP traffic, including the bearer token, in every build · **Medium** · Fixed
- **Location:** `CollabTableAndroid/app/src/main/java/com/collabtable/app/data/api/ApiClient.kt:20-23` (`HttpLoggingInterceptor` at `Level.BODY`), and `:55-64` (the interceptor is added to the client unconditionally; `authInterceptor` at `:58` sets the `Authorization` header first).
- **Description:** The logging interceptor is not gated on the debug build type, and it does not redact headers. Its output includes the `Authorization: Bearer <token>` header and the full request and response bodies, which carry all list and item data, in release builds.
- **Impact:** The long-lived sync token and user data end up in logcat and in any log capture or bug report. Exploiting this requires access to device logs (ADB, a debugging tool, or a bug report), not a remote attack.
- **Recommendation:** Use `Level.NONE` for release builds (for example `if (BuildConfig.DEBUG)`), call `redactHeader("Authorization")`, and do not log bodies in production.
- **Status:** Fixed 2026-10-19 — HTTP logging now uses `Level.NONE` unless `BuildConfig.DEBUG`, and the `Authorization` header is redacted in every build; `buildConfig` is enabled because AGP 8.8 does not generate `BuildConfig` by default. The Kotlin compile could not run in this environment (the JVM hit the process limit), so it is unverified. Files: CollabTableAndroid/app/src/main/java/com/collabtable/app/data/api/ApiClient.kt, CollabTableAndroid/app/build.gradle.
### S-009 · Cleartext HTTP is allowed for all domains and is the default server URL · **Medium** · Fixed
- **Location:** `CollabTableAndroid/app/src/main/res/xml/network_security_config.xml:3-4` (`cleartextTrafficPermitted="true"` in `base-config`); `CollabTableAndroid/app/src/main/java/com/collabtable/app/data/preferences/PreferencesManager.kt:298` (default `http://10.0.2.2:8080/api/`); `CollabTableAndroid/app/src/main/java/com/collabtable/app/data/api/ApiClient.kt:25-44` (the bearer token is attached to every request).
- **Description:** The release app accepts `http://` server URLs for any host, and the bearer token is sent with every request. Traffic is unencrypted and can be read or altered on the network path.
- **Impact:** Token and data exposure on untrusted networks whenever an operator configures an HTTP URL. Cleartext is needed only for the emulator default.
- **Recommendation:** Keep cleartext only for debug builds (a debug resource overlay) or for `10.0.2.2` and `localhost`. Require HTTPS for remote hosts and reject `http://` in the settings UI otherwise.
- **Status:** Fixed 2026-10-19 — Handled by owner decision 11 (LAN HTTP allowed, with a warning). Cleartext stays permitted, so the network security config and the default emulator URL are unchanged. `ApiClient` logs a warning whenever the server URL is `http://`. The backend logs a warning at startup while TLS is off. `PRODUCTION=true` refuses plain HTTP requests unless they arrive over TLS or through a `TRUSTED_PROXIES` proxy that sends `X-Forwarded-Proto: https` (`/health` stays open). The Android app has no production profile, so release builds keep cleartext. The settings screen does not reject `http://` for remote hosts, which the decision replaces. Files: CollabTableAndroid/app/src/main/java/com/collabtable/app/data/api/ApiClient.kt, backend/server.go, backend/.env.example, backend/README.md, README.md. The Kotlin change is not compiled: the Android build cannot run on this Alpine (musl) host, because the SDK's aapt2 needs glibc.
### S-010 · Long-lived sync token stored in plain SharedPreferences, with app backup enabled · **Medium** · Fixed
- **Location:** `CollabTableAndroid/app/src/main/java/com/collabtable/app/data/preferences/PreferencesManager.kt:73-80` and `:283` (token written to `collab_table_prefs` with `MODE_PRIVATE`, unencrypted); `CollabTableAndroid/app/src/main/AndroidManifest.xml:11` (`android:allowBackup="true"`).
- **Description:** The API token is written to ordinary SharedPreferences. With `allowBackup="true"` the file is included in device backups, and on a rooted device or with ADB backup access it can be read directly.
- **Impact:** The token grants full sync access (see S-003) and can be recovered from a backup or a compromised device.
- **Recommendation:** Store the token with `EncryptedSharedPreferences` or the Android Keystore, exclude it from backups with `dataExtractionRules` and `fullBackupContent`, or set `allowBackup="false"`.
- **Status:** Fixed 2026-10-19 — `android:allowBackup` is now `false`, so the sync token is kept out of device backups and transfers. Users must re-enter the token on a new device, and the token remains plain text on the device, which a rooted device can still read. Files: CollabTableAndroid/app/src/main/AndroidManifest.xml.
### S-011 · Sync token has no expiry, scope or per-device identity · **Low**
- **Location:** `backend/db.go:181-188` (`api_tokens` has no expiry column); `backend/auth.go:159-170` (32 random bytes, stored as an unsalted SHA-256 hash); `backend/auth.go:194-210` (regeneration replaces the account's single token).
- **Description:** The token is well built: 256 bits from `crypto/rand`, stored only as a hash, and checked through an indexed lookup. It never expires, carries no scope, and cannot be revoked per device. Regenerating invalidates every device at once.
- **Impact:** A lost or retired device keeps write access until the operator regenerates the token, and regenerating also breaks every other device.
- **Recommendation:** Issue per-device tokens with `last_used` and `expires_at` columns and a revoke action, or at least document a rotation procedure.
### S-012 · Shared-secret comparisons are not constant-time · **Low**
- **Location:** `shared/backend/coreconfig/coreconfig.go:182` (`r.Header.Get("X-Internal-Auth") != secret`); `shared/backend/auth/proxy.go:819` (same pattern in `SetLoginRequiredInternal`).
- **Description:** A `!=` comparison on strings can exit early. Other helpers in the workspace use `subtle.ConstantTimeCompare` (`shared/backend/auth/reset.go:73`, `shared/backend/auth/totp.go:82`), so these two are inconsistent.
- **Impact:** A theoretical timing side channel on the internal `SECRET`. Network jitter makes practical exploitation unlikely.
- **Recommendation:** Compare with `subtle.ConstantTimeCompare` on byte slices, after confirming that the expected secret is non-empty.
### S-013 · `COOKIE_SECURE` does not govern the session cookie; its attributes come from AuthGuard · **Low**
- **Location:** `shared/backend/authclient/client.go:411-417` (`ForwardCookies` replays AuthGuard's `Set-Cookie` unchanged); `shared/backend/auth/proxy.go:1140` (login forwards those cookies); `shared/backend/authproxy/authproxy.go:72-83` (only the logout-clearing cookies use the `secure` flag); `README.md:55`.
- **Description:** The README says `COOKIE_SECURE=true` marks cookies `Secure`. In practice that flag affects only the cookies CollabTable clears on logout. The live session cookie's `Secure`, `SameSite` and `Domain` attributes come from AuthGuard. Needs verification against the AuthGuard configuration.
- **Impact:** An operator may believe the session cookie is `Secure` when it is not, and the cookie's scope (see S-001) is not visible from this repository.
- **Recommendation:** Document that AuthGuard controls these attributes, and verify them in a deployed environment (`Secure`, `HttpOnly`, `SameSite`, `Domain`).
### S-014 · No length or format limits on input, and item-value upserts do not check row ownership · **Low**
- **Location:** `backend/models.go:50-94` (all IDs and free-text fields are unconstrained strings); `backend/data.go:223-263` (list creation checks only for an empty ID and name); `backend/sync.go:96-98` (`fieldType` accepts any string); `backend/sync.go:198-203` and `backend/data.go:549-558` (the upsert conflict clause ignores `itemid` and `fieldid`); `backend/data.go:206-214` (the `X-Device-Id` header is stored verbatim in notifications).
- **Description:** Client-chosen primary keys and free-text fields have no length or character limits, and `fieldType` is not checked against the types the UI understands. The item-value conflict clause (see S-003) silently ignores a mismatched `itemId` or `fieldId`. The device identifier is stored without limits.
- **Impact:** Oversized rows and storage growth, inconsistent typing, and a data-integrity problem that is as much a correctness issue as a security one.
- **Recommendation:** Bound string lengths (IDs to a sensible maximum such as 64 characters, names to a few hundred, values to a configured limit). Validate `fieldType` against the known set. Reject item-value writes whose `itemId` or `fieldId` do not match the stored row, or add that check to the conflict clause.
### S-015 · Public first-run setup can be claimed by whoever reaches the server first · **Low**
- **Location:** `backend/server.go:173` (`POST /api/auth/setup` is public); `shared/backend/auth/proxy.go:1014-1091` (`Signup` registers the first AuthGuard account while setup is unclaimed).
- **Description:** Until an operator completes setup, anyone who can reach the URL can create the first account, which in AuthGuard is the superadmin. The claim flag prevents a second setup, but not a first-visitor takeover.
- **Impact:** Matters only for a deployment reachable from untrusted networks before setup is completed. It is a common pattern for setup flows, but it should be stated.
- **Recommendation:** Complete setup before exposing the service, or protect `/api/auth/setup` with a one-time setup token printed at startup or supplied through the environment.
### S-016 · CI and supply-chain hygiene · **Low**
- **Location:** `.github/workflows/docker.yml:52` (`echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login ...`, with the secret interpolated into the shell script); `.github/workflows/docker.yml:34-65`, `.github/workflows/lint.yml:35-39` and `.github/workflows/tests.yml:35-62` (third-party actions pinned to major tags, not commit SHAs); `.github/workflows/tests.yml:70` (web-ui installed with `--no-package-lock`).
- **Description:** The Docker Hub token is interpolated into a shell command rather than passed through an environment variable. Actions are referenced by mutable tags.
- **Impact:** Lower risk on GitHub-hosted runners, but a compromised action tag would run with access to the secret on pushes to `main`.
- **Recommendation:** Pass the secret through an `env:` entry and pipe it to `docker login --password-stdin` from that variable. Pin actions to full commit SHAs, which Dependabot can maintain. Use a lock file for web-ui.
### S-017 · Dependency versions need an audit, which was not possible offline · **Low**
- **Location:** `backend/go.mod` (`github.com/jackc/pgx/v5 v5.10.0`, `golang.org/x/crypto v0.54.0`, `github.com/joho/godotenv v1.5.1`); `frontend/package-lock.json` (`svelte 5.56.8`, `@sveltejs/kit 2.70.2`, `vite 8.2.0`, `@tanstack/svelte-query 6.1.38`, `tailwindcss 4.3.3`); `frontend/package.json` (21 `"latest"` specifiers, see Q-011 in the Quality report); `CollabTableAndroid/app/build.gradle` (`okhttp3:logging-interceptor 4.12.0`, `retrofit2 2.9.0`, `kotlinx-coroutines-android 1.7.3`).
- **Description:** Versions were read from manifests and locks only. No vulnerability database was queried, because that requires network access. Several Android libraries are older releases, for example Retrofit 2.9.0 and kotlinx-coroutines 1.7.3.
- **Impact:** Known-vulnerable dependencies may be present. This review can neither confirm nor rule them out.
- **Recommendation:** Run `govulncheck ./...` in `backend`, `npm audit` (including build tooling) in `frontend`, and a Gradle dependency vulnerability scan (for example OWASP Dependency-Check) for the Android app. Upgrade whatever is flagged.
### S-018 · Committed-secret scan found no live credentials · **Info**
- **Location:** Tracked files (`git ls-files`); full history of `backend/.env.example` (commits `07e25a3` and `9a6ec94` for the `SECRET` and `DATABASE_URL` lines); `git log -G` over all refs for credential-shaped strings; `docker/Dockerfile`; `README.md`.
- **Description:** No `.env`, key or certificate files are tracked. The only env file is `backend/.env.example`, which holds placeholders. The historical `SECRET` value at `07e25a3` was the placeholder text, and the historical `DATABASE_URL` at `9a6ec94` was empty. The history search matched only test fixtures in `shared/` and documentation placeholders, and those hits were reviewed and redacted. The tracked SQLite file `backend/data/collabtable.db` has empty tables and no credentials (see Q-014 in the Quality report).
- **Impact:** None found.
- **Recommendation:** Keep `.env` ignored (it is, in `backend/.gitignore`), and consider a pre-commit secret scanner.
### S-019 · Controls verified as sound · **Info**
- **Location:** `backend/data.go:107-113`, `:145-149`, `:178-182` (dynamic SQL only adds numbered placeholders); `backend/db.go` and `backend/data.go` (all values bound as parameters); `backend/server.go:292-316` (static files served only from the embedded build, so no path traversal); `frontend/src` (no `{@html}`, `innerHTML` or `eval`; Svelte escapes text); `backend/auth.go:159-170` and `:194-210` (token generation and hashing); `shared/backend/coreconfig/coreconfig.go:182` and `shared/backend/auth/proxy.go:817-820` (internal endpoints refuse requests when `SECRET` is empty); `shared/backend/auth/proxy.go:359-361` and `:838-841` (auth fails closed when `SECRET` or the AuthGuard URL is missing); `shared/backend/authclient/client.go:116` (5-second timeout on outbound calls); `docker/Dockerfile:41-47` (non-root user, `scratch` base, no build tools in the final image); no `InsecureSkipVerify` or similar TLS bypass in CollabTable's own code or in the packages it imports.
- **Impact:** Positive findings.
- **Recommendation:** None.
## Notes
- Static analysis only. Nothing was executed: no tests, builds, dependency audits or network calls. Fail-closed behavior was confirmed by reading the code, not by running the server.
- AuthGuard, the identity service, is outside this repository. S-001 (exploitability), S-004, S-005, S-006 and S-013 depend on how it behaves and should be verified against a running instance.
- Android findings come from source, manifest and Gradle review. The app was not built or run.
- `shared/` was reviewed selectively. `shared/backend/syncsocket/syncsocket.go:269` sets `InsecureSkipVerify = true` (which disables WebSocket origin checks in the library) when the allowed origin is `*`. CollabTable does not import this package, so it is not counted here, but its owners should review it.
- `shared/.githooks/post-commit` runs `shared/scripts/sync-consumers.ps1 -Commit` on commit once the hook path is configured (see `install-sync-hook.ps1`). `-Push` is opt-in (`sync-consumers.ps1:11-12` and `:370`). This is a developer-workflow concern rather than a runtime one.