I developed a custom component and when I run it in Streamlit 1.17.0 I see in the Developer Tools Console:
An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.
Question
My understanding is that this is very insecure. Not worried about the component’s source code (I trust it), but could a malicious user exploit this through their browser or in any other way?
This browser warning means that the component is not actually “sandboxed” from the rest of the Streamlit app (which is intended - the blog post you linked goes into more detail about why we’re ok with this).
The threat vector that the browser is warning you about here is the component itself - Streamlit does not prevent components from reaching across the iframe boundary into the parent Streamlit app. If you trust the component’s source code, this is fine.
In other words, there’s nothing inherent in Streamlit’s component system that makes Streamlit more vulnerable to malicious users. But a badly or maliciously written component can “see” everything else in the Streamlit app, so you should treat Streamlit components just as you would with any other third-party dependency: if you don’t trust the component, you should not include it in your Streamlit app.