Repository navigation
fix: close the defects a sixth audit found - #7
Merged
Merged
Conversation
Security first. A request target in absolute form (`GET http://host/v1/...`)
was authenticated against a path that still carried its scheme and authority, so
no public-path rule matched and the gateway key was never checked: the request
reached the route unauthenticated and answered `404 endpoint_not_available`
where every origin-form request got a `401`. The path is now derived once, in
`src/http/request-path.js`, and every caller uses it.
Provider-reported model ids and names are now bounded at 200 characters, because
an upstream could otherwise store a string of any length in a column the public
model list reads back on every request.
Correctness. A stream ending on a lone `\r` had the appended `[DONE]` glued onto
its last event, which is a frame the client cannot parse. An exception during
post-attempt bookkeeping leaked the provider slot and the half-open probe. A full
queue could answer `502` because the refusal was overwritten by an earlier
attempt's error. A stalled CSV reader held the export open for hours. A provider
key stored before the process started was never masked in a later log line.
Settings read stored overrides without validating them, so a row written by an
older build could contradict the schema the dashboard renders.
Observability and the dashboard. `recordStreamFailure` charged every in-band
failure to the breaker, so one client sending oversized streaming prompts could
open a healthy provider's breaker; it now uses the same classification the
buffered path does. Non-counting outcomes no longer raise the provider's failure
statistics. Pending auth errors expire. The breaker reads the registry's
injectable clock. Out-of-schedule providers say "back at 14:00" instead of
"back at {at}", timestamps name their time zone, `RangeTabs` reports
`aria-pressed`, a `Field` describes its control to a screen reader, and the Keys
tab locks a revealed secret again after 30 seconds.
Hygiene. `UpstreamClient` releases an agent when a provider is removed or its
endpoint changes. `ModelRepository.create()` no longer erases the operator's
display name and notes on conflict. `keyPrefix()` stops publishing the tail that
`maskSecret()` refuses to print. Brand icons are read once and served with an
ETag. An unauthenticated `GET /v1/models/:id` no longer runs a model query per
request.
Features. `GET /metrics` serves a Prometheus document from the numbers the
Overview tab already reads: off unless `METRICS_ENABLED` is on, refusing a scrape
while `METRICS_TOKEN` is blank, and labelling a provider by id rather than by
name or endpoint. `node index.js --version` prints the version and exits.
`POST /api/providers/:id/probe` runs the health prober's single-provider probe on
demand. The dashboard gains vitest, so the copy table, the formatters and the
component kit's accessibility wiring are asserted without a browser.
Documentation caught up with the code: settings persistence is the SQLite table,
not `config.json`; the slow CI pass runs on one Node version; `src/http/` is in
the repository map; the configuration tables are checked against the schema, not
generated from it.
Refs: audit report of 2026-11-24
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.
Closes the six-audit defect list and adds the four proposals that came with it.
Security. An absolute-form request target (
GET http://host/v1/...) bypassed gateway key authentication: the path it was checked against still carried its scheme and authority, no public-path rule matched, and the request reached the route unauthenticated. Model ids and names reported by a provider are now bounded.Correctness.
[DONE]no longer glues onto a stream that ends on a lone\r; an exception in post-attempt bookkeeping no longer leaks the slot and the half-open probe; a full queue answers503 queue_fullrather than inheriting an earlier attempt's502; a stalled CSV reader is closed; a key stored before start-up is masked; stored settings overrides are validated.Features.
GET /metrics(Prometheus, off by default, token-gated),node index.js --version,POST /api/providers/:id/probe, and vitest over the dashboard.Verified locally:
pnpm run check,pnpm run typecheck,pnpm run test:web(17 tests),pnpm test(7 files), andSMOKE_SLOW=1 pnpm test:smoke.