Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22088 > unrolled thread

How to determine and to prevent javascript being hacked?

Started byjustaguy <lichunshen84@gmail.com>
First post2013-11-20 17:56 -0800
Last post2013-11-28 11:22 -0800
Articles 14 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  How to determine and to prevent javascript being hacked? justaguy <lichunshen84@gmail.com> - 2013-11-20 17:56 -0800
    Re: How to determine and to prevent javascript being hacked? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2013-11-20 18:42 -0800
    Re: How to determine and to prevent javascript being hacked? Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-21 02:57 +0000
      Re: How to determine and to prevent javascript being hacked? John Harris <niam@jghnorth.org.uk.invalid> - 2013-11-21 10:50 +0000
    Re: How to determine and to prevent javascript being hacked? Christoph Michael Becker <cmbecker69@arcor.de> - 2013-11-21 12:14 +0100
      Re: How to determine and to prevent javascript being hacked? justaguy <lichunshen84@gmail.com> - 2013-11-21 20:25 -0800
        Re: How to determine and to prevent javascript being hacked? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-22 15:18 +0100
        Re: How to determine and to prevent javascript being hacked? Christoph Michael Becker <cmbecker69@arcor.de> - 2013-11-22 20:08 +0100
          Re: How to determine and to prevent javascript being hacked? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-22 22:15 +0100
          Re: How to determine and to prevent javascript being hacked? justaguy <lichunshen84@gmail.com> - 2013-11-22 14:50 -0800
            Re: How to determine and to prevent javascript being hacked? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-11-23 00:16 +0100
            Re: How to determine and to prevent javascript being hacked? Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-23 01:38 +0000
              Re: How to determine and to prevent javascript being hacked? justaguy <lichunshen84@gmail.com> - 2013-11-23 14:30 -0800
    Re: How to determine and to prevent javascript being hacked? (Resolved) justaguy <lichunshen84@gmail.com> - 2013-11-28 11:22 -0800

#22088 — How to determine and to prevent javascript being hacked?

Fromjustaguy <lichunshen84@gmail.com>
Date2013-11-20 17:56 -0800
SubjectHow to determine and to prevent javascript being hacked?
Message-ID<2b5cc6d4-c970-4faa-b169-4300e2935be4@googlegroups.com>
Hi,

I have a web app that runs locally.  I divide the screen into two and make each element on the right panel clickable, upon click it loads data into the left panel.  It's been working for several months for Chrome, Firefox and Safari browsers.  But all of a sudden, this javascript no longer functions for Chrome 31 while it works fine with Firefox 25 and Safari 5.
Firebug indicates all the js codes were executed while Chrome indicated that top portion of the js codes were executed but all but absolutely zero error. 

Any thoughts?

Thanks.

[toc] | [next] | [standalone]


#22089

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2013-11-20 18:42 -0800
Message-ID<6a340cd8-3233-4d91-8a39-3b9f69aed41f@googlegroups.com>
In reply to#22088
On Wednesday, November 20, 2013 7:56:05 PM UTC-6, justaguy wrote:

> I have a web app that runs locally.  I divide the screen into two and make each element on the right panel clickable, upon click it loads data into the left panel.  It's been working for several months for Chrome, Firefox and Safari browsers.  But all of a sudden, this javascript no longer functions for Chrome 31 while it works fine with Firefox 25 and Safari 5.
> 
> Firebug indicates all the js codes were executed while Chrome indicated that top portion of the js codes were executed but all but absolutely zero error. 
> 
> Any thoughts?

My thought is that you should post some code.

[toc] | [prev] | [next] | [standalone]


#22090

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-21 02:57 +0000
Message-ID<l6jsrd$k1r$1@dont-email.me>
In reply to#22088
On Wed, 20 Nov 2013 17:56:05 -0800, justaguy wrote:

> I have a web app that runs locally. .....

> Any thoughts?

There doesn't deem to be any cohesion between your choice of subject line 
and your problem description.

Without a url to the offending page, it is difficult to debug such a 
problem.

Unless you can provide a url to a public website with the minimal code 
needed to demonstrate this issue, then the best answer I can offer is 
that you sacrifice more goats, but less chickens.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#22092

FromJohn Harris <niam@jghnorth.org.uk.invalid>
Date2013-11-21 10:50 +0000
Message-ID<bcpr89pm3v8ubiat8utpiga4318ut7chbi@4ax.com>
In reply to#22090
On Thu, 21 Nov 2013 02:57:50 +0000 (UTC), Denis McMahon
<denismfmcmahon@gmail.com> wrote:

  <snip>
>Unless you can provide a url to a public website with the minimal code 
>needed to demonstrate this issue, then the best answer I can offer is 
>that you sacrifice more goats, but less chickens.

Ah, but have you tested that answer ?

  John

[toc] | [prev] | [next] | [standalone]


#22093

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2013-11-21 12:14 +0100
Message-ID<528deb24$0$6627$9b4e6d93@newsspool2.arcor-online.net>
In reply to#22088
justaguy wrote:

> I have a web app that runs locally.  I divide the screen into two
> and make each element on the right panel clickable, upon click it
> loads data into the left panel.  It's been working for several months
> for Chrome, Firefox and Safari browsers.  But all of a sudden, this 
> javascript no longer functions for Chrome 31 while it works fine
> with Firefox 25 and Safari 5.
>
> Firebug indicates all the js codes were executed while Chrome
> indicated that top portion of the js codes were executed but all but
> absolutely zero error.
> 
> Any thoughts?

You can use Chrome's built-in debugger[1] to check the actual control flow.

[1] <http://devtoolsecrets.com/>

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#22123

Fromjustaguy <lichunshen84@gmail.com>
Date2013-11-21 20:25 -0800
Message-ID<d9447e08-8851-4a86-9199-1cf7aeaf1faf@googlegroups.com>
In reply to#22093
On Thursday, November 21, 2013 6:14:51 AM UTC-5, Christoph Michael Becker wrote:
> justaguy wrote:
> 
> 
> 
> > I have a web app that runs locally.  I divide the screen into two
> 
> > and make each element on the right panel clickable, upon click it
> 
> > loads data into the left panel.  It's been working for several months
> 
> > for Chrome, Firefox and Safari browsers.  But all of a sudden, this 
> 
> > javascript no longer functions for Chrome 31 while it works fine
> 
> > with Firefox 25 and Safari 5.
> 
> >
> 
> > Firebug indicates all the js codes were executed while Chrome
> 
> > indicated that top portion of the js codes were executed but all but
> 
> > absolutely zero error.
> 
> > 
> 
> > Any thoughts?
> 
> 
> 
> You can use Chrome's built-in debugger[1] to check the actual control flow.
> 
> 
> 
> [1] <http://devtoolsecrets.com/>
> 

Does the F12 key do the same thing?  I watched js code execution in Chrome with this window.  It's likely that my computer has been planted with a virus that caused this issue... And publicly available anti-virus program won't be able to fix it...


[toc] | [prev] | [next] | [standalone]


#22130

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-11-22 15:18 +0100
Message-ID<2214399.Af8jLJcgcz@PointedEars.de>
In reply to#22123
justaguy wrote:

> Christoph Michael Becker wrote:
>> You can use Chrome's built-in debugger[1] to check the actual control
>> flow.
>> 
>> [1] <http://devtoolsecrets.com/>
> 
> Does the F12 key do the same thing?

That is a stupid question.

,--<http://devtoolsecrets.com/>
| 
| Finding the Developer Tools
| 
| If Developer Tools are a complete secret to you, you may have had
| difficulty finding them!
| 
| As well as a menu shortcut, you can access the Developer Tools easily
| either pressing "F12" in Windows […]
         ^^^^^^^^^^^^^^
FTR, it is F12 on GNU/Linux, too, and probably a number of other OSs.
It is more a matter of the keyboard layout and the browser than of the OS.

> I watched js code execution in Chrome with this window.  It's likely that
> my computer has been planted with a virus that caused this issue...

It is more likely that you do not know what you are doing.

> And publicly available anti-virus program won't be able to fix it...

Most certainly it is not a virus at all, then.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#22147

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2013-11-22 20:08 +0100
Message-ID<528fab87$0$6560$9b4e6d93@newsspool4.arcor-online.net>
In reply to#22123
justaguy wrote:

> On Thursday, November 21, 2013 6:14:51 AM UTC-5, Christoph Michael
> Becker wrote:
> 
>> justaguy wrote:
>> 
>>> I have a web app that runs locally.  I divide the screen into
>>> two and make each element on the right panel clickable, upon
>>> click it loads data into the left panel.  It's been working for
>>> several months for Chrome, Firefox and Safari browsers.  But all
>>> of a sudden, this javascript no longer functions for Chrome 31
>>> while it works fine with Firefox 25 and Safari 5.
>>> 
>>> Firebug indicates all the js codes were executed while Chrome 
>>> indicated that top portion of the js codes were executed but all
>>> but absolutely zero error.
>>> 
>>> Any thoughts?
>> 
>> You can use Chrome's built-in debugger[1] to check the actual
>> control flow.
>> 
>> [1] <http://devtoolsecrets.com/>
>> 
> 
> Does the F12 key do the same thing?  

Pressing F12 opens the developer tools in Chrome.

>                                      I watched js code execution in
> Chrome with this window.  

What do you mean exactly?  Did you just have a look at the (error)
console, or did you actually use the debugger to step through the code?

>                           It's likely that my computer has been
> planted with a virus that caused this issue... And publicly available
> anti-virus program won't be able to fix it...

I rather guess, that there was some change in Chrome 31 that breaks your
code.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#22149

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-11-22 22:15 +0100
Message-ID<5370824.RprjGb0iVi@PointedEars.de>
In reply to#22147
Christoph Michael Becker wrote:

> justaguy wrote:
>> On Thursday, November 21, 2013 6:14:51 AM UTC-5, Christoph Michael
>> Becker wrote:
>>> […]
>>> You can use Chrome's built-in debugger[1] to check the actual
>>> control flow.
>>> 
>>> [1] <http://devtoolsecrets.com/>
>> 
>> Does the F12 key do the same thing?
> 
> Pressing F12 opens the developer tools in Chrome.

And in Firefox, with Firebug (which started this).  And in IE 8+.  Not in 
Opera up to at least version 12.16, though (that would probably break 
backwards-compatibility for them; F12 has always shown the “Quick 
Preferences” menu there, where among other things you could disable/enable 
“JavaScript”).
 
-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#22152

Fromjustaguy <lichunshen84@gmail.com>
Date2013-11-22 14:50 -0800
Message-ID<968fdaae-78db-4459-9002-e84089099aad@googlegroups.com>
In reply to#22147
On Friday, November 22, 2013 2:08:01 PM UTC-5, Christoph Michael Becker wrote:
> justaguy wrote:
> 
> 
> 
> > On Thursday, November 21, 2013 6:14:51 AM UTC-5, Christoph Michael
> 
> > Becker wrote:
> 
> > 
> 
> >> justaguy wrote:
> 
> >> 
> 
> >>> I have a web app that runs locally.  I divide the screen into
> 
> >>> two and make each element on the right panel clickable, upon
> 
> >>> click it loads data into the left panel.  It's been working for
> 
> >>> several months for Chrome, Firefox and Safari browsers.  But all
> 
> >>> of a sudden, this javascript no longer functions for Chrome 31
> 
> >>> while it works fine with Firefox 25 and Safari 5.
> 
> >>> 
> 
> >>> Firebug indicates all the js codes were executed while Chrome 
> 
> >>> indicated that top portion of the js codes were executed but all
> 
> >>> but absolutely zero error.
> 
> >>> 
> 
> >>> Any thoughts?
> 
> >> 
> 
> >> You can use Chrome's built-in debugger[1] to check the actual
> 
> >> control flow.
> 
> >> 
> 
> >> [1] <http://devtoolsecrets.com/>
> 
> >> 
> 
> > 
> 
> > Does the F12 key do the same thing?  
> 
> 
> 
> Pressing F12 opens the developer tools in Chrome.
> 
> 
> 
> >                                      I watched js code execution in
> 
> > Chrome with this window.  
> 
> 
> 
> What do you mean exactly?  Did you just have a look at the (error)
No errors at Console.  However, two lines of code has not been executed.

> console, or did you actually use the debugger to step through the code?
How do I activate the debugger?

> 
> 
> 
> >                           It's likely that my computer has been
> 
> > planted with a virus that caused this issue... And publicly available
> 
> > anti-virus program won't be able to fix it...
> 
> 
> 
> I rather guess, that there was some change in Chrome 31 that breaks your
> code.
Probably you're right.  If so I might not be the only who has been adversely affected.  Do you have a link or email handy to report it to Google Chrome team?

Thanks.



> 
> 
> 
> -- 
> 
> Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#22154

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-11-23 00:16 +0100
Message-ID<1490070.a6lYbDdxyy@PointedEars.de>
In reply to#22152
justaguy wrote:

> On Friday, November 22, 2013 2:08:01 PM UTC-5, Christoph Michael Becker
> wrote:
>> [snip Google-created character mess]
>> 
>> I rather guess, that there was some change in Chrome 31 that breaks your
>> code.
> 
> Probably you're right.  If so I might not be the only who has been
> adversely affected.  Do you have a link or email handy to report it to
> Google Chrome team?

<http://zh.lmgtfy.com/?q=report+chrome+bug>

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#22157

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-23 01:38 +0000
Message-ID<l6p0v7$1qr$1@dont-email.me>
In reply to#22152
On Fri, 22 Nov 2013 14:50:18 -0800, justaguy wrote:

>> I rather guess, that there was some change in Chrome 31 that breaks
>> your code.

> Probably you're right.  If so I might not be the only who has been
> adversely affected.  Do you have a link or email handy to report it to
> Google Chrome team?

First of all, you need to verify that your code is not the problem.

Things that might cause your code to be the problem:

1) Browser specific code. If you're doing any form of browser or feature 
sniffing in your code, then you need to check that the result of that 
browser or feature sniffing is valid.

2) Any errors in markup that might affect the dom that it presents to the 
javascript, especially if the javascript is then making assumptions about 
the dom element tree that are invalid due to an inconsistency between 
(for example) the declared dtd and the actual markup.

3) A change in a non ratified "standard" such as html 5 that means that 
something that used to work doesn't any more.

I doubt that a chrome update would break previously working javascript 
unless that javascript and / or the dom it was manipulating were in some 
way flaky to begin with, and it's very unlikely that it would happen in a 
manner that only broke your system (I haven't noticed widespread 
complaints of broken chrome javascript, nothing seems to have been 
prominent on eg slashdot) unless the underlying issue was with your 
system.

So this brings us back to:

Please provide a url for a publicly accessible web page that contains the 
minimal html and javascript required to demonstrate the problem.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#22164

Fromjustaguy <lichunshen84@gmail.com>
Date2013-11-23 14:30 -0800
Message-ID<d17e583d-16c1-4348-86cd-2a648fcde264@googlegroups.com>
In reply to#22157
On Friday, November 22, 2013 8:38:47 PM UTC-5, Denis McMahon wrote:
> On Fri, 22 Nov 2013 14:50:18 -0800, justaguy wrote:
> 
> 
> 
> >> I rather guess, that there was some change in Chrome 31 that breaks
> 
> >> your code.
> 
> 
> 
> > Probably you're right.  If so I might not be the only who has been
> 
> > adversely affected.  Do you have a link or email handy to report it to
> 
> > Google Chrome team?
> 
> 
> 
> First of all, you need to verify that your code is not the problem.
> 
> 
> 
> Things that might cause your code to be the problem:
> 
> 
> 
> 1) Browser specific code. If you're doing any form of browser or feature 
> 
> sniffing in your code, then you need to check that the result of that 
> 
> browser or feature sniffing is valid.
> 
Not in this case.

> 
> 2) Any errors in markup that might affect the dom that it presents to the 
> 
> javascript, especially if the javascript is then making assumptions about 
> 
> the dom element tree that are invalid due to an inconsistency between 
> 
> (for example) the declared dtd and the actual markup.
> 
As said, Console indicates no errors.
  
> 
> 3) A change in a non ratified "standard" such as html 5 that means that 
> 
> something that used to work doesn't any more.
It's not HTML5 code.
 
> 
> 
> I doubt that a chrome update would break previously working javascript 
> 
> unless that javascript and / or the dom it was manipulating were in some 
> 
> way flaky to begin with, and it's very unlikely that it would happen in a 
> 
> manner that only broke your system (I haven't noticed widespread 
> 
> complaints of broken chrome javascript, nothing seems to have been 
> 
> prominent on eg slashdot) unless the underlying issue was with your 
> 
> system.
> 
> 
> 
> So this brings us back to:
> 
> 
> 
> Please provide a url for a publicly accessible web page that contains the 
> 
> minimal html and javascript required to demonstrate the problem.
Too bad.  It's a simple web app that runs locally, hence, it's 127.0.0.1 URL.

In the meantime, here's the essence.
The main server side script/template includes two scripts, one for the left panel and the other for the right panel, and the main script has a javascript function, say, ed, that accepts a parameter of obj_id.  So, loading of the main script, this js function becomes available.

And the right panel list different objects, upon clicking it would trigger the js function (from the main script) and pass obj_id to it, so that it loads the content of the object into the left panel.  It's really simple stuff.

Also, if you guys are willing to try it a try I can provide a link to download it the small app (but it may take up quite a bit of your time... hence, my hesitation of such a request, but if you think it's not too much hassle please email me don at knowledgenotebook dot com)

Thanks.





> 
> 
> 
> -- 
> 
> Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#22208 — Re: How to determine and to prevent javascript being hacked? (Resolved)

Fromjustaguy <lichunshen84@gmail.com>
Date2013-11-28 11:22 -0800
SubjectRe: How to determine and to prevent javascript being hacked? (Resolved)
Message-ID<b48b7e54-eb8f-4dd5-b458-307aa40616fc@googlegroups.com>
In reply to#22088
My bad. All other browsers are more forgiving.  Thanks.

>On Wednesday, November 20, 2013 8:56:05 PM UTC-5, justaguy wrote:
> Hi,
> 
> 
> 
> I have a web app that runs locally.  I divide the screen into two and make each element on the right panel clickable, upon click it loads data into the left panel.  It's been working for several months for Chrome, Firefox and Safari browsers.  But all of a sudden, this javascript no longer functions for Chrome 31 while it works fine with Firefox 25 and Safari 5.
> 
> Firebug indicates all the js codes were executed while Chrome indicated that top portion of the js codes were executed but all but absolutely zero error. 
> 
> 
> 
> Any thoughts?
> 
> 
> 
> Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web