Skip to content

Security fixes and hardening sync (part 2) - #5842

Merged
chitalian merged 1 commit into
mainfrom
sync-security-fixes-2026-10-part2
Oct 19, 2026
Merged

chitalian merged 1 commit into
mainfrom
sync-security-fixes-2026-10-part2

Conversation

@chitalian

Copy link
Copy Markdown
Contributor

Second batch of security fixes and hardening for self-hosted Helicone, following #5841. One commit on top of main.

What's in it

  • Worker key pinning: stored (vault) provider keys only reach their provider's first-party https origin, or the Azure endpoint saved with the key. Target URL overrides, fallbacks and custom gateways are refused for stored keys. Proxy keys are rejected on the AI Gateway.
  • Worker caches and headers: auth and key caches last at most 5 minutes (were 12 hours), with negative caching. Outbound headers come from an allowlist, Helicone keys are never forwarded to providers, provider fetches don't follow redirects, and secrets are redacted from logged URLs. Google AI Studio keys use the x-goog-api-key header.
  • Filters: unknown filter tables, columns and operators are rejected before SQL is built, and the org scope is always ANDed separately from the user's filter.
  • Web API routes and Slack: provider keys are masked, key routes check same-origin requests, Slack OAuth uses a signed single-use state and Slack request signatures are verified. Unused chat proxy, global metrics and billing routes are removed, /api/stats is admin-only, and anti-framing headers are set.
  • Billing, webhooks, integrations: changes require an org owner or admin. Webhook and integration destinations are checked against internal addresses (SSRF guard) and redirects are not followed. Integration credentials are masked.
  • Prompts, evaluators, datasets: scoped to the caller's org. LLM-as-a-judge uses an allowlisted model set; evaluator test endpoints are rate limited per org.
  • Authorization: bound to the authenticated org and the verified credential type. Member, API key and org-level writes require a signed-in owner or admin; API keys can no longer act as the user who created them.
  • Python evaluators turned off: the CodeSandbox sandbox pool and the @codesandbox/sdk dependency are removed. Python evaluators can no longer be created, edited or tested (POST /v1/evaluator/python/test returns 410), online evals skip existing python evaluators, and the web UI no longer offers them. Existing rows stay in the database and can still be deleted.
  • Auth cache key versioning: Jawn's auth and org cache keys include a version, and cached auth entries are only trusted when they carry a verified credential type. Tasks running different code versions during a deploy never reuse each other's entries; anything else falls back to full verification.
  • Decrypted view guard: new migration 20261019170000_guard_decrypted_views.sql adds an event trigger that re-revokes anon/authenticated access whenever pgsodium regenerates a public.decrypted_* view, and stops granting anon access to new tables, sequences and functions in public by default.
  • MinIO images: minio/minio and minio/mc are no longer on Docker Hub, so docker/docker-compose.yml and minio_hcone.py use pinned pgsty/minio and pgsty/mc builds (same binaries, paths, env vars and ports).
  • CI: Jawn deploy workflow task definition revisions updated.

Behaviour changes for self-hosters

  • Set HELICONE_MANUAL_ACCESS_KEY on Jawn to the worker's value. /v1/log/request and /v1/public/security now reject all callers when it is unset.
  • API-key callers can no longer manage provider keys, members or API keys.
  • Requests that send a stored key to a non-first-party host return 403; proxy keys on the AI Gateway return 401.
  • Invalid filters now return an error instead of being ignored.
  • better-auth password sign-in requires a verified email.
  • Worker cache key prefixes changed, so caches start cold after deploy.
  • Apply the new Supabase migration (supabase/migrations/20261019170000_guard_decrypted_views.sql). Anything new that anon needs in public must now be granted explicitly.
  • Python evaluators stop running; switch them to LLM-as-a-judge or remove them. CSB_API_KEY is no longer used.
  • Jawn auth caches start cold after deploy (new key prefix).
  • Local MinIO now pulls pgsty/minio and pgsty/mc.

