React-starter-kit: How to secure redux data-initial-state

Created on 11 Jul 2016  路  15Comments  路  Source: kriasoft/react-starter-kit

Hi all,
Have any way to secure redux data-init-state below image:
screen shot 2016-07-12 at 2 18 11 am

question

Most helpful comment

@alexsuslov If you need decrypt data on client, you need key on client. It is not secure because all you need for decrypting can be achieved

All 15 comments

+1
it feels odd seeing everything just laid out there for everybody. I know you can get that data if you want but at least not straight forward like that.

Hello @langpavel, how do you think ? :)

+1

You need to hide information on the transfer or make not readable?

yeh, could hide it ?, or some way to encrypt it. I think data can be leaks when see them in data-initial-state.

may be base64 ?
console.log(btoa("test"));
dGVzdA==
console.log(atob(btoa("test")));
test

May be... But encryption - decryption it's the best option ? :)

there is an option to do bit operations. they are fast.
or https://www.npmjs.com/package/crypto-js

I argee with you, and I think it's the best way. Thanks @alexsuslov

Security by obscurity is no security at all. If you are unhappy to see this in, you can just delete data-initial-state attribute in DOM after it value is readed here. But this will do not protect your data.

@alexsuslov If you need decrypt data on client, you need key on client. It is not secure because all you need for decrypting can be achieved

how to ! :|

Closing this with only real solution from @frenzzy: Enable Content Security Policy

Thanks @langpavel

Was this page helpful?
0 / 5 - 0 ratings