You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dave <ja...@yahoo.com> on 2007/12/19 03:09:46 UTC
tomcat session security hole
Hi, I am using URL rewriting for session tracking, ie, session id is on the URL. After I login into a web application, if someone else knows my current session id, he/she can access my account using the session id. It is ok because it is difficult for others to guess my session id. But right now I encounter an issue that will breach the security.
Our web application is using a 3rd party payment system, when a user clicks pay button, we need to tell the payment system a return URL, a page URL to go after a user finishes with the payment system. The return url needs to have the user's session id so that he/she will not need to login again after returning from the payment system. In this case, the 3rd payment system will know the user's session id, a security hole.
Is there a solution for this scenario? the same security hole for cookie based session tracking? In our case, we have to use URL rewriting because sometimes a new session is needed when users click some links on pages.
In my opinion, session id is not sufficient to identify a session, it should have client's ip address for more security.
Thanks for any ideas.
Dave
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
RE: tomcat session security hole
Posted by Peter Crowther <Pe...@melandra.com>.
> From: Dave [mailto:javaone9@yahoo.com]
> Hi, I am using URL rewriting for session tracking, ie,
> session id is on the URL. After I login into a web
> application, if someone else knows my current session id,
> he/she can access my account using the session id. It is ok
> because it is difficult for others to guess my session id.
... although they can eavesdrop on it with a network sniffer. If you don't want third parties to be able to sniff your session information, either from the URL or from the cookies in the headers, then encrypt all traffic between client and server. In other words, implement SSL.
> But right now I encounter an issue that will breach the security.
>
> Our web application is using a 3rd party payment system,
> when a user clicks pay button, we need to tell the payment
> system a return URL, a page URL to go after a user finishes
> with the payment system. The return url needs to have the
> user's session id so that he/she will not need to login again
> after returning from the payment system. In this case, the
> 3rd payment system will know the user's session id, a security hole.
>
> Is there a solution for this scenario?
Use cookies.
> the same security
> hole for cookie based session tracking?
No. With cookie-based sessions, the cookie is known by the client and the server, but not sent to the third party, and so it remains unknown by them.
As a side note, if the same user can have multiple sessions, you need to think about which session you bounce the user back to from the third-party site - the third-party site will have to have some form of session ID passed to it at this point, though you might be able to get away with a fragment rather than the entire ID. The way to fix this problem is to have one session per user.
> In our case, we have
> to use URL rewriting because sometimes a new session is
> needed when users click some links on pages.
Patching a broken design: You could possibly force new sessions when the user clicks on those links, but use cookies at other times. There was a discussion about how to do this a couple of months ago on the list. However, this still isn't secure, as session IDs get appended to some URLs; those URLs can accidentally be bookmarked or emailed, for example.
Alternatively, fix the design: What feature of your user experience requires a new session at this point, why, and how can you remove that requirement?
> In my opinion, session id is not sufficient to identify a
> session, it should have client's ip address for more security.
Proxies can break that really thoroughly - AOL's proxy clusters are notorious for this.
Sessions should be identified by a shared secret. Shared solely between the user agent and the application server, and secret by being encrypted. Cookies over SSL meet the "shared secret" test. I hate to say it, but if you're concerned about security then you should redesign your application until it has a single session and can therefore use cookies over SSL for sessions. Why do you need multiple sessions?
- Peter
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat session security hole
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dave,
Dave wrote:
> Is there a solution for this scenario? the same security hole for
> cookie based session tracking? In our case, we have to use URL
> rewriting because sometimes a new session is needed when users click
> some links on pages.
>
> In my opinion, session id is not sufficient to identify a session, it
> should have client's ip address for more security.
Tomcat's built-in authentication and authorization do not support what
you describe, but you could extend those classes and customize them to
meet your needs.
Securityfilter (http://securityfilter.sourceforge.net) is another
option, and that particular feature is in the pipeline but not yet
available. Again, self-customization is an option, there, too.
Don't forget that forcing IP checking might not work for some customers
who go through proxies that play games with the user's IP address (AOL
used to do this... not sure if they still do).
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHaKGr9CaO5/Lv0PARAiHaAJ4kO4PTbnlq0MtTZct/2/agTbJVvACcCJ6/
8HWD+1ge1wMQ3AZjBFxp71E=
=dOR3
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: tomcat session security hole
Posted by Dave <ja...@yahoo.com>.
Hi Martin,
Thanks for your help.
I looked at the two links you provided. But I do not understand how they can solve the problem. I must be missing something.
For SSL, the URL still needs to have session id, for example,
https://www.xyz.com/returnPage.jsp;jsessionid=188727usdfkjaf-92098js8980?name='Foo'
For session id encription that is one-way encription appending a digest code to the URL, the URL also needs to have session id so that Tomcat will know the session id of the requests.
https://www.xyz.com/returnPage.jsp;jsessionid=188727usdfkjaf-92098js8980?name='Foo'&digest='abc123'
Please give me further help. Thanks,
Dave
Martin Gainty <mg...@hotmail.com> wrote:
Hi Dave
http://www.securityfocus.com/infocus/1774
suggests either implementing with
SSL connector
http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html
-or-
Encrypt each sessionid
If you dont have the former you'll definitely want to implement the latter..
heres an example
http://www.spiration.co.uk/post/1199
Martin--
----- Original Message -----
From: "Dave"
To: "Tomcat Users List"
Sent: Tuesday, December 18, 2007 9:09 PM
Subject: tomcat session security hole
> Hi, I am using URL rewriting for session tracking, ie, session id is on
the URL. After I login into a web application, if someone else knows my
current session id, he/she can access my account using the session id. It is
ok because it is difficult for others to guess my session id. But right now
I encounter an issue that will breach the security.
>
> Our web application is using a 3rd party payment system, when a user
clicks pay button, we need to tell the payment system a return URL, a page
URL to go after a user finishes with the payment system. The return url
needs to have the user's session id so that he/she will not need to login
again after returning from the payment system. In this case, the 3rd payment
system will know the user's session id, a security hole.
>
> Is there a solution for this scenario? the same security hole for cookie
based session tracking? In our case, we have to use URL rewriting because
sometimes a new session is needed when users click some links on pages.
>
> In my opinion, session id is not sufficient to identify a session, it
should have client's ip address for more security.
>
> Thanks for any ideas.
> Dave
>
>
>
>
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
Search.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------
Never miss a thing. Make Yahoo your homepage.
Re: tomcat session security hole
Posted by Martin Gainty <mg...@hotmail.com>.
Hi Dave
http://www.securityfocus.com/infocus/1774
suggests either implementing with
SSL connector
http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html
-or-
Encrypt each sessionid
If you dont have the former you'll definitely want to implement the latter..
heres an example
http://www.spiration.co.uk/post/1199
Martin--
----- Original Message -----
From: "Dave" <ja...@yahoo.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Tuesday, December 18, 2007 9:09 PM
Subject: tomcat session security hole
> Hi, I am using URL rewriting for session tracking, ie, session id is on
the URL. After I login into a web application, if someone else knows my
current session id, he/she can access my account using the session id. It is
ok because it is difficult for others to guess my session id. But right now
I encounter an issue that will breach the security.
>
> Our web application is using a 3rd party payment system, when a user
clicks pay button, we need to tell the payment system a return URL, a page
URL to go after a user finishes with the payment system. The return url
needs to have the user's session id so that he/she will not need to login
again after returning from the payment system. In this case, the 3rd payment
system will know the user's session id, a security hole.
>
> Is there a solution for this scenario? the same security hole for cookie
based session tracking? In our case, we have to use URL rewriting because
sometimes a new session is needed when users click some links on pages.
>
> In my opinion, session id is not sufficient to identify a session, it
should have client's ip address for more security.
>
> Thanks for any ideas.
> Dave
>
>
>
>
>
>
> ---------------------------------
> Looking for last minute shopping deals? Find them fast with Yahoo!
Search.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org