I am not certain if the Rosenbergs were technically executed for treason or not.
They were not charged with treason because of its high Constitutional requirement. They were executed for espionage.
Obama or his people, and maybe Bush or his people, might be charged with espionage for sharing classified material with Muslim radicals.
There are plenty of other charges that could lock people up indefinitely. A precedent was set with the Pollard case. Sharing classified info can get a life sentence even if the recipient is not an enemy.