The Torah (Shemot 22, 27) states: “You shall not curse a judge.” Although the Torah uses the word “Elohim” in this verse which is usually a reference to Hashem, Unkelos as well as the Gemara (Sanhedrin 66a) interpret the usage of this word in the context of this verse as referring to a judge.
The Torah likewise states (Vayikra 19, 14) states: “You shall not curse a deaf man.” Our Sages expounded that there is indeed a Torah prohibition to curse any Jew and the reason why the Torah singled out a deaf individual is to teach us that although the deaf man cannot hear and is not upset as a result of others cursing him, it is likewise forbidden to curse him. It is therefore forbidden to curse any Jew, even if the recipient of the curse cannot hear him, for instance, if he is sleeping and the like, for he is no worse than a deaf man who cannot hear at all. One may certainly not curse another Jew directly to his face when he is awake, for besides for the prohibition regarding the actual cursing, this also involves another prohibition of verbally hurting someone else as a result of hearing the curse.
The Rambam, Tur, and Maran Ha’Shulchan Aruch quote the above as Halacha. As such, one must be extremely careful not to curse a fellow Jew. Even if one curses himself, one transgresses this sin, as the verse states, “Take care and guard yourself very much.” One who curses a judge transgresses two prohibitions: Firstly, the prohibition to curse any Jew and secondly, the prohibition to curse a judge.
Indeed, the Gemara (Sanhedrin 48a) tells us that all of the curses that King David bestowed upon his nephew, Yoav ben Tzeruya, eventually befell David’s own descendants. The Sefer Chassidim derives from here that although one’s curse is not for naught, for David’s curses to Yoav were certainly well-deserved, nevertheless, the curse will return to the one who uttered it. This is certainly when one utters an undeserved curse and it will surely backfire onto the one who uttered it. Our Sages tell us (Megillah 15a): “One should never take the curse of a simpleton lightly, for Avimelech cursed our matriarch, Sarah, and the curse ended up befalling her descendants.” Although we see many people uttering curses and nothing happens as a result, nevertheless, the Peleh Yo’etz writes that one may strike an auspicious hour and the curse may be fulfilled; the one who uttered the curse will certainly be held accountable.
Although we find that great sages may have cursed someone and their curse was indeed fulfilled, this is because there are situations when one is no longer considered a part of the Jewish nation and it becomes permissible to curse him, such as if one is a heretic intentionally. However, as we have established, it is absolutely forbidden to curse a proper Jew.