Skip to content

A dashboard password longer than 72 bytes passes validation and then fails at hashing with a misleading message #4487

Backlog

Description

@pithead-developer

What's the problem

parse_and_validate_config (lib/pithead/28-parse-and-validate-config.sh) accepts a dashboard.auth.password of 8 to 128 characters. The password is then hashed with caddy hash-password in the pinned Caddy image (caddy_hash_password_b64 in lib/pithead/35-caddyfile-and-auth-helpers.sh). That command refuses any input longer than 72 bytes: bcrypt: password length exceeds 72 bytes.

So a password of 73 to 128 ASCII characters, or of 37 or more two-byte letters, passes validation and then stops apply with "Could not hash dashboard.auth.password (is Docker running and the Caddy image pulled? Run './pithead setup' first)."

docs/configuration.md says any 8–128-character string works.

What it impacts

An operator who picks a long passphrase. apply stops, and the message points at Docker and the image, not at the length of the password.

How I found it

While reviewing the fix for #4453. The pinned Caddy image was run with no network:

  • 72 ASCII characters: hashed.
  • 73 ASCII characters, 37 × ä (74 bytes) and 65 × ä (130 bytes): exit 1 with bcrypt: password length exceeds 72 bytes.

Unknown: whether any install holds a longer password whose hash an older Caddy made without this error. The validator keeps the stored hash while the password is unchanged (prev_fp and prev_hash), so such an install works until the password changes.

How important is it

Low to medium. It fails closed and a shorter password works, but the message misleads and the documented limit is wrong.

Acceptance criteria

  • Validation refuses a new password longer than 72 bytes with a message that names the limit, before hashing is tried. A test covers 73 ASCII characters and 37 two-byte characters.
  • An install whose password is unchanged and already has a stored hash is not refused after an upgrade.
  • docs/configuration.md and the error text state the real limit.

Possible solutions

  • Smallest: a byte-length check next to the existing length check, applied only when the password differs from the stored fingerprint.
  • Alternative: keep the rule and map the hashing failure to a clear message.
  • Touches the same lines as the fix for Dashboard password validation depends on the shell locale #4453, so it should land after that.

Activity

  1. added this to the v2.0.5 milestone on Nov 24, 2026
  2. added
    bug
    setup
    P2-correctness
    blocked
    on Nov 24, 2026
  3. pithead-developer commented on Nov 24, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4453

    The fix for #4453 (#4484) changes the same validation lines. This one should start after that merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-correctnessblockedbugsetup

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions