Search code examples
securitylocalhostipcinterprocess

Can TCP Inter-Process-Communication become a vulnerability?


I have an IPC structure where the client would send the server process a 'shell like' (not actually executed in the shell) command, such as:

get-info 1d8fec4b-c096-4ee6-b2d7-21eb1661212f

and the server process would respond with another string:

Lemon|San Francisco

The whole thing is supposed to only be available on 127.0.0.1, but I was wondering if this could present any vulnerabilities.


Solution

  • Oh, you mean like: if you are using a relational DB you need to deal with SQL injection? Well, I don't know any IPC related vulnerabilities that could be named like that. I believe there is some deeper thinking involved before one can say whether a development decision like this can turn out to be a vulnerability or not.

    I would go about it this way:

    According to definition vulnerability is inability to withstand the effects of a hostile environment.

    1. So, is your environment hostile? Do you process requests from other users or only from other systems/processes you trust. Can someone you don't trust spawn a process and connect to your process? Do the payloads your process process contain user queries or user provided data?

    If the environment may be hostile, then we need to dig deeper and ask some questions about whether an attacker may disrupt the Confidentiality, Integrity or Accessibility of the system or the systems data.

    1. Confidentiality - can the attacker have access to data he is not authorized to? What kind of data do you process? PII? Sensitive information? Public data? Do you authenticate and authorize the requests being made? Is it necessary to?

    2. Integrity - can a attacker change the data he is not authorized to? How do you validate the requests being made? Is it possible to the user to inject something in the query? Do you have logs who did what, when and with what result?

    3. Accessibility - can the attacker stop/disrupt the process? Will the process restart once stopped? How about DOS attacks? How many requests per second can the process handle? Are we able to enforce some thresholds how many requests are processed and reject requests that go over it?

    The whole thinking chain goes deeper than this. But try to answer some of the questions above to see where you stand and we can still dig deeper if needed.