Grade. At first glance, this is not a direct risk, because you are not using code, just compiling it. However, there is nothing to suggest that the C # compiler does not contain any error that, given the correct malicious input, will cause it to escape and start executing commands directly.
However, if you later run the compiled code (and, presumably, you will do it - otherwise, why would you compile it for a start?), It will work in the same context as you. Obviously, this has all sorts of unpleasant security implications, similar to using the quasi-similar function eval() for other languages.
John feminella
source share