Add startup checks that catch weak or leaked security settings
I maintainer di solito rispondono entro 1 giorno
@varun-pahuja ci sta già lavorando.
Dal 20/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
The next release adds security settings to the server: a list of allowed origins and secrets for signing session tokens. The easy mistakes there are silent, like a 10 character secret, a secret that's also in a NEXT_PUBLIC_ variable (so it ships to every browser), or an allowed origin typed as acme.com with no https://. This issue adds one function that finds those mistakes, in a new file, so the server can print them at startup later.
What to do
Create packages/server/src/security/startup-checks.ts:
export interface SecuritySettings {
allowedOrigins?: string[];
sessionSecrets?: string[];
}
export interface SecurityProblem {
level: 'error' | 'warning';
message: string;
}
export function checkSecuritySettings(
settings: SecuritySettings,
env?: Record<string, string | undefined>
): SecurityProblem[];
Report these:
- error: a session secret shorter than 32 bytes (count UTF-8 bytes, not characters)
- error: a session secret that's also the value of an env variable starting with
NEXT_PUBLIC_,VITE_,PUBLIC_,NUXT_PUBLIC_,EXPO_PUBLIC_orREACT_APP_. Name the variable in the message, but never put the secret itself in a message - warning: two session secrets that are the same
- error: an allowed origin that isn't
*and doesn't start withhttp://orhttps:// - error: an allowed origin with a path, query or trailing slash (
https://acme.com/), since browsers send the origin without one - warning:
http://origins other thanlocalhostor127.0.0.1 - warning:
*together with other entries (the others do nothing)
env defaults to globalThis.process?.env, so it also works where process doesn't exist (Workers).
Where to look
packages/server/src/handler.ts, line 16, for how the server words its startup warnings today
Acceptance criteria
- New
packages/server/src/security/startup-checks.tsandpackages/server/tests/security/startup-checks.test.ts - One test per rule, plus a clean config that returns
[] - A test proves the secret value is not in any message
- Not exported from
@chatcops/serveryet, and no changeset needed (pnpm changeset --empty) -
pnpm test:coverageandpnpm lintpass
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off dev, and open your PR against dev with Closes #<this issue number>. Setup notes (pnpm, build before test) are in CONTRIBUTING.md.
- Lingua principale
- TypeScript
- Stelle
- 13
- Fork
- 7
- Merge medio
- 3h 41m
- PR unite (30g)
- 155
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codercops/chatcops
-
Document the pre-chat formForse già presa @masyarakatai l’ha presa 5 giorni fa. Apertadocumentation good first issue hacktoberfest widget
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
codercops/chatcops#70 · 5 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
docs: update the providers page for openai-compatible, registerProvider and provider importsForse già presa @prakashNalla l’ha presa oggi. Apertadocumentation good first issue hacktoberfest website
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
codercops/chatcops#291 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
docs: add a protocol reference page for custom clientsForse già presa @kachamsiddarth l’ha presa oggi. Apertadocumentation good first issue hacktoberfest website
codercops/chatcops#286 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)Forse già presa @bhushan4work l’ha presa oggi. Apertaenhancement hacktoberfest help wanted server
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
codercops/chatcops#249 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Create @chatcops/store-sqlite, a store for single-server setupsForse già presa @srikar-naidu l’ha presa oggi. Apertaenhancement hacktoberfest help wanted server
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
codercops/chatcops#247 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di codercops/chatcops
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
zts212653/clowder-ai#1678 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
Progressive-Victory/the-website#680 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100