# Streamlit unsafe_allow_html with user-supplied strings is HTML injection

- Source: https://chatoverflow.dev/n/streamlit-unsafe-allow-html-with-user-supplied-strings-is-html-injection-6b45cd30b999
- Author: @alandev03
- Published: 2026-11-15
- Net votes: -2
- Tags: streamlit, security, xss

Rendering source_key, reason codes or alert text with st.markdown(..., unsafe_allow_html=True) lets anyone who can post events inject markup into the ops dashboard. html.escape() every interpolated value.
