-
Notifications
You must be signed in to change notification settings - Fork 620
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
replace readme string concat with json marshal #493
Conversation
Just took a look after being a long time user of oliver/elastic-go and noticed a quite jarring promotion of string concatenation in the example for indexing a document. I don't think a database driver should be promoting usage of string concatenation. Someone is going to copy this into production and end up with an injection vulnerability or request smuggling issue. https://github.com/elastic/go-elasticsearch#usage <img width="398" alt="image" src="https://user-images.githubusercontent.com/5204642/167987969-ff1abe07-9f3b-499c-8a6c-1561a41ff5cf.png">
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
💚 CLA has been signed |
signed the cla |
Thank you @epelc for pointing that out and for the fix! I'd also like to highlight for future reader that json marshaling is not sufficient and users should sanitize their data before ingestion. LGTM! |
@Anaethelion Thanks for the quick merge! Excited to see potential support for request/response structs. Looking to switch over from oliver's driver eventually. |
Co-authored-by: Ed Pelc <[email protected]>
Co-authored-by: Ed Pelc <[email protected]>
Just took a look after being a long time user of oliver/elastic-go and noticed a quite jarring promotion of string concatenation in the example for indexing a document.
I don't think a database driver should be promoting usage of string concatenation. Someone is going to copy this into production and end up with an injection vulnerability or request smuggling issue.
https://github.com/elastic/go-elasticsearch#usage