Repository navigation
fix: backend sweep — reliability, security and hardening (#94-#127) - #128
Merged
Merged
Conversation
Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This was referenced Nov 22, 2026
Closed
Closed
Closed
Closed
[backend] Report endpoints load the entire findings table of BOTH scans into memory per request
#109
Closed
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second dogfood/bug-bash pass — this one on the backend. Fixes the filed issues #94–#127 that were real and fixable in-tree, with the genuinely architectural ones called out below.
Reliability
checkRooton a disconnected share could hang the workspace list for minutes; probes now run concurrently under a timeout and a timed-out root reportsprobe_timeout("Folder unreachable" in the UI) instead of being called "missing" or stalling the list. It also no longer disables the scan button — we don't know it's gone ([backend] Root health checks fail open: unreachable/missing roots reported "healthy" when probes time out #99)409carries the conflictingscan_id([backend] Scan start/delete/queue checks are racy — scan state read from DB then acted on without a lock #108, [backend] Scans() and ScansPage() load per-workspace history without a server-side cap — growth is unbounded #111)queued([backend] POST /workspaces/{id}/pentest/probe ignores the {id} — workspace-scoped route is a lie #118)IsReadychecks size + executable bit (half-written/quarantined binaries no longer "ready"); removal uses Windows-appropriate handling with real backoff ([backend] World-writable chmod storm + sleep-retry loop in tool uninstall (removePathRobust) #97, [code quality] time.Sleep polling loops as "synchronization" in self-update and tool removal #106, [backend] Tool "ready" check is just os.Stat — a half-extracted or corrupt install reports Ready #121)Security
%WINDIR%, user-profile root,.ssh/.aws/.gnupg/.config/AppData/etc/Program Filescan't be added as workspaces ([backend] Workspace root validation lets you register system/secrets directories #103, [code quality] Nits: security guard depends on env vars, per-call http.Client in sonarqube, Windows-only routes registered unconditionally #123).sha256.sigis fetched and verified before staging; no fallback to unsigned ([backend] Self-update accepts unsigned releases whenever no signing key is compiled in — silent downgrade path for self-built binaries #127)Update path
200 {unreachable:true}instead of 5xx console noise, prerelease-aware semver compare ([backend] Update check: ignores request context, and compareSemver treats prereleases as equal to releases #115, [code quality] Nits: security guard depends on env vars, per-call http.Client in sonarqube, Windows-only routes registered unconditionally #123)Repository layer
NewIDno longer needs crypto-randomness (uniqueness ≠ secrecy), unmarshal failures logged,RowsAffectedchecked, larger pool,staticHandlerno longer panics ([backend] Ignore db.RowsAffected errors; "deleted" isn't verified #101, [code quality] ~25 hand-rolled_ = tx.Rollback()sites in repository.go — boilerplate begging for a defer helper #104, [backend] gofmt violation in demo_seed.go — repo doesn't enforce formatting in CI #107, [backend] Single SQLite connection (SetMaxOpenConns(1)) serializes the whole API — one slow query blocks everything #112, [code quality] Small API inconsistencies: emit "scan.started" with state "queued"; sessionTicket skips the strict decode every other endpoint uses #116)Added
POST /api/v1/system/unseed-demo— bulk-removesdemo-ui-tagged workspaces so seeded corpus doesn't share the real DB or rot into "folder missing" rows ([backend] scanSelectColumns drags the full snapshot_json into every scan query — active-scan checks hydrate megabytes for a boolean #126)Deferred (architectural, commented on the issues)
Test plan
go build ./...cleango test -p 1 ./...green (incl. new/updated tests for notes validation, rate-limit routing, probe timeout, self-update signature path)vite buildclean;RootMissingBadgerenders "Folder unreachable" onprobe_timeoutTestDefaultJobsBoundsAnalyzerConcurrencyflake root-caused (5ms sleep too tight for this box; widened to 50ms)Generated with Devin