Whenever the following Regex is passed in for attribute validation , upon an erroneous string being passed, Identity crashes and we're sent to an error page:
Go to Oxtrust > attributes, and add the above regular expression to nickname field. Create a user and provide invalid value to nickname, and hit save.
oxtrust logs
2018-12-22 00:13:00,186 INFO [qtp985655350-17] [org.gluu.oxtrust.ldap.service.OrganizationService] (OrganizationService.java:233) - Starting App version 3.1.2.Final
2018-12-22 00:28:42,737 ERROR [qtp985655350-13] [org.gluu.oxtrust.exception.GlobalExceptionHandler] (GlobalExceptionHandler.java:54) - java.util.regex.PatternSyntaxException: Unclosed character class near index 252
(((?=.[a-z]+)(?=.[A-Z]+)(?=.[`~!@#$%^&()-+={}[\x22\x5D\x5F\|:;',.?/]+))|((?=.[0-9]+)(?=.[~!@#$%^&*()\-+={}[\x22\x5D\x5F\\|:;',.?/]+)(?=.*[a-zA-Z]+)|((?=.*[a-z]+)(?=.*[A-Z]+)(?=.*[0-9]+))))[~!@#$%^&*()-+={}[\x22\x5D\x5F\|:;',.?/a-zA-Z0-9]{8,}
^
javax.faces.FacesException: java.util.regex.PatternSyntaxException: Unclosed character class near index 252
(((?=.[a-z]+)(?=.[A-Z]+)(?=.[`~!@#$%^&()-+={}[\x22\x5D\x5F\|:;',.?/]+))|((?=.[0-9]+)(?=.[~!@#$%^&*()\-+={}[\x22\x5D\x5F\\|:;',.?/]+)(?=.*[a-zA-Z]+)|((?=.*[a-z]+)(?=.*[A-Z]+)(?=.*[0-9]+))))[~!@#$%^&*()-+={}[\x22\x5D\x5F\|:;',.?/a-zA-Z0-9]{8,}
^
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:84) ~[jsf-impl-2.2.14.jar:2.2.14]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.14.jar:2.2.14]
Based on this ticket,
Whenever the following Regex is passed in for attribute validation , upon an erroneous string being passed, Identity crashes and we're sent to an error page:
Steps to reproduce -
Go to Oxtrust > attributes, and add the above regular expression to nickname field. Create a user and provide invalid value to nickname, and hit save.
oxtrust logs 2018-12-22 00:13:00,186 INFO [qtp985655350-17] [org.gluu.oxtrust.ldap.service.OrganizationService] (OrganizationService.java:233) - Starting App version 3.1.2.Final 2018-12-22 00:28:42,737 ERROR [qtp985655350-13] [org.gluu.oxtrust.exception.GlobalExceptionHandler] (GlobalExceptionHandler.java:54) - java.util.regex.PatternSyntaxException: Unclosed character class near index 252 (((?=.[a-z]+)(?=.[A-Z]+)(?=.[`~!@#$%^&()-+={}[\x22\x5D\x5F\|:;',.?/]+))|((?=.[0-9]+)(?=.[
~!@#$%^&*()\-+={}[\x22\x5D\x5F\\|:;',.?/]+)(?=.*[a-zA-Z]+)|((?=.*[a-z]+)(?=.*[A-Z]+)(?=.*[0-9]+))))[
~!@#$%^&*()-+={}[\x22\x5D\x5F\|:;',.?/a-zA-Z0-9]{8,}javax.faces.FacesException: java.util.regex.PatternSyntaxException: Unclosed character class near index 252 (((?=.[a-z]+)(?=.[A-Z]+)(?=.[`~!@#$%^&()-+={}[\x22\x5D\x5F\|:;',.?/]+))|((?=.[0-9]+)(?=.[
~!@#$%^&*()\-+={}[\x22\x5D\x5F\\|:;',.?/]+)(?=.*[a-zA-Z]+)|((?=.*[a-z]+)(?=.*[A-Z]+)(?=.*[0-9]+))))[
~!@#$%^&*()-+={}[\x22\x5D\x5F\|:;',.?/a-zA-Z0-9]{8,}