Hello Atli, Kovik,
I may actually have a situation where using mysql blobs is preferrable to filesystem for unsearchable binary data.
We have been using filesystem to store photos and various formats of videos, but now are looking into mysql for mail attachments.
The three reasons we consider mysql now are these (control and security):
1. Whereas the web-accessible photos and videos are post-formated versions (converted to new dimensions and renamed), thus any exploit code from uploads is removed and can not be activated by access through direct url.
2. Mail attachments are in all formats and not sanitized like photos and videos, thus creating an increased possibility of 0-day exploit code being uploaded that will be accessible by web url, if filesystem is used.
3. Mail attachments may require additional security of not being accessible through web urls by anyone other than the attachment owner (at least long term when session key has expired). And though we use sha512+filedate +salt for photos/videos urls, filesystem storage would still leave the weakness of files being always accessible in future by everyone once the constant file url is known whereas mysql storage can be done through a php file requiring log in.
"Solution" would have been to store the mail attachments in directories that are not web accessible, e.g. /home/securefiles/topsecret.pdf and include the file through php script, but this creates the problem of how to include the file from remote servers - creating the vulnerability of permanent remote urls again.
Whereas mysql database provides a central authentication and security mechanism that can be accessed from remote servers and is not publicly web-accessible.
If you can think of a filesystem storage alternative that provides the security and authentication mechanisms of mysql storage in a multi-server environment with web-accessible urls, let me know, otherwise this is a situation where mysql storage is preferable to filesystem storage.
I may actually have a situation where using mysql blobs is preferrable to filesystem for unsearchable binary data.
We have been using filesystem to store photos and various formats of videos, but now are looking into mysql for mail attachments.
The three reasons we consider mysql now are these (control and security):
1. Whereas the web-accessible photos and videos are post-formated versions (converted to new dimensions and renamed), thus any exploit code from uploads is removed and can not be activated by access through direct url.
2. Mail attachments are in all formats and not sanitized like photos and videos, thus creating an increased possibility of 0-day exploit code being uploaded that will be accessible by web url, if filesystem is used.
3. Mail attachments may require additional security of not being accessible through web urls by anyone other than the attachment owner (at least long term when session key has expired). And though we use sha512+filedate +salt for photos/videos urls, filesystem storage would still leave the weakness of files being always accessible in future by everyone once the constant file url is known whereas mysql storage can be done through a php file requiring log in.
"Solution" would have been to store the mail attachments in directories that are not web accessible, e.g. /home/securefiles/topsecret.pdf and include the file through php script, but this creates the problem of how to include the file from remote servers - creating the vulnerability of permanent remote urls again.
Whereas mysql database provides a central authentication and security mechanism that can be accessed from remote servers and is not publicly web-accessible.
If you can think of a filesystem storage alternative that provides the security and authentication mechanisms of mysql storage in a multi-server environment with web-accessible urls, let me know, otherwise this is a situation where mysql storage is preferable to filesystem storage.
Comment