JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 5th, 2008, 03:36 PM
romario romario is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 103 romario User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 2 m 34 sec
Reputation Power: 6
Security issue. Ajax shows php script URL

xmlHttp.open("POST","folder/page.php",true);

when using AJAX you can give away the URL of another file. this could be a a potential security issue.

whats the best solution for this?

i can password protect the directory that contains that file but i dont really want hackers to know where the file exists.

Reply With Quote
  #2  
Old May 5th, 2008, 03:54 PM
romario romario is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 103 romario User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 2 m 34 sec
Reputation Power: 6
so now i am rethinking what i wrote. is it really a security issue? if they run the php file they wont be able to see any php code anyway.

Reply With Quote
  #3  
Old May 5th, 2008, 04:01 PM
GameYin GameYin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2008
Location: Whiteford, MD
Posts: 348 GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level)GameYin User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 11 h 54 m
Warnings Level: 5
Reputation Power: 60
Send a message via AIM to GameYin
MySpace
Are you being security conscious when writing your PHP in your code? Have you made any security attempts? Best bet: Go to a hacking site if you don't know how to hack. Ask them to hack your site, but not seriously. Just to see if they can get by DarkMindZ is a site where they will "beta test" your stuff. Enjoy
__________________
Adwords Professional
You can give me

Last edited by GameYin : May 5th, 2008 at 04:02 PM. Reason: Link didn't show up properly. Typo on it.

Reply With Quote
  #4  
Old May 5th, 2008, 05:23 PM
romario romario is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 103 romario User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 2 m 34 sec
Reputation Power: 6
thanks for the answer. i will look into that website.

i was dooing some browsing and i came across some advice. basically i should treat page.php just like a normal php script. any user could run the script directly and hence i need to set permissions for what they can do.

are there any articles online about this issue?

Reply With Quote
  #5  
Old May 6th, 2008, 07:05 AM
Joseph Taylor's Avatar
Joseph Taylor Joseph Taylor is offline
Text Ninja
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2005
Location: Vancouver, British Columbia, Canada
Posts: 596 Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level)Joseph Taylor User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 1 h 12 m 43 sec
Reputation Power: 107
Send a message via Skype to Joseph Taylor Send a message via XFire to Joseph Taylor
Quote:
i can password protect the directory that contains that file but i dont really want hackers to know where the file exists.
In other words you want security through obscurity. Good luck.

Quote:
is it really a security issue?
Sure. Anything can be a security issue. Just be aware that any holes here were punched by you--that "visible URLs" thing isn't a flaw in the design of the XmlHttpRequest object itself. Every URL a user's browser makes a request to can be made known to the user himself. If this wasn't the case then that would be a security flaw.

Quote:
if they run the php file they wont be able to see any php code anyway.
True, but they could leverage their knowledge of its location later in, say, a directory traversal attack. One thing you can do if the file contains sensitive information (aside from the obvious, the removal of the sensitive information) is alias the file's request URL using mod_rewrite. That way, at least, the attacker can't count on a correspondence between the URL of your file and the file system's directory structure. Of course, if the attacker has found a directory traversal bug you're probably screwed anyhow.

Quote:
i was dooing some browsing and i came across some advice. basically i should treat page.php just like a normal php script. any user could run the script directly and hence i need to set permissions for what they can do.
Okay, so sensitive information isn't the problem. It's just that this PHP file wreaks havoc on your database then has sex with your girlfriend, which is why you were thinking it should only be possible for you (and other administrators?) to call it. Fair enough.

That's where authentication comes into play. There are indeed a plethora of articles on the subject, at least one of which calls Devshed home. I haven't read that last article, but it does cover hashing (not drug related, but something every programmer should learn about nonetheless) and it will, if nothing else, equip you with a few more keywords to plug into Google.

Last edited by Joseph Taylor : May 6th, 2008 at 07:07 AM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Security issue. Ajax shows php script URL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway