Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue 43 in gaeutilities: Session poisoning when using datastore writer
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
codesite-nore...@google.com  
View profile  
 More options Jun 11 2010, 3:07 am
From: codesite-nore...@google.com
Date: Fri, 11 Jun 2010 07:07:54 +0000
Local: Fri, Jun 11 2010 3:07 am
Subject: Issue 43 in gaeutilities: Session poisoning when using datastore writer
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 43 by stanislaw.skonieczny: Session poisoning when using  
datastore writer
http://code.google.com/p/gaeutilities/issues/detail?id=43

Session poisoning is quite easy when using gaeutilities 1.3 (the same  
problem is with 1.4) with standard configuration.

Following steps should reproduce the problem:

1. Create new appengine project, install gaeutilities v. 1.3, use standard  
configuration (datastore writer).
2. Copy attached file "bug.py" to your project. It simply shows the session  
content. Also add handler for this file in app.yaml:
- url: /bug
   script: bug.py
4. Visit "/bug". Your session is empty, but cookie  
named "gaeutilities_session_data" has been created.
3. Edit this cookie on the client side, changing it's value to: "{\"key\":  
7}" (with all of double quotes).
4. Visit "/bug" again. Your session is now {'key': 7}.

Expected output of this script should be:
Session is: {}
Key is: ''

Instead, it is:
Session is: {"key" = "7"}
Key is: 7

I am using version 1.3, but the same issue is with 1.4. Session poisoning  
work both on the development server and appengine server.

After some investigation of the code, I have found the following in  
sessions.py, lines 548-559:

         try:
             self.cookie_vals = \
                 simplejson.loads(self.cookie["%s_data" %  
(self.cookie_name)].value)
                 # sync self.cache and self.cookie_vals which will make those
                 # values available for all gets immediately.
             for k in self.cookie_vals:
                 self.cache[k] = self.cookie_vals[k]
                 # sync the input cookie with the output cookie
                 self.output_cookie["%s_data" % (self.cookie_name)] = \
                     self.cookie["%s_data" % (self.cookie_name)]
         except:
             self.cookie_vals = {}

Commenting it out and adding one line instead:
         self.cookie_vals = {}
solves the problem, but I do not know, if it breaks some other  
functionality (cookie writer?).

Attachments:
        bug.py  615 bytes


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »