Skip to content
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

Don't allow quoted-string email format. #378

Closed
colinmollenhour opened this issue Nov 16, 2017 · 2 comments
Closed

Don't allow quoted-string email format. #378

colinmollenhour opened this issue Nov 16, 2017 · 2 comments

Comments

@colinmollenhour
Copy link
Member

I'm all for full RFC compliance and support, but in this case I think it is worth deviating from. The Zend_Validate_EmailAddress supports quoted-string style email addresses which I have never seen anyone use for legitimate purposes. Already this quoted-string format is not allowed by frontend validation so legitimate users can't use it anyway. The only use it has is to try to inject scripts into people's databases/pages and for this reason I think it should be dis-allowed.

Specifically, this block here could be disabled/removed: https://github.com/OpenMage/magento-lts/blob/1.9.3.x/lib/Zend/Validate/EmailAddress.php#L426

@sreichel
Copy link
Contributor

Already this quoted-string format is not allowed by frontend validation so legitimate users can't use it anyway.

This one?

# js\prototype\validation.js
return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)

+1 to remove.

colinmollenhour added a commit to colinmollenhour/magento-lts that referenced this issue Jan 17, 2018
@colinmollenhour
Copy link
Member Author

Created PR #432

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

No branches or pull requests

2 participants