Description
The Date of Birth claim (http://wso2.org/claims/dob) is validated only against a format pattern, ^\d{4}-\d{2}-\d{2}$. That constrains the shape of the value, not its meaning, so two classes of invalid value are accepted and persisted:
- Future dates —
2030-01-01 matches the pattern.
- Dates that do not exist —
2025-02-30 and 2025-02-29 also match the pattern.
The value is stored on every write path that reaches the user store: self-registration (both the classic page and the dynamic registration flow), the Console user create and edit forms, and the SCIM2 user endpoints. My Account's profile page already rejected future dates in the browser, so the same claim was enforced inconsistently depending on which UI the value came through, and a value blocked in one place could be stored from another.
Steps to Reproduce
-
Create a user through SCIM2 with a future date of birth:
POST /scim2/Users
{
"schemas": ["urn:ietf:params:scim:schemas:core:2.0:User"],
"userName": "DEFAULT/dobtest@example.com",
"password": "<password>",
"emails": [{ "primary": true, "value": "dobtest@example.com" }],
"urn:scim:wso2:schema": { "dateOfBirth": "2030-01-01" }
}
Expected: rejected with HTTP 400. Actual: HTTP 201, and a GET on the created user returns dateOfBirth: 2030-01-01.
-
Repeat with "dateOfBirth": "2025-02-30", a date that does not exist. Same result.
-
Register through the self-registration page and enter a future date of birth. The value is accepted and stored.
-
Open the same user's profile in My Account. The future date is rejected there, so the value cannot be re-saved even though it was stored.
Please select the area issue is related to
Authentication & Registration
Version
7.4.0-SNAPSHOT (master)
Environment Details (with versions)
Reproducible on any deployment; not specific to a database or user store. Note that server-side claim validation runs only when UserClaimUpdate.EnableUserClaimInputRegexValidation is enabled, which is the shipped default.
Description
The Date of Birth claim (
http://wso2.org/claims/dob) is validated only against a format pattern,^\d{4}-\d{2}-\d{2}$. That constrains the shape of the value, not its meaning, so two classes of invalid value are accepted and persisted:2030-01-01matches the pattern.2025-02-30and2025-02-29also match the pattern.The value is stored on every write path that reaches the user store: self-registration (both the classic page and the dynamic registration flow), the Console user create and edit forms, and the SCIM2 user endpoints. My Account's profile page already rejected future dates in the browser, so the same claim was enforced inconsistently depending on which UI the value came through, and a value blocked in one place could be stored from another.
Steps to Reproduce
Create a user through SCIM2 with a future date of birth:
Expected: rejected with HTTP 400. Actual: HTTP 201, and a
GETon the created user returnsdateOfBirth: 2030-01-01.Repeat with
"dateOfBirth": "2025-02-30", a date that does not exist. Same result.Register through the self-registration page and enter a future date of birth. The value is accepted and stored.
Open the same user's profile in My Account. The future date is rejected there, so the value cannot be re-saved even though it was stored.
Please select the area issue is related to
Authentication & Registration
Version
7.4.0-SNAPSHOT (master)
Environment Details (with versions)
Reproducible on any deployment; not specific to a database or user store. Note that server-side claim validation runs only when
UserClaimUpdate.EnableUserClaimInputRegexValidationis enabled, which is the shipped default.