Tests: new unit tests for each area, including python evaluator shutdown and auth cache versioning. Jawn, worker, web and bifrost typecheck clean (tsc --noEmit); packages Jest suite passes (645 tests).

If you run Helicone yourself, update to this version, apply the new migration, revoke anon/authenticated access to any decrypted_* views, and rotate stored provider keys.

🤖 Generated with Claude Code

Second batch of security fixes and hardening for self-hosted Helicone.

- Worker: decrypted vault keys are only sent to first-party provider
  origins; auth and key caches use short TTLs and negative caching;
  Helicone and provider secrets are stripped from outbound headers and
  redacted from logs.
- Filters: unknown filter keys and operators are rejected, and the
  organization scope predicate cannot be escaped by a user-supplied filter.
- Web: API routes require a session and same-origin requests, Slack OAuth
  uses signed state and verifies Slack request signatures, provider and
  proxy key endpoints mask secrets and are scoped to the caller's org.
  Unused chat proxy, global metrics and billing routes are removed.
  better-auth now requires email verification, and the app sends
  anti-framing and nosniff headers.
- Jawn billing, webhooks and integrations: changes require an org owner
  or admin; webhook and integration destinations are checked against
  private, loopback and metadata addresses (SSRF guard) and redirects are
  not followed.
- Prompts, evaluators and datasets are scoped to the caller's org;
  LLM-as-a-judge calls are rate limited per org with an allowlisted
  model set.
- Authorization is bound to the authenticated org and the verified
  credential type. Member, API key and org-level writes require a JWT
  owner or admin; API keys can no longer act as their creator; proxy keys
  are rejected on Jawn routes other than the worker log fallback.
  /v1/log/request and /v1/public/security fail closed when
  HELICONE_MANUAL_ACCESS_KEY is unset.
- Python evaluators are turned off and the CodeSandbox sandbox pool and
  SDK dependency are removed. Existing python evaluators are skipped by
  online evals and cannot be created or edited; the web UI no longer
  offers them.
- Jawn auth cache keys are versioned, and cached entries are only trusted
  when they carry a verified credential type, so tasks on different code
  versions never reuse each other's entries during a deploy.
- New migration adds an event trigger that keeps public.decrypted_* views
  closed to anon/authenticated and stops granting anon access to new
  objects in public by default.
- docker-compose and minio_hcone.py use pinned pgsty/minio and pgsty/mc
  images, since minio/minio and minio/mc are no longer on Docker Hub.
- Jawn deploy workflow task definition revisions updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cursor

cursor Bot commented Oct 19, 2026

Copy link
Copy Markdown

Bugbot is paused — your team has an unpaid invoice

Bugbot is paused because your team has an unpaid invoice.

Pay it from the billing page in the Cursor dashboard and Bugbot resumes automatically.

(requestId: 49121266-0c4e-48bf-8293-134f47a93217)

@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
helicone Ready Ready Preview Oct 19, 2026 5:42pm UTC
helicone-bifrost Error Error Oct 19, 2026 5:42pm UTC
helicone-eu Ready Ready Preview Oct 19, 2026 5:42pm UTC

Request Review

@greptile-apps greptile-apps Bot left a comment

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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@supabase

supabase Bot commented Oct 19, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project lmahfbbnchpworytrrqk because there are no changes detected in .supabase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@supabase

supabase Bot commented Oct 19, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project bolqqmqbrciybnypvklh because there are no changes detected in supbase/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@claude

claude Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

This branch had an error being deployed

1 failed and 2 active deployments
Preview – helicone — 64116762 Deployed Oct 19, 2026 by vercel[bot]
Preview – helicone-eu — 64116762 Deployed Oct 19, 2026 by vercel[bot]
Preview – helicone-bifrost — 64116762 Deployed Oct 19, 2026 by vercel[bot]
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