Re:PHP is as secure as any other major language
by orf on Friday January 03, 2014 @11:23AM
(#7006207)
It was only a single app, and the database server was pretty much unprotected. As far as I can remember it did most/all of its access controls via JavaScript - it was truly terrible.
Sure there are situations where it is OK, but as a rule of thumb it's not a terribly good idea.
Re:PHP is as secure as any other major language
by einhverfr on Saturday January 04, 2014 @02:27AM
(#7010372)
> As far as I can remember it did most/all of its access controls via JavaScript
Hahahaha. If you are going to use db credentials, for the love of the gods, at least consider using the db to enforce access controls...... That's just common sense, IMNSHO....
In LedgerSMB, for example, we use app login credentials as db credentials for internal users, but for customer/vendor portals, we use a single user account for the portal. There are a lot of reasons for this but PostgreSQL is flexible enough one can (relatively easily) limit most users to the LedgerSMB app if one wants (via pg_hba.conf). The goal however is to allow non-web apps with the same credentials and security enforcement and we already have some of those.
So it isn't necessarily a facepalm. It really depends on context. There can be valid reasons for it but those are not in the context of a public-facing web site. I.e. if you expect users only to access the db through a single app then you don't want to use it but if you want the db to be accessed through a group of apps then using the db as a SSO technology is actually pretty smart.