A non-technical analogy might be a good place to start…
Imagine a situation where someone tells you that it is going to rain tomorrow. Should you trust that statement? Questions you might ask yourself are:
• Who is telling me this information?
• Do I trust this person to have accurate data and repeat it accurately to me?
It is easy to imagine ways to answer the first question. You may personally know the speaker, check their ID, have a friend vouch for them, etc… But the second question is trickier. Source credibility has as much to do with the person receiving the data as the person transmitting it. While some people tend to be viewed as more credible than others, nobody is viewed as always credible by everyone. The second question gets even more complex when you start wondering where this person obtained their information. Did they get in a plane and view the weather patterns for themselves? If they got the information from a source, you must now make assumptions about how trustworthy that source is. Generally, determining whether you trust a person is a complex process.
Code signing answers the first question. When you load an add-in, Revit can look at the signature and tell you who wrote that code. Assuming that the author's private key hasn't been compromised and that the CA did their job properly, that is an accurate statement. But we can't know if you trust that person/organization or how much you trust them.
There is a famous case of Adobe's code signing key being used by attackers to sign malware. Adobe had incredible security on their private key, keeping it in an HSM. But the attacker was able to infiltrate their infrastructure, get their malware signed, and then distribute the signed malware. If a user had previously checked "always trust from this publisher" during an Adobe installation, the malware would have been installed silently. Users who didn't check that box would have gotten the trust this publisher dialog, and given a chance to wonder why "Adobe" (actually malware) was installing something on their computer.
Clearly the Adobe case is extreme, but I think it helps illustrate the point that determining the trustworthiness of the code signer is not something that can be done programmatically. There is no algorithm for trustworthiness that doesn't involve the user's personal viewpoint (eg: perhaps a government worker trusts things signed by the government while a private citizen may choose to be more circumspect of their government). So we're left prompting you, asking for your opinion on trust.
Ensuring that only trustworthy certs are in the Trusted Publishers cert store is a problem that Windows and users manage outside of Revit. The only way to get a bad cert there is to have malware run on the computer under the current user or for the user to download a cert and install it. At that point, the best option is to consider the computer compromised and to wipe and reinstall the OS (AKA: nuke it from orbit). The trust store is the definitive source of trustworthiness for Revit, and for Windows in general.
A similar situation arises in browsers. They have a cert store that tells them whether to trust a CA for signing SSL/TLS certificates. A default set of certs comes with the browser, and users can modify that set. But the browser always trusts the cert store. The infamous Lenovo-Superfish scandal occurred because Lenovo was adding untrustworthy certs to the cert stores on computers that it sold.
Neil Smithline
Revit Software Security Architect