v1.1.0:8 — admin-gate whole-DB routes + AI custom-URL providers; SSRF guard
CI / proof-of-work (Next.js app) (push) Has been cancelled
CI / start9/0.4 (StartOS package code) (push) Has been cancelled

Multi-user authorization hardening from a full security evaluation (EVALUATION.md):

- P0: /api/settings/{export,import}-db are now admin-only. Previously any signed-in user could download the whole instance DB (all bcrypt hashes + plaintext AI keys) or replace it wholesale. Per-user CSV export/import stays open.

- AI custom-URL providers (Ollama, OpenAI-compatible) are now admin-only, and every server fetch to a user-supplied URL passes through assertSafeProviderUrl (blocks link-local/cloud-metadata; private LAN allowed by design). Fixed-URL cloud providers stay per-user. Removed the dead legacy /api/ai/config route.

- Dev: fixed broken quick-start (added npm run create-admin; rewrote README; dropped dead CLAUDE_API_KEY) and the export-db 0-byte path resolution (resolveDatabasePath now matches Prisma).

ExVer bumped to 1.1.0:8 (no schema/data migration). Tests 197 pass, build green, tsc clean.
This commit is contained in:
Keysat
2026-06-12 23:15:09 -05:00
parent 09eeef249d
commit 988a3cca9a
30 changed files with 815 additions and 195 deletions
+6 -1
View File
@@ -13,6 +13,7 @@ import { v_1_1_0_4 } from './v1.1.0.4'
import { v_1_1_0_5 } from './v1.1.0.5'
import { v_1_1_0_6 } from './v1.1.0.6'
import { v_1_1_0_7 } from './v1.1.0.7'
import { v_1_1_0_8 } from './v1.1.0.8'
/**
* Version graph for the `proof-of-work` package.
@@ -48,9 +49,12 @@ import { v_1_1_0_7 } from './v1.1.0.7'
* v1.1.0:7 — Exercise-history popup auto-loads more rows on scroll
* (switched from a flaky IntersectionObserver-in-popup to
* a plain scroll listener with 300px lookahead).
* v1.1.0:8 — Multi-user authz hardening: whole-instance DB export/import
* admin-only; custom-URL AI providers (Ollama / OpenAI-compatible)
* admin-only + SSRF guard; dead legacy /api/ai/config removed.
*/
export const versionGraph = VersionGraph.of({
current: v_1_1_0_7,
current: v_1_1_0_8,
other: [
v_1_0_0_1,
v_1_0_0_2,
@@ -65,5 +69,6 @@ export const versionGraph = VersionGraph.of({
v_1_1_0_4,
v_1_1_0_5,
v_1_1_0_6,
v_1_1_0_7,
],
})
+35
View File
@@ -0,0 +1,35 @@
import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'
/**
* v1.1.0:8 — Multi-user authorization hardening (2026-06-13 security batch).
*
* Closes a P0 multi-tenant breach and the related SSRF surface found in a
* full security evaluation (see EVALUATION.md at the repo root):
*
* - Whole-instance DB export/import (`/api/settings/{export,import}-db`) are
* now admin-only. Previously any signed-in user could download the entire
* SQLite database (every user's bcrypt hashes + plaintext AI keys) or
* replace it wholesale. The per-user CSV export/import stays open to all.
* - AI providers that take a custom base URL (Ollama, OpenAI-compatible) are
* now admin-only, and all server-side fetches to a user-supplied URL pass
* through an SSRF guard that blocks link-local / cloud-metadata addresses
* (private-LAN + loopback stay allowed — reaching ollama.startos is the
* point). Fixed-URL cloud providers (Claude/OpenAI/Gemini) remain per-user.
* The dead legacy `/api/ai/config` route was removed.
* - Dev-only: fixed a 0-byte export-db path resolution and the broken
* quick-start (added `npm run create-admin`).
*
* App-code only — no schema, no API contract change for existing data, no
* data migration. Existing /data survives untouched.
*/
export const v_1_1_0_8 = VersionInfo.of({
version: '1.1.0:8',
releaseNotes: {
en_US:
'Security hardening. Full-database export and import are now admin-only — previously any signed-in user could download or replace the entire instance database (all users\' data, password hashes, and AI keys). AI providers that use a custom server URL (Ollama, OpenAI-compatible) are now admin-only and protected against requests to internal metadata addresses; the fixed cloud providers (Claude, OpenAI, Gemini) stay available to every user. The per-user CSV export/import is unchanged. No schema or data changes — your existing data is untouched.',
},
migrations: {
up: async () => {},
down: IMPOSSIBLE,
},
})