LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-08-2012, 03:48 AM   #1
dman777
Member
 
Registered: Dec 2010
Distribution: Gentoo
Posts: 232

Rep: Reputation: 8
Global Objects in Javascript- Possible to Exploit?


I was told that if you use global objects in a Javascript that it possible that a malicouse user could exploit the web page. Would this be true even with static web pages?
 
Old 07-09-2012, 09:42 AM   #2
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Hi dman777,
The problem using global variables is the NameSpace cluttering (efficiency loose) ans libraries conflicts, no necessarily exploits. But if there is any exploitable bug, it will be easier to exploit if you use global variables. See http://www.javascripttoolbox.com/bes...ces/#namespace for more details and good JS practices (or use Google for it).

There is no difference between static or dynamic pages (browsers don't really know where pages come from). But, of course, if it's a static page there is no DB and, therefore, there are no users, passwords, etc. Might still be other bugs or sensible data, or other apps in the same server that could still be exploitable by JS bugs in the static page.

Hope it helps.
 
Old 07-09-2012, 03:27 PM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Did whoever told you this give you an example of such an exploit?
 
Old 07-13-2012, 12:02 AM   #4
dman777
Member
 
Registered: Dec 2010
Distribution: Gentoo
Posts: 232

Original Poster
Rep: Reputation: 8
no, it was on freenode so you know...your lucky to get an answer and what answers you get you don't want to make anyone made and get flamed.
 
Old 07-13-2012, 09:07 AM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
I've never heard of a Javascript global object exploit, and my nose tells me that this exploit does not exist. I mean, is the ubiquitous jQuery global variable an attack vector?
 
Old 07-13-2012, 09:17 AM   #6
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
Quote:
Originally Posted by dugan View Post
I've never heard of a Javascript global object exploit, and my nose tells me that this exploit does not exist. I mean, is the ubiquitous jQuery global variable an attack vector?
No, absolutely. The exploitable bugs are in the server side, when some controls are left to javascript instead of doing it in server side, too. Whenever I load a page on my browser (Firefox, Chromium), I always can tell the browser to execute customized JS code (with Firebug on FF or Developer tools on Chromium). So JS is not where exploitable bugs live, it's always on server side. JS is there just to help the user, so you cannot delegate security matters only to JS.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: OpenClinica Global Conference to Bring Together Global Community for Open Sourc LXer Syndicated Linux News 0 01-08-2010 10:50 AM
LXer: Java Data Objects and Service Data Objects in SOA LXer Syndicated Linux News 0 01-17-2009 06:10 AM
How to check the cpu utilization on all non global zones from Global Zone rajaniyer123 Solaris / OpenSolaris 3 10-09-2008 01:43 AM
javascript > embeded objects > onMediaComplete() not working on OSX BrianK Programming 0 07-02-2008 09:48 PM
dynamically add objects in JavaScript djgerbavore Programming 1 03-11-2005 09:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration