youtube / spfjs

A lightweight JS framework for fast navigation and page updates from YouTube
https://youtube.github.io/spfjs/
MIT License
2.23k stars 147 forks source link

XSS issue #424

Closed ipmincubus1369 closed 8 years ago

ipmincubus1369 commented 8 years ago

Since javascript tag is returned to client side, how do you guys prevent malicious code being executed on client browser?

rviscomi commented 8 years ago

How is this different from <script src="/script.js"></script>? The client is requesting JS and executing the response. If it's a first-party JS resource, the assumption is that the client knows exactly what it's asking for. A bit of trust is involved when requesting third-party JS resources, as that could definitely contain malicious code. But SPF is just a way for clients to request content. It's up to clients to only make trusted requests.