Creating a user with a password that has some non-alphanumeric characters causes an error

I have a tool that syncs users and groups from an LDAP backend into Gitlab by making use of the Gitlab API.

Part of the process of creating a new user in Gitlab involves determining a (reasonably) random password to assign this user. Even though the user will never use it, because they authenticate with LDAP, the Gitlab API has a bug where a user cannot be created without a password. (This still exists on Gitlab 12.)

A consumer of my tool has reported that the Gitlab API sometimes fails to accept passwords that contain certain non-alphanumeric characters, though I'm not sure which character(s) cause this. (I've asked.)

The current character pool I'm using is:

0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`¬!$%^&*()-_=+,<.>;:'@#~[]{}?

All of which are present in the ASCII character set, so there shouldn't be any encoding issue. The same person has said that by removing all of the non-alphanumeric characters from the character pool there is no issue, but obviously that results in weaker passwords being generated.

I guess my question is which of the characters in that set should not be used in passwords, and why not. The password string becomes hashed anyway, so any printable character should be acceptable.

Edited Jun 27, 2019 by Adam Reece
Assignee Loading
Time tracking Loading