CensorDodge icon indicating copy to clipboard operation
CensorDodge copied to clipboard

Cookies might be shared between several users

Open mossroy opened this issue 5 years ago • 2 comments

The cookies are currently stored in a directory based on REMOTE_ADDR or HTTP_X_FORWARDED_FOR HTTP headers. It's unsafe for several reasons :

  • a malicious user could manually set a HTTP_X_FORWARDED_FOR header in its requests, to be able to use the cookies of another user
  • if CensorDodge is used through some proxy server (which is common in some companies), the HTTP_X_FORWARDED_FOR header might not be set. So all users behind this proxy would share the same cookies (because the requests all come from the same REMOTE_ADDR)

If it's technically not possible to store all cookies on the client side, they should be stored in a unique location for each user. One way to do that would be to identify the user through a client side cookie (set by CensorDodge), and use this id to create the cookieDIR

mossroy avatar May 15 '21 10:05 mossroy

Hi Mossroy, Thank you so much for your feedback. I totally agree with you on this. To give you a little background, I wrote most of this project for fun while at school 5-6 years ago, because the existing proxy scripts at the time either didn't work or weren’t open source. At the time, I didn’t even intend to release it, but I mostly look at Censor Dodge as a base ground for more additional features and extra work.

Censor Dodge has a lot of fundamentals that could make it really useful for a long time to come, and it would awesome to collaborate with other developers on the project. If you wish to write these kinds of changes to the core of the script, I will happily merge them in, the same goes for anyone else.

Thanks, Ryan

ryanmab avatar May 15 '21 17:05 ryanmab

Thanks @ryanmab I created some PRs for things I had to implement, but I will probably not work on this one. As I'm currently the only user of the instance I deploy, this security risk does not exist for me ;-) And PHP is not the language I'm most familiar with...

In any case, many thanks for this useful tool!

mossroy avatar May 17 '21 10:05 mossroy