Skip to content

feat(web): add authenticated browser-hosted Tabularis UI - #676

Open
debba wants to merge 59 commits into
mainfrom
feat/web-ui
Open

feat(web): add authenticated browser-hosted Tabularis UI#676
debba wants to merge 59 commits into
mainfrom
feat/web-ui

Conversation

@debba

@debba debba commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR introduces Tabularis Web, a browser-hosted mode that reuses the existing React UI and Rust application services while preserving the native Tauri desktop application.

Users can start a local authenticated browser session with:

tabularis web

The implementation adds a shared typed application boundary, an authenticated HTTP/WebSocket transport, browser-specific platform adapters, and broad desktop-to-browser feature parity. Running Tabularis without the web subcommand keeps the existing desktop behavior.

Why

Tabularis was previously coupled to the Tauri IPC and native-window runtime. This prevented the application from being operated through a browser, deployed as a headless service, or tested against a transport-independent application contract.

This change separates application services from transport concerns so that:

  • desktop and browser clients use the same backend services;
  • browser access does not expose Tauri internals or server filesystem paths;
  • local browser sessions remain authenticated by default;
  • remote deployments have explicit authentication and authorization boundaries;
  • frontend features can negotiate platform capabilities instead of relying on runtime assumptions.

Architecture

Shared frontend package

  • Moves the frontend into packages/web-ui as @tabularis/web-ui.
  • Keeps root-level compatibility scripts for existing development and desktop workflows.
  • Centralizes browser routes and supports direct navigation and refresh-safe SPA fallback.
  • Adds CI-enforced inventory and boundary checks for remaining Tauri imports and direct invokes.

Typed application client

  • Adds shared command, event, error, authorization, and operation contracts.
  • Introduces a root TabularisClientProvider used by application features.
  • Provides both Tauri and HTTP/WebSocket transports behind the same typed client API.
  • Includes a dual-transport contract suite to detect behavior and serialization drift.

Shared Rust application layer

  • Extracts runtime bootstrap, lifecycle, paths, secrets, state, and events from the desktop-only path.
  • Moves reusable business operations into src-tauri/src/application services.
  • Keeps Tauri commands as adapters while exposing the same services through versioned Web RPC.
  • Adds session-aware cancellation, cleanup, authorization, and operation tracking.

Web transport

  • Adds an Axum HTTP server with packaged SPA assets and graceful shutdown.
  • Exposes versioned authenticated RPC and session-scoped WebSocket events.
  • Supports replay, bounded queues, heartbeat/reconnect behavior, request IDs, deadlines, stable errors, and payload limits.
  • Adds opaque, purpose-bound, expiring upload/download tokens instead of accepting browser-provided server paths.

Feature coverage

The browser mode covers the main Tabularis workflows:

  • connection CRUD, groups, tags, drivers, icons, and active state;
  • SSH and Kubernetes profiles, tunnels, progress, and askpass flows;
  • metadata exploration, schemas, tables, views, routines, triggers, and users;
  • query execution, batches, counts, EXPLAIN, cancellation, and progress events;
  • record insert/update/delete, BLOB preview/upload/download, and data-grid workflows;
  • settings, themes, keybindings, editor preferences, and connection restore state;
  • saved queries, query history, notebooks, and secondary-window routes;
  • connection import/export, backup, database dump/import, and generic exports;
  • AI generation, explanations, activity, sessions, and approval handling;
  • plugin registry/lifecycle, driver plugins, and UI extension assets;
  • logs, task manager operations, and local MCP host configuration.

Browser-only adaptations are capability-driven and provide explicit fallbacks for file dialogs, downloads, clipboard permissions, notifications, external links, secondary windows, plugin install links, and updater behavior.

Security model

Local mode

  • Binds to 127.0.0.1 by default.
  • Uses a high-entropy, single-use bootstrap token with a 60-second expiry.
  • Exchanges the bootstrap token for an opaque HttpOnly, SameSite=Strict session.
  • Validates Host, Origin, and CSRF state.
  • Redacts tokens, credentials, SQL text, request bodies, and result payloads from Web audit records.

Remote mode

