Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Kratos cookie secret length requirement unclear

Đang mở
#2,333 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

@unatasha8 đang làm issue này rồi.

Từ ngày 20/11/2025.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
161
Fork
1.9k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ory/docs

Tất cả issue của ory/docs

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.