473,767 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

faking session data

Hello all,

I have written numerous functions that check all user entered data on my
site via POST and GET. My question is this: once my data checks out as
being valid, I sometimes store it in SESSION as I move between pages,
and eventually use the values in SESSION to update my database. Do I
need to re-check the values in SESSION to make sure they are still valid
before updating the database? In other words, I know session data
resides on the server, but how possible/likely is it that a malicious
user could fake session data after or in lieu of my initial error
checks? All pages are protected by SSL if that makes any difference.
Thanks in advance.

Marcus
Aug 30 '05 #1
3 2446
"Marcus" <Ju********@aol .com> kirjoitti
viestissä:fw*** ************@ne wssvr24.news.pr odigy.net...
Hello all,

I have written numerous functions that check all user entered data on my
site via POST and GET. My question is this: once my data checks out as
being valid, I sometimes store it in SESSION as I move between pages, and
eventually use the values in SESSION to update my database. Do I need to
re-check the values in SESSION to make sure they are still valid before
updating the database? In other words, I know session data resides on the
server, but how possible/likely is it that a malicious user could fake
session data after or in lieu of my initial error checks? All pages are
protected by SSL if that makes any difference. Thanks in advance.


I'd say your session data is quite secure. Although, you might concider
these precautions:
http://www.ericisgreat.com/tinfoilhats/

--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.ber keley.edu/>
Kimmo Laine <et************ ****@5P4Mgmail. com>
Aug 30 '05 #2
Marcus wrote:
Hello all,

I have written numerous functions that check all user entered data on my
site via POST and GET. My question is this: once my data checks out as
being valid, I sometimes store it in SESSION as I move between pages,
and eventually use the values in SESSION to update my database. Do I
need to re-check the values in SESSION to make sure they are still valid
before updating the database? In other words, I know session data
resides on the server, but how possible/likely is it that a malicious
user could fake session data after or in lieu of my initial error
checks? All pages are protected by SSL if that makes any difference.
Thanks in advance.

Marcus

The session data values are stored on the server. The session id however
is passed to the client. In the worst case, the client could fake the id
and hijack another session.
Aug 30 '05 #3
>I have written numerous functions that check all user entered data on my
site via POST and GET. My question is this: once my data checks out as
being valid, I sometimes store it in SESSION as I move between pages,
and eventually use the values in SESSION to update my database. Do I
need to re-check the values in SESSION to make sure they are still valid
before updating the database? In other words, I know session data
resides on the server, but how possible/likely is it that a malicious
user could fake session data after or in lieu of my initial error
checks? All pages are protected by SSL if that makes any difference.


Ok, what is the threat here?

(1) Malicious admins of your server. You really can't protect
against them. They can modify your pages or corrupt the version
of PHP or edit files directly. They can probably modify your
database directly also.

(2) Session spoofing. Guessing a valid session is very difficult
to do because of the large number space used. It may well be easier
to guess the user's username/password, which is much more worthwhile
as that generally lasts much longer than a session. The most
practical session spoofs probably involve network sniffing, accessing
unattended computers, or using a URL posted by the legitimate user
including the session ID. (Partial) Defense against session spoofing:
time out sessions as quickly as practical without inconveniencing
legitimate users too much. Locking a session to an IP may inconvenience
or lock out legitimate users (e.g. AOL users or others whose ISPs
use round-robin proxies).

(3) Security holes in your PHP pages. If your pages can be convinced
to stuff invalid stuff into the session, you'll have corrupt data
in there. Check user inputs. Do not depend on Javascript for ANY
checking (it may be turned off, and manually asking for URLs with
telnet to the web server doesn't require it at all).

(4) Watch out for stale data. While you may have checked that what
you put into $_SESSION['article_id'] was a valid article *THEN*,
is it a valid article *NOW*? $_SESSION['article_id'] may not have
changed, but perhaps the article was deleted since then. If a user
keeps a session going for a long time (e.g. months), how often do
you check that he's still paid for his subscription, and hasn't
been deleted for abuse?

Gordon L. Burditt
Aug 30 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3309
by: Damien | last post by:
Hi to all, I'm currently re-designing our intranet : nice and lean CSS2, cleaned-up PHP 4.3.7, better-normalized MySQL ;o). So I've started using the $_SESSION variable instead of register_globals and a couple "better pratice" code. Not perfect, but better. Problem : I'm testing everything with Firefox on my machine (IIS on WinXP Pro), and everything is ok. As soon as I try MS IE 6, it doesn't seem to keep the sessions from page to...
6
2679
by: mammothman42 | last post by:
i've copied my bank's login form and saved a copy on my computer. However when i try to submit it, i get a 405 method not allowed error. Can't for the life of me figure out why, it's posting exactly the same data from exactly the same html code. Any ideas? It's a https (SSL) site. cheers dave
3
1915
by: Chris Smith | last post by:
Good morning, Is there a good way to use JavaScript to send a form submission, but get back the response as a string, rather than loading it into a page? I could write the code to send the submission via XMLHttpRequest, but that seems hard... especially implementing multipart-encoded form submission such as required for file upload. Ideas?
9
3661
by: bajopalabra | last post by:
hi session("myVar") = rs.getRows( ) don't work when number of records is greater than 10 does anybody know WHY ??? is it a Session object limitation ??? thanks
5
2455
by: Abhilash.k.m | last post by:
This is regarding the session management using Out of proc session management(SQL SERVER). Among the samples below which one is better to set the session? 1. There are 20 session variables and all of them are being stored into session and accessed from session and individual session object. Example: Session = "XYZ", Session=100, Session="NAME", etc.
3
3697
by: | last post by:
I am working on a web/webservice application that has a service layer. Most service methods will perform an access-check before executing. This check uses the IPrincipal credentials available in HttpContext.Current. This works great. My issue is that I need to write unit tests for those service methods. These tests then run outside of IIS, thus there is no HttpContext.Current available - and the servicemethod will not execute. The two...
2
2292
by: John Mullin | last post by:
We are having a problem which appears similar to a previous posting: http://groups.google.com/groups?hl=en&lr=&frame=right&th=d97f552e10f8c94c&seekm=OZw33z9EDHA.2312%40TK2MSFTNGP10.phx.gbl#link1 In the current release of our system, we decided to "wrap" the ASP.NET Session and Application objects to improve code clarity and accuracy. For example, instead of: Session = new SomeListClass;
5
2084
by: Just D. | last post by:
Do we have any access to the Session object from a different Session? The idea is to save Session of a current user and then if he logs in again then return the Session back. It's not a problem to store, there is only one complicated object in this Session, but to get it on SessionStart to make a copy this is a problem. Maybe using Application or whatever? Or this data is divided and inaccessible anyway? Just D.
43
3433
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
0
9405
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10013
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7383
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5280
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.