★ wanayoo — archive 1999 https://github.com/yahoo/serialize-javascript/pull/38Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Replace deserialize eval with JSON.parse #38

Open
wants to merge 1 commit into
base: master
from

Conversation

@unlobito
Copy link

@unlobito unlobito commented Jun 18, 2018

From json.org:

The eval function is very fast. However, it can compile and execute any JavaScript program, so there can be security issues. The use of eval is indicated when the source is trusted and competent. It is much safer to use a JSON parser. In web applications over XMLHttpRequest, communication is permitted only to the same origin that provide that page, so it is trusted. But it might not be competent. If the server is not rigorous in its JSON encoding, or if it does not scrupulously validate all of its inputs, then it could deliver invalid JSON text that could be carrying dangerous script. The eval function would execute the script, unleashing its malice.

This updates README.md to suggest using JSON.parse instead.

@yahoocla
Copy link

@yahoocla yahoocla commented Jun 18, 2018

Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄

This updates README.md to suggest using [JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) instead of eval to address security concerns.
@unlobito unlobito force-pushed the unlobito:patch-1 branch from 1880662 to 163e2a7 Jun 18, 2018
@gronke
Copy link

@gronke gronke commented Jun 18, 2018

But isn't the serialization of complex objects the main purpose of this utility? So being able to deserialize it in the same way seems to be a plausible cause for the eval.

@unlobito you're right that this is dangerous and the warning sign should be huge.

@kadirselcuk
Copy link

@kadirselcuk kadirselcuk commented Aug 13, 2020

Selamlar, bu benim için güvenlik açıklarıma faydalı olacaktır, eğer kısmen eksik yönlerim olursa değerlendireceğim

@kadirselcuk
Copy link

@kadirselcuk kadirselcuk commented Aug 14, 2020

Herkese selamlar, kiwiirc için JavaScript doğrulaması için bunu kullanıyorum, eğer bilmem gereken şeyler varsa lütfen iletin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.