4 ms·
This is one thing I like about IBM: they have a separate security team that audits stuff before you ship it. I was working on a react app where I set up server-
by nfriedly 9y ago
This is one thing I like about IBM: they have a separate security team that audits stuff before you ship it. I was working on a react app where I set up server-side rendering, and then had it JSON-encode the state and dump it into a script tag in the end of the HTML. My thinking at the time was "It's JSON-encoded, and it's all the user's own data anyways, so it's safe."
Eventually I needed something from the querystring and for whatever reason put it into the state. It turns out that a <script> tag from the querystring in a string in a blob of JSON in a HTML page will execute. Oops.
Fortunately IBM's security team caught it before it ever shipped. Now it's been fixed and the app has a CSP header to help nullify any future mistakes.
- mmcnl 9y agoThat's weird, shouldn't that be a responsibility of your router? Or did you roll your own?
- nfriedly 9y agoI think it was a combination of react-router and react-router-redux, and something I was doing for SSR that led to the issue. The initial fix was just to delete the react-router-redux data from the store just before JSON.stringify'ing it. There were a number of weird things that were specific to my usage, so I'm not sure that the vulnerability would be there in a "proper" setup.