At the end of the day you get to a point in web application security
where encryption doesn't become worth it. You can only prevent people
from getting in through the untrusted pathways, at some point you
require a trusted pathway. If something compromises a trusted pathway
then regardless of what you've got you will eventually be compromised.
Of course you can put layers in the way however if your PHP is going
to be accessing this data back then any other PHP script that gets
onto your server will have access to that.
There are models around that, for example where I work we have "API
servers" for different systems that server a dual purpose: the simple
is that they're a level of abstraction between items so we can easily
update the behind the scenes code and they also serve a security
functionality. They have very limited services running on them, the
code that runs there is more highly verified and has a limited API to
ensure stuff that shouldn't get in doesn't and they implement
security. Depending on what you're doing you can shuffle off details
there and not provide a way of obtaining them back presuming your
security model works that way. Just the other day I spec'd out a new
system that we mediate communication with Google Apps' Web Services.
This means that if one of the publicly accessible machines are
compromised we don't immediately lose the credentials to get access to
those systems. They're also protected strongly in a network
perspective as well so a simple PHP vulnerability where they can dump
files onto the web accessible server won't cause a loss of those
credentials (of course that doesn't mean they can't impersonate the
service and obtain a high level of information, it does however limit
their ability to cause damage plus the service credentials remain
secret which since Google Apps is externally accessible by definition
is a good thing). The environment I'm in has a reasonably high level
of security thinking with around 10 different firewalled zones for
different services and restrictions on how they behave - perhaps the
middle of the road for a secure environment.
So at the end of the day, you can go overboard and perhaps you've got
an environment that works in. Realistically however the average
Joomla! site doesn't have that level of security and storing a plain
text copy in your component params is no more insecure than most other
alternatives (hint: encryption works with a key, you need to store
your key where PHP can get to it, that means any PHP script can get to
the key and the secured details).
Sam Moffatt
http://pasamio.id.au