Secrecy News Blog -There is no law that categorically prohibits all leaks of classified (or unclassified) information. Instead, there is a patchwork of statutes that outlaw some unauthorized disclosures under some circumstances.
The various statutes that have been used to punish leaks of classified
information are surveyed in a new publication from the Congressional
Research Service. See The Law and Leaks to the Press, CRS Legal Sidebar, February 22, 2017.
"Not every leak to the press is a federal crime," CRS notes.
Even when a disclosure is a potential crime, the underlying statutes
are not self-activating or self-enforcing. Investigators and prosecutors
retain considerable discretion about how to proceed.