Non-loopback deployment is rejected unless remote authentication is fully configured. Supported modes are:

  • password authentication through TABULARIS_WEB_PASSWORD;
  • trusted-proxy authentication through TABULARIS_WEB_PROXY_SECRET.

Remote deployments require an HTTPS public URL and explicit allowed origins. Sessions receive database-only permissions by default. Host-level operations remain denied unless the operator explicitly enables --allow-high-risk; MCP remains unavailable remotely.

Additional protections include login rate limiting, secure cookies, strict origin handling, bounded request/result sizes, session ownership checks, scoped transfer tokens, cleanup on expiry/logout/shutdown, and restricted plugin asset delivery with CSP headers.

CLI and deployment

New Web options include:

  • web (subcommand)
  • --host
  • --port
  • --no-open
  • --web-root
  • --auth
  • --public-url
  • --allowed-origin
  • --allow-high-risk

Packaged browser assets are verified for release artifacts. The operator documentation covers local use, reverse proxies, systemd, containers, credential storage, upgrades, rollback, troubleshooting, plugin trust, and browser limitations.

Testing and verification

The branch completion ledger records the following final gates:

  • pnpm lint
  • pnpm typecheck
  • pnpm test:coverage — 270 files / 4,023 tests
  • pnpm test:rust — 1,292 passed / 4 ignored
  • pnpm build
  • package build for @tabularis/web-ui
  • typed dual-transport contract tests
  • Web resilience and packaging checks
  • frontend Tauri boundary and API inventory checks
  • real-database Playwright E2E coverage across Chromium, Firefox, and WebKit
  • cross-platform release matrix and packaged-asset verification
  • authenticated desktop and Web smoke tests
  • signed 29-row manual desktop/Web parity audit

The latest CI run for feat/web-ui completed successfully before this PR was opened.

Documentation

  • web-ui-project/docs/WEB_MODE_OPERATIONS.md
  • web-ui-project/docs/WEB_REMOTE_SECURITY.md
  • web-ui-project/docs/WEB_PERFORMANCE_RESILIENCE.md
  • web-ui-project/docs/WEB_MANUAL_PARITY_AUDIT.md
  • web-ui-project/docs/WEB_MODE_UPGRADES.md
  • web-ui-project/docs/architecture/decisions/
  • web-ui-project/tasks/PROGRESS.md

Review guide

This is intentionally a large architectural change. The recommended review order is:

  1. ADRs and typed contracts.
  2. Runtime/application-service extraction.
  3. Web authentication, authorization, RPC, events, and transfer-token boundaries.
  4. Tauri and HTTP transport parity.
  5. Browser capability adapters and feature migrations.
  6. Contract, resilience, packaging, and E2E test suites.
  7. Operator/security documentation and release workflow changes.

Areas with the highest regression risk are shared runtime bootstrap, connection/query lifecycle, persistence, tunnels, plugin management, file transfers, and desktop/Web transport parity.

Compatibility and operational notes

  • Desktop remains the default process mode.
  • Existing driver plugins continue to run server-side over the existing JSON-RPC protocol.
  • Desktop and Web modes use the same runtime data and configuration locations for the process account.
  • Browser query pages and serialized responses are bounded; large datasets should use pagination or streamed export.
  • Browser assets and the server binary must come from the same revision/release.
  • UI extensions remain trusted same-page code and are not sandboxed.

Scope

This PR contains 49 commits and changes approximately 1,040 files, including the frontend package move. Reviewers should use rename-aware diffs where possible to distinguish relocated files from behavioral changes.

debba added 30 commits August 21, 2026 16:35
Some("png") => "image/png",
Some("jpg" | "jpeg") => "image/jpeg",
Some("webp") => "image/webp",
Some("svg") => "image/svg+xml",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: Stored XSS via user-uploaded SVG connection icons

