There have been many exploits for Source/TF2 over the years, see the big rewards over at HackerOne for some of those. This one, this one and this one are quite scary (and got big rewards).
I advise you to not play on public servers until more is known about the RCE exploit. Play on password protected servers and use a decent sv_password so no randoms can join your server, just in case there's really an exploit that can be triggered by any player for any other player on the server.
In general, don't connect to servers hosted by people you don't trust, or RCON-ed by people you don't trust. Because of TF2's server-client model, as far as I know, all the exploits have been from client to server, or from server to client. So a client could crash or RCE a server, or a server could crash or RCE a client. That doesn't mean a client-to-client RCE couldn't exist, so use common sense to decide who you play against for now.