Can. 1388 §1. A confessor who directly violates the sacramental seal incurs a latae sententiae excommunication reserved to the Apostolic See; one who does so only indirectly is to be punished according to the gravity of the delict.
§2. An interpreter and the others mentioned in ⇒ can. 983, §2 who violate the secret are to be punished with a just penalty, not excluding excommunication.