connection_icon_asset serves .svg uploads as image/svg+xml inline with only Cache-Control and Content-Type headers — no X-Content-Type-Options: nosniff, no Content-Security-Policy, and no Content-Disposition: attachment (contrast plugin_asset, which applies PLUGIN_ASSET_CSP + nosniff + CORP). Any authenticated user can upload an SVG containing <script> via /api/v1/uploads/connection-icons; navigating an admin's browser to /api/v1/assets/connection-icons/<file>.svg executes that script in the Web UI origin, yielding stored XSS against the database admin UI. Add nosniff and a strict CSP (or force Content-Disposition: attachment and serve from a sandboxed origin) for this handler.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

) -> Result<IssuedSession, AuthenticationError> {
let now = Instant::now();
let mut state = self.lock_state();
if state

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Global login rate-limit enables trivial global lockout DoS (proxy mode)

SecurityState.failed_logins / blocked_until are process-global, not per-identifier, and the lockout check runs before credential validation. In trusted-proxy mode every cookieless request reaches authenticate_proxyauthenticate_remote; an attacker who can merely reach the HTTP port can send 5 wrong x-tabularis-proxy-secret values within the window and set blocked_until, locking out every legitimate proxy user (including correct-secret requests) for the full lockout duration. Apply rate limiting per-identifier, and avoid applying password-style brute-force lockout to the trusted-proxy flow.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

);
return status_response(StatusCode::UNAUTHORIZED);
};
match state.security.authenticate_proxy(secret, user) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Proxy auth mints a fresh session on every cookieless request

