I am developing a small C# application, that acts as a handler for a certain web-protocol (myprotocol://blafoobar). Thus whenever the user clicks on such a web link, the handler is invoked by Windows. It then parses the URI and performs certain actions.
This of could of course be a security risk. One possible attack vector would be, that an attacker provides a malicious link to the user: "myprotocol://someevilstuff". Then the parsing of the URI would cause my application to expose some unexpected behavior, due to buffer overflows etc. (<- I'm no expert on this).
So I have a bunch of questions:
- Is C# in general more robust against buffer overflows etc. (since e.g. array bounds are always checked)?
- Is the C# string class rather safe (splitting etc.)?
- Is there some general advice what I should look out for/avoid?