There were quite a few scientists feeding information to the USSR, some under the belief no one nation should have this power. Nuclear weapons weren't that secret.
The USSR was still technically an ally when the first were dropped. It would be interesting if Japan or Germany was in the know (and they also likely were, just musing)