Re: cannot access the sqlite db
Greg Milby wrote:
> maybe i should just put the code AND db below webroot and map to it.
In general the only content you should have below the webroot is static
files with everything marked as read-only.
Scripts and similar are most convenient below the webroot but you need to be
very careful to ensure there is no private information in them. For example
it is common with php to have the configuration info in a php file (eg
database server, username and password). If the web server is misconfigured
in any way then it can end up displaying the contents of the file rather
than executing it.
Having the database below the webroot has the same problem. It is even more
likely that it can be served up as is, which could be a very bad thing
depending on the contents. It also requires that the web user be able to
write below the webroot, which means that a successful attacker will have
full control over what the web server sends out.
It is most convenient to have everything below the webroot since it will
make setting permissions easiest, but this is by far the easiest for hackers
to break, and gives them the best results for damage inflicted.
I'd suggest you do a search for all the web based attacks over the last 10
years to see what kind of attack vectors are used, various solutions, best
practises etc so you'll have an understanding of what the battlefield looks
like.
Remember that anyone can design and implement something they cannot break
themselves. Many think that is sufficient. I would however recommend
getting an external party to provide a security review.
Roger