Skip to content

Conversation

@joshuaalley25
Copy link
Contributor

@joshuaalley25 joshuaalley25 commented Dec 29, 2025

🎫 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 PivCacConfiguration and AuthAppConfiguration are 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 :name with device information:

@name = @platform_authenticator ? @device_name : params[:name]

@joshuaalley25 joshuaalley25 requested a review from a team December 29, 2025 22:58
Copy link
Contributor

@vrajmohan vrajmohan left a 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:

  1. 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.
  2. The ticket https://cm-jira.usa.gov/browse/LG-16274 and this PR both enforce 64 at the model level.
  3. The ticket https://cm-jira.usa.gov/browse/LG-17072 requires 20 and the PR #12763 uses 255.

Copy link
Contributor

@vrajmohan vrajmohan left a 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.

@joshuaalley25 joshuaalley25 merged commit edb1ddc into main Jan 8, 2026
1 check passed
@joshuaalley25 joshuaalley25 deleted the jralley/LG-17274-limit-mfa-field-lengths branch January 8, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants