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

Fix so that ALLOW_SCRIPTS applies to text widgets #2438

Closed
wants to merge 1 commit into from

Conversation

jwestbrook
Copy link

When the env setting REDASH_ALLOW_SCRIPTS_IN_USER_INPUT or ALLOW_SCRIPTS_IN_USER_INPUT is set to True the text widgets take escaped HTML and "trust" it versus "trusting" the original text value.

This negates the actual purpose of the env setting of allowing the user to put <script> tags or other valid html tags in the text block

…PTS_IN_USER_INPUT` is set to True, trust the text as html
@arikfr
Copy link
Member

arikfr commented Apr 4, 2018

Thanks!

But your change disabled Markdown rendering, so that's not optimal either.

@jwestbrook
Copy link
Author

Noted, I'll put together a bigger fix that handles both scenarios

@arikfr
Copy link
Member

arikfr commented Apr 4, 2018

👍 thanks!

The issue was created by switching to another (more maintained/secure) markdown rendering library (named markdown). I would check if it has any configuration options to allow unsafe HTML.

@sreynen
Copy link
Contributor

sreynen commented May 23, 2018

There are a couple issues on preserving HTML in the markdown issue queue:

evilstreak/markdown-js#295
evilstreak/markdown-js#288

Both of those issues suggest the project is not maintained, and the previous maintainer seems to confirm that in evilstreak/markdown-js#266

@arikfr
Copy link
Member

arikfr commented May 24, 2018

Thanks for the info @sreynen. I don't mind replacing the lib, given the new one is of similar size.

@arikfr
Copy link
Member

arikfr commented Jan 21, 2020

Hi,

(This is a template message, but I mean every word of it. Also you're welcome to reply)

Thank you for making this contribution. While we couldn't bring it to completion and merge, it's still very much appreciated. 🙇

In the past year the Redash code base gone under massive updates: on the backend we moved to Python 3 & RQ instead of Celery and on the frontend we replaced Angular with React. It's very likely this makes this PR irrelevant without significant changes. :-(

I'm closing this PR now. But if you're still interested in making it happen, let me know and I will reopen.

Thanks.

@arikfr arikfr closed this Jan 21, 2020
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

Successfully merging this pull request may close these issues.

3 participants