Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Security issue, right useless  (Read 8179 times)

0 Members and 1 Guest are viewing this topic.

crypto

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Security issue, right useless
« on: December 09, 2005, 02:32:19 pm »

Hi.
When i upload my jpg to the server, i send it into a dir but this dir must have read access for everyone. So if somebody finds this dir (ie www.site.com/cpg142/albums/album_name/) he can browse the album without any login.
If sb wants to send a link to only one photo (www.site.com/cpg142/albums/album_name/01.jpg), he will send a link to the whole album without guessing (you just have to remove filename).
The dir with photo should be protected by .htaccess (Deny from all) and the jpg should be read by a php script that checks session and returns the photo. Not a direct acces to the file.

Thx.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Security issue, right useless
« Reply #1 on: December 09, 2005, 04:04:52 pm »

This is not a security issue.  If a person figures out how to directly access the image there is no security vulnerability.

htaccess doesn't work for IIS, so your solution doesn't work for all users of Coppermine, only Apache users.  Work is being done for a future version that does a better job of hiding images from direct access.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

crypto

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Security issue, right useless
« Reply #2 on: December 09, 2005, 06:15:07 pm »

I dont really know IIS but i think it provides a similar way to prevent access.
I think it's a problem because an user can think that photos are password protected and it's not the case.

I'm triing to prevent direct acces by using url-rewriting and a file that checks "rights" (until the future version ...)
I am looking for the piece of code that checks rights...
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Security issue, right useless
« Reply #3 on: December 09, 2005, 07:28:05 pm »

Serving images via a script is not a simple piece of code - it involves a lot of work.  I know, because I've been working on it.  The system must work for all file types, and not just images.  Coppermine does a lot more than show pictures.  Any such system must work with every type that Coppermine handles and work on every type of webserver.

I'm not working on any type of url rewriting.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

amirw2k

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 37
Re: Security issue, right useless
« Reply #4 on: December 10, 2005, 02:51:41 am »

This thing is a general security issue and should be protected in the settings of the server.

However, there's a simple solution for this. Put an empty file in the directory called index.html. This prevents browsing the directory.
Basically it can be implemented into coppermine, but I think it's best to solve this by setting the server correctly.

By the way, wouldn't this script you're talking about overload the server? This script can deliver more "security" issues because you can use it to mass-download the entire gallery by changing the id of the picture.

Amir W.
Logged

crypto

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Security issue, right useless
« Reply #5 on: December 10, 2005, 09:40:47 pm »

This thing is a general security issue and should be protected in the settings of the server.

However, there's a simple solution for this. Put an empty file in the directory called index.html. This prevents browsing the directory.
Basically it can be implemented into coppermine, but I think it's best to solve this by setting the server correctly.

By the way, wouldn't this script you're talking about overload the server? This script can deliver more "security" issues because you can use it to mass-download the entire gallery by changing the id of the picture.

Amir W.
the problem is not only directory listening...
Preventing acces just by thinking that users can't guess file name sucks! It's not security, it's just a fucking hazard game.
Almost everybody uses guessables filenames.

When you browse an album, the img urls will stay in your historic and anywhere else... The next user can see img without login and with the actual version there is no way to protect img from it. This is why direct acces should be avoided.
Moreover I don't see the problem with mass-download, an user who wants to download an album dont need any other script, you can make a small app that browse an coppermine album. This is not a security issue.


Url-Rewriting is not needed but it's juste easyier for me... (Otherwise I ll have to modify coppermine code)
Logged

ulikoeln

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Security issue, right useless
« Reply #6 on: December 13, 2005, 12:50:32 pm »

If an Image can be requested directly, this is not a security issue -
I think you are mixing up "security" with image protection.The latter is a design
deceision, and it depends on what the gallery owners want.

If somebody would code the "perfect" delivery script, this would mean that
for every single image you would have to check permissions of the user or group
to that specific image, then the permissions to one of the real or virtual galleries
 it is located in, then you could also do checks for download quota, do some
IP or UserAgent checks to ban (or allow) image search engines and so on and so on.

If all this would become part of CM, then we all need to order new database servers right now. And
big ones.  For me, it is perfectly OK to deliver images directly, not via delivery script.
Other users may have different requirements - so the really perfect delivery
method would be configurable (direct delivery for performance saving, protected
delivery for those with specific copyright paranoia.) IMHO, this should not
get high priority - after all, we are talking about a web gallery tool mostly for
public use and not for commercial image collections.

Regards,
Ulrich

Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: Security issue, right useless
« Reply #7 on: December 15, 2005, 04:43:04 am »

if someone wants your images, they are going to get them. If they are readable by your apache default user and served by http, they can be requested and stored elsewhere, including if they are not in your document root.

you can scrape almost any site with winhttrack; for every measure that comes out to protect images, another comes out to circumvent it.

The only way to truely protect images is over SSL using Webserver authentication. (ie: default http user doesn't have filesystem rights to read the images)

then you have to beat and flog your users.... because they'll give out the passwords... and your back to square one.
Logged

janus

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
    • www.u-janusa.com
Re: Security issue, right useless
« Reply #8 on: December 26, 2005, 11:02:16 pm »

I have tested it with a .htacces file.

It works, but I've got a question.

Now all users must use thier logins second times - at first for the CM itself, and then to view a file.

Is it possible to switch the htaccess protection off, if you already have been logged in the CM?
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 20 queries.