Mishneh Torah, The Sanhedrin and the Penalties within Their Jurisdiction 26:1משנה תורה, הלכות סנהדרין והעונשין המסורין להם כ״ו:א׳
Anyone who curses one of the judges of Israel transgresses a negative commandment, as Exodus 22:27 states: "Do not curse a judge." Similarly, if a person curses a nasi, whether the head of the Supreme Sanhedrin or a king, he transgresses a negative commandment, as the verse continues: "Do not curse a prince among your nation."This prohibition does not apply only to a judge or a nasi. Instead, anyone who curses any other Jew receives lashes, as Leviticus 19:14 states: "Do not curse a deaf-mute." Why does the verse mention a deaf-mute? To teach you that even when a person who cannot hear and thus will not be bothered by being cursed, the person pronouncing the curse is lashed. It appears to me that a person who curses a child who is embarrassed receives lashes; the child resembles a deaf-mute.
כָּל הַמְקַלֵּל דַּיָּן מִדַּיָּנֵי יִשְׂרָאֵל עוֹבֵר בְּלֹא תַּעֲשֶׂה שֶׁנֶּאֱמַר (שמות כב כז) "אֱלֹהִים לֹא תְקַלֵּל". וְכֵן אִם קִלֵּל הַנָּשִׂיא אֶחָד רֹאשׁ סַנְהֶדְרִי גְּדוֹלָה אוֹ הַמֶּלֶךְ הֲרֵי זֶה עוֹבֵר בְּלֹא תַּעֲשֶׂה שֶׁנֶּאֱמַר (שמות כב כז) "וְנָשִׂיא בְעַמְּךָ לֹא תָאֹר". וְלֹא דַּיָּן וְנָשִׂיא בִּלְבַד אֶלָּא כָּל הַמְקַלֵּל אֶחָד מִיִּשְׂרָאֵל לוֹקֶה שֶׁנֶּאֱמַר (ויקרא יט יד) "לֹא תְקַלֵּל חֵרֵשׁ". וְלָמָּה נֶאֱמַר חֵרֵשׁ שֶׁאֲפִלּוּ זֶה שֶׁהוּא אֵינוֹ שׁוֹמֵעַ וְלֹא נִצְטַעֵר בִּקְלָלָה זוֹ לוֹקֶה עַל קִלְלָתוֹ. וְיֵרָאֶה לִי שֶׁהַמְקַלֵּל אֶת הַקָּטָן הַנִּכְלָם לוֹקֶה (הֲרֵי הוּא כְחֵרֵשׁ):
Shulchan Arukh, Choshen Mishpat 27:1שולחן ערוך, חושן משפט כ״ז:א׳
One who curses an Israelite, and even [if] he curses himself, — by the [Divine] Name or by a substitute, or by one of the names that the heathens call the Holy One, Blessed be He, — if this took place in the presence of witnesses and [was preceded by] warning, he receives lashes on account of [the negative precept] 'Thou shalt not curse the deaf,' and if [the cursed person] was a Judge, he receives additional lashes on account of [the negative precept] 'Thou shalt not curse the Judges.' And [if one cursed by] Arur it is considered a form of curse.
שלא לקלל דיין או שום אחד מישראל. ובו ב סעיפים:המקלל א' מישראל ואפי' מקלל עצמו (טור) בשם או בכנוי או בא' מהשמו' שקורין העכו"ם להקב"ה אם היה בעדי' והתראה לוקה אחת משום לא תקלל חרש ואם היה דיין לוקה עוד אחרת משום אלהים לא תקלל וארור הוי לשון קללה:
Sanhedrin 66a:13סנהדרין ס״ו א:י״ג
If he is neither a judge nor a king, from where is it derived that it is prohibited to curse him? One can say: You derive it through a paradigm arrived at from both of them as follows: The defining characteristic of a king is not like the defining characteristic of a judge, and the defining characteristic of a judge is not like the defining characteristic of a king. The two cases are dissimilar.
אֵינוֹ לֹא דַּיָּין וְלֹא נָשִׂיא, מִנַּיִין? אָמְרַתְּ: הֲרֵי אַתָּה דָּן בִּנְיַן אָב מִשְּׁנֵיהֶן. לֹא רְאִי נְשִׂיא כִּרְאִי דַּיָּין, וְלֹא רְאִי דַּיָּין כִּרְאִי נָשִׂיא.
Mishnah Sanhedrin 7:8משנה סנהדרין ז׳:ח׳
He who desecrates the Sabbath [is stoned], providing that it is an offence punished by “kareth” if deliberate, and by a sin-offering if unwitting. One who curses His father or his mother is not punished unless he curses them by the divine name. If he cursed them by a nickname, Rabbi Meir held him liable, but the Sages ruled that he is exempt.
הַמְחַלֵּל אֶת הַשַּׁבָּת, בְּדָבָר שֶׁחַיָּבִין עַל זְדוֹנוֹ כָרֵת וְעַל שִׁגְגָתוֹ חַטָּאת. הַמְקַלֵּל אָבִיו וְאִמּוֹ, אֵינוֹ חַיָּב עַד שֶׁיְּקַלְּלֵם בַּשֵּׁם. קִלְּלָם בְּכִנּוּי, רַבִּי מֵאִיר מְחַיֵּב וַחֲכָמִים פּוֹטְרִין:
Mishnah Shevuot 4:13משנה שבועות ד׳:י״ג
[If he said]: "I adjure you"; "I command you"; "I bind you"; they are liable. "By heaven and earth!", they are exempt. "By Alef Daleth"; "By Yod He"; "By God Almighty"; "By The Lord of Hosts; "By the Merciful and Gracious one"; "By the Long Suffering One"; "By the One Abounding in Kindness"; or by any of the substitutes [for the name], they are liable. He who blasphemes by any of them is liable, according to the words of Rabbi Meir. And the Sages exempt him. He who curses his father or mother by any of them is liable according to the words of Rabbi Meir. And the Sages exempt him. He who curses himself or his neighbor by any of them transgresses a negative precept. [If he said,] "May God smite you"; or "Yea, may God smite you"; this is the curse written in the Torah. "May [God] not smite you"; or "May he bless you"; Or "May he do good unto you [if you bear testimony for me]": Rabbi Meir makes [them] liable, and the Sages exempt [them].
מַשְׁבִּיעַ אֲנִי עֲלֵיכֶם, מְצַוֶּה אֲנִי עֲלֵיכֶם, אוֹסֶרְכֶם אָנִי, הֲרֵי אֵלּוּ חַיָּבִין. בַּשָּׁמַיִם וּבָאָרֶץ, הֲרֵי אֵלּוּ פְטוּרִין. בְּאל"ף דל"ת, בְּיו"ד ה"א, בְּשַׁדַּי, בִּצְבָאוֹת, בְּחַנּוּן וְרַחוּם, בְּאֶרֶךְ אַפַּיִם וְרַב חֶסֶד, וּבְכָל הַכִּנּוּיִין, הֲרֵי אֵלּוּ חַיָּבִין. הַמְקַלֵּל בְּכֻלָּן, חַיָּב, דִּבְרֵי רַבִּי מֵאִיר, וַחֲכָמִים פּוֹטְרִין. הַמְקַלֵּל אָבִיו וְאִמּוֹ בְּכֻלָּן, חַיָּב, דִּבְרֵי רַבִּי מֵאִיר, וַחֲכָמִים פּוֹטְרִין. הַמְקַלֵּל עַצְמוֹ וַחֲבֵרוֹ בְּכֻלָּן, עוֹבֵר בְּלֹא תַעֲשֶׂה. יַכְּכָה אֱלֹהִים, וְכֵן יַכְּכָה אֱלֹהִים, זוֹ הִיא אָלָה הַכְּתוּבָה בַתּוֹרָה. אַל יַכְּךָ, וִיבָרֶכְךָ, וְיֵיטִיב לְךָ, רַבִּי מֵאִיר מְחַיֵּב וַחֲכָמִים פּוֹטְרִין: