This question already has an answer here:

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?

marked as duplicate by BlueDogRanch, Nij, Pat W., A.fm., Community Feb 26 '18 at 16:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    You've got some weird tags there - US, and then a UK law. – D M Feb 23 '18 at 21:53
  • @DM Yeah , it's because I wanted to know about laws regarding this for both US and UK. – Aashish Loknath Panigrahi Feb 24 '18 at 3:53

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 bomb-making instructions. First Amendment considerations in the US weigh against any regulations. Aiding and abetting law 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 Rice v. Paladin). 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".


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

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.

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.

  • 1
    This doesn't answer the question at all and is just an opinion... – goulashsoup Jun 11 '18 at 13:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.