Why is gmail using eval?

This question suggests that use evalis bad practice, and many other questions suggest that it is "evil."

The answer to the question suggests that using eval () can be useful in one of the following cases:

  • Calculate the code received from the remote server. (Say you want to create a site that can be remotely controlled by sending him JavaScript code?)
  • Custom code rating. Without eval, you cannot program, for example, the online editor / REPL.
  • Dynamically creating functions of arbitrary length (function.length readonly, so the only way is to use eval).
  • Download script and return value. If your script, for example, is a self-service function, and you want to evaluate it and get this result (for example: my_result = get_script_result ("foo.js")), the only way to program the get_script_result function is by using eval inside it.
  • Recreating a function in another closure.

When viewing the Google Accounts page Source Code I found this:

(function(){eval('var f,g=this,k=void 0,p=Date.now||function(){return+new Date},q=function(a,b,c,d,e){c=a.split("."),d=g,c[0]in d||!d.execScript||d.execScript("var "+c[0]);for(;c.length&&(e=c.shift());) [a lot of code...] q("botguard.bg.prototype.invoke",K.prototype.ha);')})()</script>

I just can’t understand how useful this is, since it does not correspond to any of the above cases. The comment says:

 /* Anti-spam. Want to say hello? Contact (base64)Ym90Z3VhcmQtY29udGFjdEBnb29nbGUuY29tCg== */

I do not see how eval will be used as antispam. Can someone tell me why it is used in this particular case?

+4
source share
2

plan99.net - JS, ( ). : https://moderncrypto.org/mail-archive/messaging/2014/000780.html

[ ] E2E 5 08:07:30 PDT 2014

. , JavaScripts, . , http://webcache.googleusercontent.com/search?q=cache:v6Iza2JzJCwJ:www.hackforums.net/archive/index.php/thread-2198360.html+&cd=8&hl=en&ct=clnk&gl=ch

"Ym90Z3VhcmQtY29udGFjdEBnb29nbGUuY29tCg" base64 "botguard-contact".

http://webcache.googleusercontent.com/search?q=cache:v6Iza2JzJCwJ:www.hackforums.net/archive/index.php/thread-2198360.html+&cd=8&hl=en&ct=clnk&gl=ch :

google, / . Botguard ( google) :

/* Anti-spam. Want to say hello? Contact (base64) Ym90Z3VhcmQtY29udGFjdEBnb29nbGUuY29tCg== */

javascript, VALID, . Google - , ?

, , , .

, , , . , , ?

, - . , / javascript-, . , , -, ( ).

GitHub :

https://github.com/assaf/zombie/issues/336

Zombie ?

, document.bg botguard.bg(), script .

mikehearn 21 2012 . ,

Google .

, Google. , , , .

. , , , , . , IP- (, ), .

, , .

https://github.com/jonatkins/ingress-intel-total-conversion/issues/864 :

a , :

: useragent sniffing (yay, Internet Explorer), , mouse/kb... , . , . , -, "botguard.bg.prototype.invoke". , - google. , , , , ( clienBlob ). , , , (, )

, google eval , /.

+17

eval() . .

+3

Source: https://habr.com/ru/post/1526790/


All Articles