That is a chilling thought, but the WikiLeaks showed that the CIA can make a cyber attack look like it was done by a foreign entity when done by them.
That’s just because the CIA leverages malware that was originally coded by Russian programmers. This is how strains of malware propagate.
The different variants usually start off from existing strains and then modified to enhance it or plug holes, you can even buy ready made malware on the open market today.