-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: Relax validation rules for descriptions to allow non-ASCII character input #6905
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
base: next
Are you sure you want to change the base?
feat: Relax validation rules for descriptions to allow non-ASCII character input #6905
Conversation
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughSummary by CodeRabbitRelease Notes
WalkthroughThe DESCRIPTION_PATTERN regex was refactored from an allowlist approach (accepting only specific characters) to a blocklist approach (rejecting only control characters and dangerous symbols). This enables non-ASCII character support while maintaining security restrictions. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes I'll be back... to praise this change. 🤖 Look, this is a solid move—swapping from an overly restrictive allowlist to a smart blocklist. Non-ASCII characters (Japanese, emoji tacos 🌮, you name it) can now flow through without getting terminated. The new pattern says "block the dangerous stuff" instead of "allow only what we think is safe," which is way smarter when you're dealing with self-hosted systems where actual humans from around the world need to write descriptions in their native languages. Plus, it's deployed to actual servers running on metal, not some ephemeral serverless function that disappears after 15 minutes like my enthusiasm for cloud providers' marketing decks. Good work keeping the dangerous characters out—control characters and injection vectors like Just wish the validation framework could handle gluten-free descriptions too. ✨ Pre-merge checks and finishing touches✅ Passed checks (4 passed)
[pre_merge_check_pass] The PR description follows the required template structure with both the Changes section and Issues section completed. The Changes section succinctly describes the regex modification, and the Issues section properly links to #6904. Additionally, the author provides a thorough explanation of the security rationale and character exclusions considered, demonstrating thoughtfulness. While there's a minor typo ("Descritpion"), the overall description is complete and informative, allowing reviewers to understand both what changed and why. | ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Changes
Issues
Descritpion
I compared the original regular expression with common prohibited input characters and thought it would be sufficient to mainly reject the following items:
0x00-0x1F
: Control characters<
,>
: HTML tags, XSS$
: Command injection;
: SQL injection\
: Escape sequencesTherefore, in this PR, we consider characters other than those listed above to be safe.
If there are any mistakes in the list above, please do leave a comment.