Add startup checks that catch weak or leaked security settings
メンテナーはふだん 1 日以内に返信
@varun-pahuja がすでに取り組んでいます。
2026年10月20日 から。
評価
この issue はまだ評価されていません。
説明
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.
- 主要言語
- TypeScript
- スター
- 13
- フォーク
- 7
- 平均マージ
- 3時間 41分
- マージ済み PR(30日)
- 155
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codercops/chatcops のほかの issue
-
Document the pre-chat form対応中かも @masyarakatai が 5 日前に担当しました。 オープンdocumentation good first issue hacktoberfest widget
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
codercops/chatcops#70 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
-
docs: update the providers page for openai-compatible, registerProvider and provider imports対応中かも @prakashNalla が今日担当しました。 オープンdocumentation good first issue hacktoberfest website
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
codercops/chatcops#291 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
docs: add a protocol reference page for custom clients対応中かも @kachamsiddarth が今日担当しました。 オープンdocumentation good first issue hacktoberfest website
codercops/chatcops#286 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Create @chatcops/store-cloudflare (D1, KV and a Durable Object counter)対応中かも @bhushan4work が今日担当しました。 オープンenhancement hacktoberfest help wanted server
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
codercops/chatcops#249 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Create @chatcops/store-sqlite, a store for single-server setups対応中かも @srikar-naidu が今日担当しました。 オープンenhancement hacktoberfest help wanted server
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
codercops/chatcops#247 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
codercops/chatcops の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 72/100
zts212653/clowder-ai#1678 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
Progressive-Victory/the-website#680 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100