Password Policy Validation Error: Unclosed Character ClassIssue When users attempt to set passwords or authenticate, the system returns validation errors with the message: "PasswordPolicyEvaluator: Error while validating the password. Error message: Unclosed character class near index 42" This error blocks password policy validation and prevents normal authentication workflows. In some cases, customers may interpret the repeated error logs as a potential security issue. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All Cause The password policy's "Included special characters" field contains a custom regex pattern with an improperly escaped backslash. The pattern includes: !@#$%^&*()<>?/;:{[}]+=-_\ The issue manifests in the regex as: ((.*?[!@#$%\^&*\(\)<>?/;:{\[}\]+=\-_\]).*?) The trailing backslash in the character class creates an unclosed escape sequence, causing the regex engine to fail validation. This typically occurs after recent password policy customizations or updates. Resolution Two approaches are available: Disable the custom password policy (temporary): Navigate to the password policy record and disable it. Use the out-of-the-box (OOB) ServiceNow password policy for testing to confirm this resolves the validation errors.Fix the regex pattern (permanent): Edit the password policy's "Included special characters" field and correct the regex escaping. Ensure the backslash at the end of the character class is properly escaped. Common fixes include removing the trailing backslash or properly escaping it as \\ if the backslash character is intentional. After making changes, test password policy validation against a user record to ensure the error no longer occurs.