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

Url encoded emails not filtered #2

Closed
jonian opened this issue Dec 10, 2018 · 7 comments
Closed

Url encoded emails not filtered #2

jonian opened this issue Dec 10, 2018 · 7 comments

Comments

@jonian
Copy link
Contributor

jonian commented Dec 10, 2018

Hi @ankane, url encoded emails are no being filtered. Example:

email%40example.com

I you want I can make a PR and change the regex:

# Current regex
EMAIL_REGEX = /\b[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\b/i

# Regex with url encoded emails support
EMAIL_REGEX = /\b[\w+\-.]+(@|%40)[a-z\d\-]+(\.[a-z\d\-]+)*\.[a-z]+\b/i
@ankane
Copy link
Owner

ankane commented Dec 10, 2018

Hey @jonian, I could see it possibly making sense to add this. What's the situation where you're seeing it?

@jonian
Copy link
Contributor Author

jonian commented Dec 11, 2018

Thank you for the quick response. I am seeing this when using typhoeus.

Log from the app that sends the request:

ETHON: performed EASY effective_url=http://localhost:5000/api/users/find?email=example%40test.com response_code=404 return_code=ok total_time=0.353005

Log form the app that receives the request:

Started GET "/api/users/find?email=example%40test.com" for ::1 at 2018-12-11 11:41:44 +0200

@ankane
Copy link
Owner

ankane commented Dec 11, 2018

Cool, seems like enough of a reason to add it. Feel free to make a PR.

@ankane
Copy link
Owner

ankane commented Dec 11, 2018

Added a section to the bottom of the readme with instructions on how to get set up.

@ankane
Copy link
Owner

ankane commented Dec 11, 2018

Fixed by #3

@ankane ankane closed this as completed Dec 11, 2018
@jonian
Copy link
Contributor Author

jonian commented Dec 11, 2018

Adding more info that I forgot to mention in previous comments.

This should be used in addition to config.filtered_parameters, not as a replacement.

Adding :email to config.filtered_parameters works with the app that receives the request but not the app that sends the request.

That is an issue with typhoeus/ethon#153.

@ankane
Copy link
Owner

ankane commented Dec 11, 2018

Yeah, Logstop is there to catch you when you forget to add it to filtered_parameters.

Re Ethon: I don't think it has any concept of Rails since it's a Ruby library, so I wouldn't expect it to filter. Not sure if it has its own way to filter sensitive data, besides turning off logging.

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