This very problem is why I think its so whacked out for Russia to help Iran get the bomb. Do they have half a clue that Iran happily arms terrorists?
They are extremely short-sighted in this regard. They are operating on a long-standing policy, going back to the 50s, to support all challenges to Israel and the US in the Mideast. But as you point out, they are in denial about the blowback they are courting.