Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Kratos cookie secret length requirement unclear

オープン
#2,333 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

@unatasha8 がすでに取り組んでいます。

2025年11月20日 から。

評価

この issue はまだ評価されていません。

説明

bug
Preflight checklist
Ory Network Project

No response

Describe the bug

From the docs:

  1. Secrets must be 32-character-long strings
  2. These secrets must have high entropy (>= 256 bit)

So let's play the password game!
Assuming 1 character = 1 byte, this suggest yaml-escaping 32 raw bytes. More than 256 bit entropy would be impossible, unless unicode characters are allowed, but I've never seen emojiis in (cookie) secrets.

To make it more sane, I'd expect kratos to hash the passed value before usage, regardless of the length of the value to extract full entropy, and exactly that seems to be done: https://github.com/ory/kratos/blob/50f1b8f0df8636cea94d1100c1dc68dd8f6bdfc5/driver/registry_default.go#L530-L534

IMHO, the documentation should be updated to remove the secret length requirement.

Reproducing the bug

Open https://www.ory.com/docs/kratos/guides/select-cipher-algorithm#xchacha20-poly1305 and https://www.ory.com/docs/kratos/guides/secret-key-rotation and follow the guide rigorously.

Relevant log output
The bug is in the documentation.
Relevant configuration
The bug is in the documentation.
Version

The bug is in the documentation.

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

主要言語
TypeScript
スター
161
フォーク
1.9k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ory/docs のほかの issue

ory/docs の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。