When no valid session cookie is present, authenticate_proxyissue_session inserts a new SessionRecord on each request, and the response always sets a new session cookie. The session store has no capacity cap (unlike WebEventBus::max_sessions); sessions are only pruned at TTL expiry. A reverse proxy that does not round-trip the cookie — or any holder of the proxy secret — can exhaust server memory by minting unbounded sessions over their TTL. Reuse an existing session for an already-authenticated proxy identity, or bound the session store.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Ok(Err(InvocationError::Application(error))) => failure(
metadata.application_error_status,
metadata.application_error_code,
error.message,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Application error messages/details forwarded verbatim to clients

InvocationError::Application(error) propagates error.message and error.details directly into the stable RPC error response. Downstream producers build these strings from fs/IO errors (map_err(|e| e.to_string())) and driver errors, which include absolute server filesystem paths, SQL text, and potentially credential-bearing connection strings. This leaks server internals to remote clients. Sanitize/replace the message at the RPC boundary (keep the stable application_error_code, drop or genericize the free-text message/details).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

pub const RPC_CANCELLATION_HEADER_NAME: &str = "x-tabularis-cancellation-id";

const DEFAULT_DEADLINE: Duration = Duration::from_secs(30);
const MAX_DEADLINE: Duration = Duration::from_secs(6 * 60 * 60);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Client-controlled 6 h deadline enables resource-hold DoS

MAX_DEADLINE is 6 hours and the deadline is taken from the client-supplied x-tabularis-deadline-ms header (capped only at this value). An authenticated remote session can set a near-6 h deadline and issue long-running queries to occupy its full per-session concurrency budget (16) and a chunk of the global budget (64) for hours. Six hours is far beyond a reasonable web-RPC bound; lower the cap and consider a separate, smaller bound for remote sessions.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

headers.insert(
CONTENT_DISPOSITION,
HeaderValue::from_str(&content_disposition)
.expect("sanitized file names are valid header values"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Content-Disposition header panics on unsanitized filename

metadata.file_name ultimately derives from the client-supplied x-tabularis-file-name upload header (url-decoded, no sanitization) and is interpolated into Content-Disposition then parsed with HeaderValue::from_str(...).expect(...). A filename containing ", \r, or \n makes from_str return Err, panicking the handler task (per-request DoS) instead of returning an error response. Validate/sanitize the filename (strip control bytes and quotes, or use from_str with a graceful fallback).


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

events: WebEventBus,
) -> Router {
let index = web_root.join("index.html");
let static_files = ServeDir::new(web_root).fallback(ServeFile::new(index));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: No CSP/hardening headers on the SPA shell

The app shell is served via ServeDir::new(web_root).fallback(ServeFile::new(index)) with no Content-Security-Policy, X-Content-Type-Options, Referrer-Policy, or Cross-Origin-Resource-Policy. The login page (login_page) and plugin assets set CSP, but the actual admin SPA — which handles credentials and DB data — does not, leaving no defense-in-depth mitigation if an XSS reaches the bundle. Add a baseline CSP + nosniff for the static fallback.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

return Ok(Vec::new());
};
let selected: HashSet<&str> = events.iter().map(String::as_str).collect();
Ok(session

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Reconnect silently drops events evicted from bounded history

When a client subscribes with since, only events still present in the bounded history deque (capacity 128) are returned; events between since and the oldest retained entry are silently lost, and the subscribe result carries no gap/watermark indicator, so the client cannot detect data loss and resync. Return a high-watermark or missed flag so clients can refetch full state after a gap.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 722 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 1004 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1547 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 41 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 645 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 251 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Files Reviewed (this pass)

Incremental pass for 64472f08..75334a36 (merge of main + manual TablePlus import path, SQLite virtual-column hiding, multi-statement result export). No new issues found in the changed code. All 8 previously reported findings were re-verified against current HEAD 75334a36 — their inline comments are anchored to the current commit on unchanged transport files, so they remain active.

Files reviewed this pass:

  • src-tauri/src/application/connection_files.rs - 0 new issues
  • src-tauri/src/connection_import/mod.rs - 0 issues
  • src-tauri/src/connection_import/tableplus.rs - 0 issues
  • src-tauri/src/connection_import_commands.rs - 0 issues
  • src-tauri/src/drivers/sqlite/mod.rs - 0 issues
  • packages/web-ui/src/components/modals/ExportProgressModal.tsx - 0 issues
  • packages/web-ui/src/components/modals/ImportFromAppModal.tsx - 0 issues
  • packages/web-ui/src/pages/Editor.tsx - 0 issues
  • packages/web-ui/src/utils/resultExport.ts - 0 issues
  • packages/web-ui/src/types/connectionImport.ts - 0 issues
  • packages/web-ui/src/i18n/locales/*.json - 0 issues (translation keys)
  • test/doc files - 0 issues

Fix these issues in Kilo Cloud

Previous Review Summaries (7 snapshots, latest commit 64472f0)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 64472f0)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 722 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 1004 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1547 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 41 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 645 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 251 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Files Reviewed (5 files)
  • .github/workflows/ci.yml - 0 issues
  • .github/workflows/pg-integration.yml - 0 issues
  • web-ui-project/docs/web-ui-parity.json - 0 issues
  • web-ui-project/scripts/check-web-ui-documentation.test.mjs - 0 issues
  • web-ui-project/scripts/web-ui-tauri-boundary-allowlist.json - 0 issues

Incremental pass for commit 64472f08 (fix(ci): repair web and PostgreSQL checks) reviewed only CI/docs/test infrastructure. No new issues. All 8 previously reported findings were re-verified against current HEAD and remain active in unchanged Rust files.

Fix these issues in Kilo Cloud

Previous review (commit fc0f3ba)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 722 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 1004 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1547 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 41 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 645 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 251 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Incremental Review (commit fc0f3ba)

This update swaps the SPA shell favicon from /vite.svg to /favicon.png (added binary asset) in packages/web-ui/index.html. No new issues found in the changed code; the change is cosmetic and does not affect any prior finding. All 8 previously reported findings remain active at HEAD fc0f3ba7.

Files reviewed this pass:

  • packages/web-ui/index.html - 0 issues
  • packages/web-ui/public/favicon.png - 0 issues (binary asset)

Fix these issues in Kilo Cloud

Previous review (commit 1c32773)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 722 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 1004 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1547 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 41 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 645 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 251 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Incremental Review (commit 1c32773)

This update adds a server-side file browser for the Web UI: a new server_files module (list_directory/resolve_save_target/validate_save_target), four local-admin-gated RPC commands (list_server_directory, resolve_server_save_target, create_sqlite_file, create_sqlite_database), a --server-file-browser-root CLI flag, a serverFileBrowser session capability scoped to LocalAdmin, and a browser-side BrowserPlatformDialogs picker wired via CustomEvent.

The new code is security-conscious: roots and entries are canonicalized, path containment is enforced via starts_with against canonical roots, save file names reject directory separators/traversal, symlinks resolving outside a root are filtered, SQLite creation uses create_new (no silent overwrite), and the capability is only advertised to LocalAdmin sessions. No new issues found in the changed code; all 8 prior findings remain active at the current HEAD.

Files reviewed this pass:

  • src-tauri/src/transport/web/server_files.rs - 0 issues
  • src-tauri/src/transport/web/server_files/tests.rs - 0 issues
  • src-tauri/src/transport/web/rpc.rs - 0 new issues (prior rpc.rs findings remain on unchanged lines)
  • src-tauri/src/transport/web/server.rs - 0 new issues (prior server.rs findings remain on unchanged lines)
  • src-tauri/src/transport/web/contract.rs - 0 issues
  • src-tauri/src/transport/web/mod.rs - 0 issues
  • src-tauri/src/sqlite_database.rs - 0 issues
  • src-tauri/src/cli.rs / src-tauri/src/cli/tests.rs / src-tauri/src/lib.rs - 0 issues
  • packages/web-ui/src/components/modals/BrowserPlatformDialogs.tsx - 0 issues
  • packages/web-ui/src/platform/browserCapabilities.ts / browserDialogs.ts - 0 issues
  • packages/web-ui/src/main.tsx / App.tsx / pages/Editor.tsx - 0 issues
  • packages/web-ui/src/components/settings/LogsTab.tsx - 0 issues
  • packages/web-ui/src/hooks/useCreateSqliteDatabase.ts - 0 issues
  • packages/web-ui/src/components/modals/NewConnectionModal.tsx - 0 issues
  • packages/web-ui/src/api/contract.ts / api/session.ts - 0 issues
  • packages/web-ui/src/i18n/locales/*.json - 0 issues
  • web-ui-project/docs/WEB_MODE_OPERATIONS.md - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 55bf5db)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 698 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 980 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1521 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 40 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 621 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 236 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Incremental Review (commit 55bf5db)

This update refactors the Web launch surface from a --web flag into a web subcommand (with args_conflicts_with_subcommands, a Command::Web(WebArgs) enum, and --debug promoted to global = true), and scopes the ProductionBanner to editor routes via isEditorRoute. All call sites in lib.rs, dev/e2e/packaging scripts, and the documentation-coverage test were updated consistently. New/updated tests cover the subcommand parse paths, legacy --web rejection, and banner scoping. No new issues found in the changed code; all 8 prior findings remain in unchanged Rust transport files and were verified as still active.

Files reviewed this pass:

  • src-tauri/src/cli.rs - 0 issues
  • src-tauri/src/cli/tests.rs - 0 issues
  • src-tauri/src/lib.rs - 0 issues
  • packages/web-ui/src/components/layout/MainLayout.tsx - 0 issues
  • packages/web-ui/tests/components/layout/MainLayout.test.tsx - 0 issues
  • scripts/dev-web.mjs - 0 issues
  • web-ui-project/e2e/start-server.sh - 0 issues
  • web-ui-project/scripts/check-web-ui-documentation.test.mjs - 0 issues
  • web-ui-project/scripts/verify-linux-web-package.sh - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 9e75c18)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 698 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 980 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1521 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 40 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 621 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 236 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Incremental Review (commit 9e75c18)

This update added a connection-scoped editor route (/connections/:connectionId/editor) alongside the legacy /editor path, with a new ConnectionEditorRoute component that activates/switches the connection from the URL, plus buildEditorRoute/isEditorRoute routing helpers and sidebar/command-table updates. The incremental diff (11 files, ~240 lines) is frontend-only and covered by new unit tests. No new issues found in the changed code; all 8 prior findings remain in unchanged Rust transport files and were re-verified as still active.

Files reviewed this pass:

  • packages/web-ui/src/pages/ConnectionEditorRoute.tsx - 0 issues
  • packages/web-ui/src/routing.ts - 0 issues
  • packages/web-ui/src/App.tsx - 0 issues
  • packages/web-ui/src/pages/Connections.tsx - 0 issues
  • packages/web-ui/src/components/layout/sidebar/ConnectionGroupItem.tsx - 0 issues
  • packages/web-ui/src/components/layout/sidebar/OpenConnectionItem.tsx - 0 issues
  • packages/web-ui/src/utils/commandTable.ts - 0 issues
  • packages/web-ui/tests/pages/ConnectionEditorRoute.test.tsx - 0 issues
  • packages/web-ui/tests/pages/Connections.test.tsx - 0 issues
  • packages/web-ui/tests/routing.test.ts - 0 issues
  • packages/web-ui/tests/utils/commandTable.test.ts - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit 3d9d0ef)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 698 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 980 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1521 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 40 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 621 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 236 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Incremental Review (commit 3d9d0ef)

This update added SQL code-folding + hover-preview in the web UI and a cross-platform dev:web script. The incremental diff (10 files, ~567 lines) is frontend-only and well-covered by unit tests. No new issues found in the changed code; all 8 prior findings remain in unchanged Rust transport files and were re-verified as still active against the current HEAD.

Files reviewed this pass:

  • packages/web-ui/src/utils/sqlFolding.ts - 0 issues
  • packages/web-ui/src/utils/sqlFoldPreview.ts - 0 issues
  • packages/web-ui/src/components/ui/SqlEditorWrapper.tsx - 0 issues
  • packages/web-ui/src/pages/Editor.tsx - 0 issues
  • packages/web-ui/src/index.css - 0 issues
  • scripts/dev-web.mjs - 0 issues
  • package.json - 0 issues
  • packages/web-ui/tests/** - 0 issues (test additions)

Fix these issues in Kilo Cloud

Previous review (commit f308c3f)

Status: 8 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 6
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
src-tauri/src/transport/web/server.rs 698 Stored XSS via user-uploaded SVG connection icons (no nosniff/CSP/Content-Disposition)

WARNING

File Line Issue
src-tauri/src/transport/web/auth.rs 367 Global login rate-limit enables trivial global lockout DoS in proxy mode
src-tauri/src/transport/web/server.rs 980 Proxy auth mints a fresh session per cookieless request → unbounded session growth
src-tauri/src/transport/web/rpc.rs 1521 Application error messages/details forwarded verbatim → server path/SQL leakage
src-tauri/src/transport/web/rpc.rs 40 Client-controlled 6 h deadline enables resource-hold DoS
src-tauri/src/transport/web/server.rs 621 Content-Disposition .expect() panics on unsanitized filename
src-tauri/src/transport/web/server.rs 236 No CSP/hardening headers on the SPA shell

SUGGESTION

File Line Issue
src-tauri/src/transport/web/events.rs 324 Reconnect silently drops events evicted from bounded history (no gap indicator)
Scope & Files Reviewed

This PR is a large architectural change (~1,040 files, frontend package move + new Web transport). Review focused on the highest-risk new security-critical code paths rather than relocated/renamed files:

  • src-tauri/src/transport/web/auth.rs — bootstrap/session/proxy auth, rate limiting
  • src-tauri/src/transport/web/server.rs — HTTP server, CSRF/origin/host gates, asset serving, static SPA fallback
  • src-tauri/src/transport/web/rpc.rs — authenticated RPC dispatch, authorization, deadlines, error responses
  • src-tauri/src/transport/web/events.rs — session-scoped WebSocket events, replay/history
  • src-tauri/src/transport/web/contract.rs, mod.rs, static_assets.rs — context
  • src-tauri/src/application/file_transfers.rs, database_transfers.rs — transfer-token model (token binding, path traversal, single-use consumption verified sound)

Verified-safe areas (no comment): bootstrap token single-use + 60 s TTL + 244-bit entropy; cookie flags (HttpOnly/SameSite=Strict/Secure for remote); CSRF Origin + header gating; transfer-token path traversal protection (UUIDv4 + safe_file_name) and atomic single-use consumption; cross-session cancellation scoping; --allow-high-risk gating of AuthorizationLevel; AI approval ownership scoping at the application layer. A dump-path identifier-quoting concern was found to pre-exist in dump_commands.rs (verbatim relocation), so it was not flagged.

Fix these issues in Kilo Cloud


Reviewed by glm-5.2 · Input: 75.8K · Output: 21.2K · Cached: 1.5M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant