The .htaccess file should be updated to disallow access to the database files used by SQLite (*.db3 files).

Change line 6 of .htaccess from
<FilesMatch "\.(engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">

to

<FilesMatch "\.(.*db3|engine|inc|info|install|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">

Comments

dave reid’s picture

There's really nothing to say that I can't create a .sqlite file or .db, so this approach really isn't going to work. For example, the PHP PDO SQLite docs have their example file named 'sq3'.

What we should do is recommend (or validate the db details form) to make sure that the users prefix the filename with '.ht' (ex. '.ht.sqlite') so that the file is hidden no matter it's extension.

See related:
#337993: No install instructions for SQLite
#346494: DB drivers need to be able to change the configure database form during install

wildtang3nt’s picture

Whichever is best then... I just don't want people to be guessing the name of the database and downloading it.

dave reid’s picture

Status: Active » Closed (won't fix)

We now have the SQLite instructions added to core, so I'm marking this as won't fix.

ethomas08’s picture

Issue summary: View changes
StatusFileSize
new1.45 KB

Uploading a patch that my team uses to block a lot of the drupal core files.

ethomas08’s picture

StatusFileSize
new818 bytes

Patch for ghdx.healthdata.org for drupal core 7.92 release

ethomas08’s picture

StatusFileSize
new791 bytes

Patch for healthdata.org for drupal core 7.92 release

ethomas08’s picture

Patch for drupal core 7.103 release