Would it be illegal to upload the source code of a computer virus I developed?
<p>If I upload source code of a virus I have developed so that the larger software community could benefit from developing solutions to tackle the virus, and if somebody else uses my source code to harm other people, am I liable?</p>

<p>Your liability would be analogous to your liability for publicizing any other dangerous fact. The source code for numerous viruses has been made public e.g. on Github for exactly this purpose, though the examples which I found were viruses for which there are cures, such as the CIH virus. Publicizing a system weakness that enables a virus to be promulgated, or actually publicizing code that demonstrates the weakness, is similar to publishing <a href="https://scholarship.law.nd.edu/cgi/viewcontent.cgi?article=1289&amp;context=ndjlepp" rel="nofollow noreferrer">bomb-making instructions</a>. First Amendment considerations in the US weigh against any regulations. <a href="https://www.law.cornell.edu/uscode/text/18/2" rel="nofollow noreferrer">Aiding and abetting law</a> requires more than just providing information that can be used in the commission of a crime, but that is a possible avenue for liability (see <a href="http://www.bc.edu/bc_org/avp/cas/comm/free_speech/rice.html" rel="nofollow noreferrer">Rice v. Paladin</a>). In that case, a central issue was whether the publication was communication of ideas, but the final appellate decision was that "The book directly and unmistakably urges concrete violations of the laws against murder and murder for hire and coldly instructs on the commission of these crimes. The Supreme Court has never protected as abstract advocacy speech so explicit in its palpable entreaties to violent crimes". </p>

<p>Unless you wrote that virus yourself and own the copyright, you start with committing copyright infringement. </p>

<p>Your explanation "the larger software community could benefit from developing solutions to tackle the virus" is rubbish. If that was your intention, then you would post a notice that you can make the source code available, and then give it to people who identify themselves and can demonstrate that they are trustworthy. What you are doing makes the source code available to every **** hacker in the world. </p>

<p>So DON'T DO IT. Whether it's legal or not, it is a stupid dick move. Everyone who could ever employ you for legal work will not be impressed one bit by this. Nobody needing to trust their employees will hire you. And especially in the USA, the biggest question is not whether it is legal, but whether someone is going to sue you. Anyone affected by this virus can claim that it happened because you published the code and take you to court, which will cost time and money even if there is no judgement against you. </p>

united-states computer-misuse-act