Skip to content
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

Check for .sql files that could be easily publicly-exposed #98

Open
danielbachhuber opened this issue Jan 27, 2017 · 4 comments
Open

Check for .sql files that could be easily publicly-exposed #98

danielbachhuber opened this issue Jan 27, 2017 · 4 comments

Comments

@danielbachhuber
Copy link
Member

For instance, {DB_NAME}.sql in the web root or wp-content directory can be easily guessed.

However, we shouldn't flag SQL files generated by backup plugins and similar that either live in obscured directories (some hash appended) or are protected by .htaccess files.

@Sidsector9
Copy link
Member

@danielbachhuber I want to work on this but I am not that familiar with protecting directories using .htaccess. Can you point me to a resource/example where I can get a fair idea about this?

@danielbachhuber
Copy link
Member Author

I want to work on this but I am not that familiar with protecting directories using .htaccess. Can you point me to a resource/example where I can get a fair idea about this?

See https://stackoverflow.com/questions/9282124/deny-direct-access-to-a-folder-and-file-by-htaccess

But, now that I've shared this, I don't think it's a hard requirement for the pull request. Directories may be blocked in some other way (e.g. Nginx) so it would be impossible to test them all.

@schlessera
Copy link
Member

Would it make sense to add a --probe flag (which might be enabled by default) that tries to access the files through an external request?

@austinginder
Copy link

On unix based systems, one way to solve would be a simple file permission check. If a .sql file is set open 777 (or anything with world permission not set to 0) you can recommend or automatically assigning 600 permissions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants