-
Notifications
You must be signed in to change notification settings - Fork 446
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change web root from application root directory for security #1832
Comments
@kardeiz, all of the PHP code is safe for direct access should someone attempt that -- we define classes in Including an As for a Thanks for the feedback -- if we're able to come up with improvements that are broadly applicable, I'm all ears. Our community's variety of deployment environments is ridiculously diverse, so this can be difficult. |
@asmecher, thanks for the fast response! I admit I hadn't thought about not being able to change the
Here is some information on how Symfony recommends working with shared hosting. And phpScheduleIt/Booked is an application I've worked with that has a public |
I'd worry that with Symfony's approach incautious users would still dump the application into their web root and access it via the |
Couldn't OJS installation script check if |
Perhaps I shouldn't have mentioned the
But there are (by default in OJS 3.0) 818 plain I know that Wordpress and some other projects have a similar model, but it seems like the current consensus is that it is best practice to move as much code as possible outside of the web root. As an infrequent PHP user, the idea that any library/model/config code can be executed on demand (even if it doesn't really do anything), is really strange to me. As noted above, I think re-organizing the codebase (distinguishing between public and private/included PHP files) would be helpful for those who could take advantage of it, and would not be harmful for those who could not. |
@kardeiz, you make a decent point. I'll leave this issue open for some exploration/consideration, but won't likely be able to devote time to it in the near future. We occasionally hold code sprints, and this might be the kind of thing that's suitable for toying with during one of those. |
@asmecher If you want to see, how a symphony based CMS manages this part, take a look at www.contao.org, which changed to a symphony application since version 4. The only caveat: The installation process is not as easy as it was. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I'm a little concerned about the structure of the OJS application (both versions 2 or 3). In standard installations, the base OJS directory is the HTTPD
DocumentRoot
, and any OJS file can be requested by an HTTP client (unless protected from such access, asconfig.inc.php
is).Most major PHP applications that I've seen or worked with handle this by doing one of the following:
./Web
or./public
) theDocumentRoot
, withindex.php
within that folder requesting application code from private folders (e.g.,./app
or./src
) as necessary..htaccess
that prevents HTTPD from reading most PHP files and other special locations.Without digging into it too much, I see a few major issues with how OJS is structured:
config.inc.php
, and that file is protected from access (which is good!), is it really safe to allow access to other PHP files? Is every file guaranteed to be side-effect free (that is, will any code be run when a PHP file is requested that will affect the operation of the system)? Is every file guaranteed to not leak any information? If the code errors out (e.g., due to failed imports or something else), it will probably leak some details about the file's location on the server (or more!).Web
subfolder strategy listed above, and who skim over installation instructions, might put theirfiles
folder in the base directory without realizing that it is web-accessible. I suspect this is why so many people are hit by this issue: http://forum.pkp.sfu.ca/t/security-issue-hacking-via-submission-in-ojs-2-4-8/16382/2.The text was updated successfully, but these errors were encountered: