expand homoglyph protection to UserProfile.display_name and Collection.name #24091
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: mozilla/addons#15875
Description
Add homoglyph expansion to DeniedName checks used by Collection name, slug, and UserProfile display name. Needed some reworking of how matches to DeniedNames worked now we aren't doing a single check per field.
Context
Prior to the second commit, DeniedName.blocked executed a query each time it was called so it really (really) did not scale up to 65k iterations with homoglyphs. (A single test for
l * 16was taking 90s locally). The pythonx in ystring test is not as loose as the mysql query - the collation used specifically ignored accent characters and case - but my thinking was the homoglyph expansion would effectively do the same thing. (... not a completely proven hypothesis ...)Testing
lmore than 16 times.Collections:Edit; collection slugs have further restrictions on allowed characters)Checklist
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository.