The United States insists it attacked Iran to curb "direct threats" from the Islamic republic, but legal experts say the dangers cited by Washington do not justify war under international law.