Which Actions Invalidate The Ghusl?
So, we could say the primary source is ijma.