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

search sanitization seems weird #40

Open
haarg opened this issue Dec 5, 2017 · 3 comments
Open

search sanitization seems weird #40

haarg opened this issue Dec 5, 2017 · 3 comments

Comments

@haarg
Copy link
Member

haarg commented Dec 5, 2017

The search sanitization seems a bit strange to me. Why is ' being escaped? Why is \n being removed? And filtering unexpected characters to . rather than rejecting the search seems odd. The list of allowed characters is also missing +.

@atoomic
Copy link
Member

atoomic commented Dec 5, 2017

the main reason of this whitelist was a quick & dirty protection for system calls
I'm open to better ideas, adding + seems sane

The replacement by '.' allow you to view some results close to your original search, rather than no result at all. Maybe this should be mentioned somewhere in the result when doing so

This clearly need/can be improved

@haarg
Copy link
Member Author

haarg commented Dec 5, 2017

The arguments end up being passed using the list form of exec. There shouldn't be any need for sanitization, unless you want to restrict what regexes can be used.

@atoomic
Copy link
Member

atoomic commented Dec 5, 2017

If that's the case then I agree all these restrictions are more painful than useful, would need to check how&where the string is used.

The patch should be pretty straightforward to disable these restrictions.

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