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

Chatbot sanitize removes scripting from messages. #5382

Closed
1 task done
jrowen opened this issue Aug 30, 2023 · 1 comment
Closed
1 task done

Chatbot sanitize removes scripting from messages. #5382

jrowen opened this issue Aug 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@jrowen
Copy link

jrowen commented Aug 30, 2023

Describe the bug

A recent update to the chatbot (#4360) is now removing script tags from chatbot messages. For example, I'm trying to append a button tag with an onclick property, but the onclick is being removed when the message is displayed in the chatbot: <button style="font-size:18px;" onclick="alert(\'good\')">Click</button>

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Include the following in a chatbot response: <button style="font-size:18px;" onclick="alert(\'good\')">Click</button>

Screenshot

No response

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 3.41.2
gradio_client version: 0.5.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.1.0
fastapi: 0.103.0
ffmpy: 0.3.1
gradio-client==0.5.0 is not installed.
httpx: 0.24.1
huggingface-hub: 0.16.4
importlib-resources: 6.0.1
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.7.2
numpy: 1.25.2
orjson: 3.9.5
packaging: 23.1
pandas: 2.0.3
pillow: 10.0.0
pydantic: 1.10.12
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
requests: 2.31.0
semantic-version: 2.10.0
typing-extensions: 4.5.0
uvicorn: 0.23.2
websockets: 11.0.3
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2023.6.0
httpx: 0.24.1
huggingface-hub: 0.16.4
packaging: 23.1
requests: 2.31.0
typing-extensions: 4.5.0
websockets: 11.0.3

Severity

Blocking usage of gradio

@jrowen jrowen added the bug Something isn't working label Aug 30, 2023
@abidlabs
Copy link
Member

Hi @jrowen we've just added a kwarg to disable html sanitization in the gr.Chatbot -- see here: #5304

You can see instructions in the PR on how to install gradio from the PR branch, or you can wait until we release a version of gradio (probably later this week).

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants