-
Notifications
You must be signed in to change notification settings - Fork 165
[LG-16274] Limit character length on user supplied names for auth_app_configuration, piv_cac_configuration, and webauthn_configuration #12760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
vrajmohan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that the tickets https://cm-jira.usa.gov/browse/LG-16274, https://cm-jira.usa.gov/browse/LG-17072 and the code are at odds with each other with respect to the enforced length:
- The UX enforces a length of 20 and, in https://cm-jira.usa.gov/browse/LG-16274?focusedId=2567979&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-2567979, I suggested keeping that length throughout.
- The ticket https://cm-jira.usa.gov/browse/LG-16274 and this PR both enforce 64 at the model level.
- The ticket https://cm-jira.usa.gov/browse/LG-17072 requires 20 and the PR #12763 uses 255.
vrajmohan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments are merely suggestive. The PR can be merged without addressing them.
🎫 Ticket
Link to the relevant ticket:
LG-16274
🛠 Summary of changes
We have noticed bad actors bypassing html limitations for user input into these text fields. This simply adds character limits to the models to stop junk data from making into tables. There will be follow-up migration PRs to clean the DB tables and truncate over-sized strings. The ticket calls for logging but I don't think it is necessary here.
Update:
Name columns for
PivCacConfigurationandAuthAppConfigurationare limited to 20 characters while WebAuthConfigurations is limited to 80 characters. WebAuthConfigurations' name columns can be overwritten by browser and device information if the user is creating a platform authenticator. After some research into the lengths of these entries 80 characters is a safe restriction.Line of code that overrides
:namewith device information:identity-idp/app/forms/webauthn_setup_form.rb
Line 92 in 700a2e1