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

[EuiMarkdownEditor] href validation #4331

Closed
chandlerprall opened this issue Dec 2, 2020 · 1 comment · Fixed by #4362
Closed

[EuiMarkdownEditor] href validation #4331

chandlerprall opened this issue Dec 2, 2020 · 1 comment · Fixed by #4362

Comments

@chandlerprall
Copy link
Contributor

chandlerprall commented Dec 2, 2020

Currently, markdown links are unprocessed and are forwarded straight to EuiLink, which means non-URI protocols can be specified. To help users avoid unintended functionality, we should introduce a parser plugin to apply encodeURI to URLs. The plugin should be applied in a way to disallow consumers from removing it.

@jportner jportner changed the title [EuiMarkdownEditor] href security [EuiMarkdownEditor] href validation Dec 2, 2020
@chandlerprall
Copy link
Contributor Author

chandlerprall commented Dec 2, 2020

This ties in with #4195 where markdown links not starting with a protocol are assumed to be relative, but the errant result is obscured. Instead of encodeURI, let's check for http/https protocol or a leading / and unlink anything not matching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant