Add startup checks that catch weak or leaked security settings
Mantenedores costumam responder em até 1 dia
@varun-pahuja já está trabalhando nisso.
Desde 20/10/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 13
- Forks
- 7
- Merge médio
- 4h 11min
- PRs com merge (30d)
- 122
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de codercops/chatcops
-
enhancement hacktoberfest help wanted server
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Document the pre-chat formTalvez já em andamento @masyarakatai assumiu há 5 dias. Abertadocumentation good first issue hacktoberfest widget
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
codercops/chatcops#70 · 3 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
enhancement hacktoberfest help wanted server
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
Mantenedores costumam responder em até 1 dia
-
Create @chatcops/store-redis for Upstash and other Redis clientsTalvez já em andamento @bhushan4work assumiu há 1 dia. Abertaenhancement hacktoberfest help wanted server
codercops/chatcops#248 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Create @chatcops/store-sqlite, a store for single-server setupsTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaenhancement hacktoberfest help wanted server
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Mantenedores costumam responder em até 1 dia
Todas as issues de codercops/chatcops
Issues semelhantes
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
endora-commerce/endora-commerce#397 ·
Mantenedores costumam responder em até 1 dia
-
level/task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
wazuh/wazuh-dashboard-plugins#9472 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 63/100
Mantenedores costumam responder em até 1 dia
-
ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
xavxyz/bei-shan-lin-shui#57 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
opennextjs/opennextjs-cloudflare#1461 ·
Mantenedores costumam responder em até 1 dia