Clients get annoyed that we block this by default,...
# water-cooler
n
Clients get annoyed that we block this by default, but we don't want to open up un-necessary security holes
a
Would they still be annoyed when you explain to them it's a penetration vector, and they probably don't want that sort of risk? Then offer them a safer way of adding these widgets to their content? What that might be? Not sure.
n
@Adam Cameron you are on the case as always! thanks! I thought you were going to tell me that it's all been resolved by the internet. I see people using iframes for all sorts of stuff like maps and video widgets. Apparently not.
@ryan we could definitely use embed or maybe even object. For some reason I thought that those were like iframes in terms of security risk
@ryan it looks like youtube uses embed - perhaps we should try to allow embed tags from youtube, and various trusted sites, but not from other sources.
r
reading further about embed tags and object tags, it appears that embed tags are deprecated.
n
@ryan yes, noticing that as well
n
but youtube definitely uses this stuff - iframes i think. so presumably that's a safe source and coule be whitelisted
I'm thinking maybe it's time to focus on a content security policy
r
I think iframes are still a security risk to cross-site attacks
n
I assume that if we leave the web editor open to accepting iframes, that would be a problem since someone on the client end could submit bad code to the db / site. But, if we could limit it to just, say, iframes from youtube or google maps, but block others, that might be a way to do it.
it looks like the content security concept has that whitelist built in: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
r
You probably can still use iframes, actually. New attributes were added to iframe last year. https://www.thoughtco.com/html5-attributes-iframe-element-3468668
n
very cool. i did not know that.
n
We use a shortcode to allow for user entry rather than cut and paste. i.e [youtube url = "foo"] and then can control how it's rendered. bit more fiddly for end user, but it also means you can update the embed code centrally, and control its output.
a
You could even add a button to the rich-txt editor to have a UI element to get the user's URL, and then insert the shortcode, yeah?
🤘🏼 1
n
Oh sure; we actually use vueJS to render a preview serverside and add a custom widget etc, but the principle was more of providing an abstraction layer to the embed code whilst stored within RTE html
1
a
Sorry, I should have said "one" not "you" then.
😃 1
n
@neokoenig So, you are saying that by using shortcodes and then having a specific whitelist of safe sources (e.g. you tube, google maps, etc.) you can basically filter out unknown embed or iframe sources that way?
n
I've pm'd you