Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Kratos cookie secret length requirement unclear

Abierto
#2,333 1 comentario 0 reacciones 1 asignado Ver en GitHub

@unatasha8 ya está trabajando en esto.

Desde el 20/11/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
161
Forks
1.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ory/docs

Todos los issues de ory/docs

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.