[GH-ISSUE #5423] shared/management/http/util/util.go:116: got unhandled error code, error: failed to create user in embedded IdP: failed to create user in embedded IdP: failed to hash password: bcrypt: password length exceeds 72 bytes #11383

Open
opened 2026-08-05 01:29:31 -04:00 by saavagebueno · 1 comment
Owner

Originally created by @HeavyTobi on GitHub (Feb 23, 2026).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/5423

Describe the problem

During initial setup (likely also during local user creation) when using password managers which create passwords larger than 72 bytes the UI only shows "An error occurred" without description. However the logs make clear that this is only an unhandled error which should be easy to fix and display in the UI:

Log: netbird-server (redacted stuff) shared/management/http/util/util.go:116: got unhandled error code, error: failed to create user in embedded IdP: failed to create user in embedded IdP: failed to hash password: bcrypt: password length exceeds 72 bytes

To Reproduce

Steps to reproduce the behavior:

  1. Go to initial setup / user creation process
  2. create a user with password longer than 72 bytes, e.g. by using a password manager
  3. try to save
  4. Find "an error occurred" message below form and above mentioned error log for netbird-server

Expected behavior

Error message clearly stating "Passwords can not exceed 72 chars"

Are you using NetBird Cloud?

Self-Hosted, new installer script

NetBird version

0.65.3

Is any other VPN software installed?

server side issue, no other VPN

Debug output

To help us resolve the problem, please attach the following anonymized status output

netbird status -dA

Create and upload a debug bundle, and share the returned file key:

netbird debug for 1m -AS -U

Uploaded files are automatically deleted after 30 days.

Alternatively, create the file only and attach it here manually:

netbird debug for 1m -AS

--> not applicable as server side issue (error code 500)

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Have you tried these troubleshooting steps?

  • Reviewed client troubleshooting (if applicable)
  • Checked for newer NetBird versions
  • Searched for similar issues on GitHub (including closed ones)
  • Restarted the NetBird client
  • Disabled other VPN software
  • Checked firewall settings
Originally created by @HeavyTobi on GitHub (Feb 23, 2026). Original GitHub issue: https://github.com/netbirdio/netbird/issues/5423 **Describe the problem** During initial setup (likely also during local user creation) when using password managers which create passwords larger than 72 bytes the UI only shows "An error occurred" without description. However the logs make clear that this is only an unhandled error which should be easy to fix and display in the UI: Log: netbird-server (redacted stuff) shared/management/http/util/util.go:116: got unhandled error code, error: failed to create user in embedded IdP: failed to create user in embedded IdP: failed to hash password: bcrypt: password length exceeds 72 bytes **To Reproduce** Steps to reproduce the behavior: 1. Go to initial setup / user creation process 2. create a user with password longer than 72 bytes, e.g. by using a password manager 3. try to save 4. Find "an error occurred" message below form and above mentioned error log for netbird-server **Expected behavior** Error message clearly stating "Passwords can not exceed 72 chars" **Are you using NetBird Cloud?** Self-Hosted, new installer script **NetBird version** 0.65.3 **Is any other VPN software installed?** server side issue, no other VPN **Debug output** To help us resolve the problem, please attach the following anonymized status output netbird status -dA Create and upload a debug bundle, and share the returned file key: netbird debug for 1m -AS -U *Uploaded files are automatically deleted after 30 days.* Alternatively, create the file only and attach it here manually: netbird debug for 1m -AS --> not applicable as server side issue (error code 500) **Screenshots** If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. **Have you tried these troubleshooting steps?** - [ ] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [ ] Checked for newer NetBird versions - [ ] Searched for similar issues on GitHub (including closed ones) - [ ] Restarted the NetBird client - [ ] Disabled other VPN software - [ ] Checked firewall settings
saavagebueno added the triage-needed label 2026-08-05 01:29:31 -04:00
Author
Owner

@Optic00 commented on GitHub (Aug 4, 2026):

Rechecked this on current main (bc7a15a). The original setup path now rejects inputs over 72 bytes in validateSetupInfo, so that part appears fixed.

I reproduced the same late failure in two related paths:

  • Invite acceptance: a 73-byte password satisfying the current ValidatePassword checks passes that validation, then the real embedded Dex returns the bcrypt over-72-byte error. The error is untyped, so the HTTP layer returns a generic 500.
  • The embedded-IdP admin password command: the same input passes ValidatePassword and fails while hashing.

The bcrypt boundary is measured in bytes, not characters. For example, 38 Unicode code points can occupy 73 UTF-8 bytes.

Would you prefer expanding #5423 to cover a shared 72-byte validation, or should this go through a separate discussion and validated issue? I have local reproductions but no published patch.

<!-- gh-comment-id:5175109543 --> @Optic00 commented on GitHub (Aug 4, 2026): Rechecked this on current `main` (`bc7a15a`). The original setup path now rejects inputs over 72 bytes in [`validateSetupInfo`](https://github.com/netbirdio/netbird/blob/bc7a15ab71d9e9ed944fa3ec17952e77a696595d/management/server/instance/manager.go#L264-L283), so that part appears fixed. I reproduced the same late failure in two related paths: - Invite acceptance: a 73-byte password satisfying the current [`ValidatePassword`](https://github.com/netbirdio/netbird/blob/bc7a15ab71d9e9ed944fa3ec17952e77a696595d/management/server/user.go#L1861-L1898) checks passes that validation, then the real embedded Dex returns the bcrypt over-72-byte error. The error is untyped, so the [HTTP layer](https://github.com/netbirdio/netbird/blob/bc7a15ab71d9e9ed944fa3ec17952e77a696595d/shared/management/http/util/util.go#L82-L119) returns a generic 500. - The [embedded-IdP admin password command](https://github.com/netbirdio/netbird/blob/bc7a15ab71d9e9ed944fa3ec17952e77a696595d/management/cmd/admin/admin.go#L264-L286): the same input passes `ValidatePassword` and fails while hashing. The bcrypt boundary is measured in bytes, not characters. For example, 38 Unicode code points can occupy 73 UTF-8 bytes. Would you prefer expanding #5423 to cover a shared 72-byte validation, or should this go through a separate discussion and validated issue? I have local reproductions but no published patch.
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#11383