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

Results containing opening bracket (<) are not displayed #755

Closed
Xangis opened this issue Jan 12, 2016 · 7 comments
Closed

Results containing opening bracket (<) are not displayed #755

Xangis opened this issue Jan 12, 2016 · 7 comments
Labels

Comments

@Xangis
Copy link
Contributor

Xangis commented Jan 12, 2016

I have this query:

SELECT keywords from recent_searches;

Some of these contain HTML tags or quotes. Like so (output from postgres console):

 keywords      

10916<span
11576<span
12739<span
1506'-'1
21666<span
29002<span
30328<span
32710<span
44035<span
04289+and+1=(select+0)--+-
04289+and+1=(select+1)--+-
62244<span
93201<span

(ok markdown chokes a bit on that... I'm not sure how to convey it better)

In the Redash query results, the "keywords" field shows up as blank for those items (which were search log entries from bots trying to perform SQL injection attacks). Every item listed above shows up as blank. Which is better than breaking something, but if that data can be escaped cleanly and displayed it would be an improvement.

@arikfr
Copy link
Member

arikfr commented Jan 14, 2016

It's probably a matter of configuring the sanitization. Can you share the query results via CSV, so it's easier to debug?

Thanks.

@Xangis
Copy link
Contributor Author

Xangis commented Jan 16, 2016

redash_results.txt

Each of the lines in the file shows up as blank in the table view of the query.

Thank you.

@subodh-malgonde
Copy link

This still seems to be an issue. Not just html but even strings like Hi <user> are shown as blank.

@matangover
Copy link

Experiencing the same thing. To reproduce, create a new query on re:dash, and type in the following query:

select '<Hello>' as test;

Expected to see <Hello> in the output table, but the cell is empty. In the Inspector there are some Javascript errors that refer to parsing errors in the sanitizer.

@matangover
Copy link

@arikfr are we doing something wrong? Is there a way to configure the sanitization?

@arikfr
Copy link
Member

arikfr commented Jan 3, 2017

@matangover nope, nothing wrong, but for now you will have to escape the angular brackets --

select '&lt;Hello&gt;' as test;

-- OR:

select replace(replace('<Hello>', '<', '&lt;'), '>', '&gt;') as test;

@arikfr arikfr changed the title Query Tool Does Not Handle Fields Containing HTML Well Results containing opening bracket (<) are not displayed Jan 17, 2017
@arikfr
Copy link
Member

arikfr commented Dec 2, 2018

In new releases, to avoid having this issue all the user needs to do is to uncheck the "Allow HTML content" setting for the column.

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

No branches or pull requests

4 participants