WebApp Sec mailing list archives
Re: Controlling access to pdf/doc files
From: "lists AT dawes DOT za DOT net" <"lists AT dawes DOT za DOT net"@securityfocus.com>
Date: Wed, 25 Feb 2004 09:07:23 +0100
Do not allow direct access to the file itself. Create the file dynamically, or read it from a location outside the web root, via a servlet/app that checks the validity of the session.
It is not difficult to supply headers to indicate the content-disposition, which tells the browser to try to save the file, and can even provide a useful file name, rather than the name of the servlet.
Rogan Sangita Pakala wrote:
Hi, Could I have the list's thoughts on an answer we are preparing for the next version of the AppSec FAQ at OWASP.Question - How can I ensure my application allows only authenticatedusers access to files like *.pdf or *.doc? Issue - Suppose a web site, say a bank site, displays the user's account statement as a .doc file. What if someone tries to access this file by typing its full URL into the address bar? How does the application check whether the user trying to access the file is the authenticated user andthat the session has not expired?Solution - One solution is to have a random number for the name of the file or the folder containing it. This random number could even be related to the session token of the user. This file/folder should then be deleted as soon as the user's session has expired. Are there better methods available to address this issue? Can the web server run a server side program to verify the session token beforeserving the final GET request for the file?Thanks, Sangita. OWASP AppSec FAQ http://www.owasp.org/documentation/appsecfaq Paladion Networks http://www.paladion.net
-- "Using encryption on the Internet is the equivalent of arranging an armored car to deliver credit card information from someone living in a cardboard box to someone living on a park bench." - Gene Spafford
Current thread:
- Controlling access to pdf/doc files Sangita Pakala (Feb 24)
- Re: Controlling access to pdf/doc files Blasted (Feb 24)
- Re: Controlling access to pdf/doc files Suresh Prabhu (Feb 26)
- Re: Controlling access to pdf/doc files chasd (Feb 26)
- Re: Controlling access to pdf/doc files lists AT dawes DOT za DOT net (Feb 26)
- RE: Controlling access to pdf/doc files Paulus Widodo (Feb 26)
- <Possible follow-ups>
- Re: Controlling access to pdf/doc files Jed Holler (Feb 25)
- RE: Controlling access to pdf/doc files Scovetta, Michael V (Feb 25)
- RE: Controlling access to pdf/doc files GRIFFITHS ian (Feb 25)
- RE: Controlling access to pdf/doc files Alistair Meikle (Feb 26)
- Re: Controlling access to pdf/doc files Mark Curphey (Feb 26)
- RE: Controlling access to pdf/doc files Sangita Pakala (Feb 28)
- Re: Controlling access to pdf/doc files David Cameron (Feb 28)
- Re: Controlling access to pdf/doc files (db "better" than filesystem?) David Wall @ Yozons, Inc. (Feb 28)
- Re: Controlling access to pdf/doc files (db "better" than filesystem?) Ido Rosen (Feb 28)
- RE: Controlling access to pdf/doc files Sangita Pakala (Feb 28)