http://www.perlmonks.org?node_id=740090


in reply to Good IPC Message Protocols?

I'd like to assume that my non-privileged client has been completely hacked, so I want to make it as hard as possible for the baddies to crack open the privileged process. I want to pretend bad guys can send anything at all down the socket at my privileged process.

If the client has been completely hacked, what is to stop the bad person simply finding and copying whatever obfustication you are implementing ?

As far as the framing of each message is concerned, I would:

if the CRC passes, it's likely your message is intact, and you can unpack it. In the unlikely event of a CRC failure... I'd log it and close the connection. If you wanted to get fancy, you could have an error message type, and send one before closing...

I guess you have some sort of password authentication when the client connection is established ? What I would do is as follows:

If the client is so completely hacked that a bad person can find the current SEED while a session is in progress... then you have a very serious problem. You could limit the damage by requiring periodic re-authentication -- which requires the password, which one assumes the bad person doesn't know. Beyond that... I don't know -- it looks like an almost impossible requirement (and I guess that requiring the password for every transaction would be ineffably tedious.)

Replies are listed 'Best First'.
Re^2: Good IPC Message Protocols?
by sundialsvc4 (Abbot) on Jan 31, 2009 at 17:07 UTC

    Although this is worthy advice, soundly presented ... nothing whatsoever at all to disagree with here ... the overwhelming thought for me is:  this has got to be something that has been done before. Secure IPC transport mechanisms already exist. As time passes, I find myself more and more reluctant to “implement” anything new if I can possibly, possibly avoid it.

    Vacuum CPAN first. Always.