Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:33:57

Indeed, those who abuse Allah and His Messenger - Allah has cursed them in this world and the Hereafter and prepared for them a humiliating punishment.  

Indeed those who are injurious to God and His Messenger — and they are the disbelievers, who attribute to God what He is exalted above of such things as ˹His having˺ a son or a partner and they deny His Messenger — God has cursed them in this world and the Hereafter, He has banished them ˹from His mercy˺, and has prepared for them a humiliating chastisement, and that is the Fire.
القرآن:٣٣:٥٧

إِنَّ الَّذِينَ يُؤْذُونَ اللَّهَ وَرَسُولَهُ لَعَنَهُمُ اللَّهُ فِي الدُّنْيَا وَالْآخِرَةِ وَأَعَدَّ لَهُمْ عَذَابًا مُهِينًا  

{إن الذين يؤذون الله ورسوله} وهم الكفار يصفون الله بما هو منزه عنه من الولد والشريك ويكذبون رسوله {لعنهم الله في الدنيا والآخرة} أبعدهم {وأعدَّ لهم عذاباً مهيناً} ذا إهانة وهو النار.

See similar narrations below:

Collected by Ḥākim
hakim:4618Muḥammad b. Aḥmad b. Tamīm al-Qanṭarī > Abū Qilābah al-Raqāshī > Abū ʿĀṣim > ʿAbdullāh b. al-Muʾammal > Abū Bakr b. ʿUbaydullāh b. Abū Mulaykah from his father > Jāʾ a man from Ahl al-Shām Fasab ʿAlī ʿInd Ibn ʿAbbās Faḥaṣabah Ibn ʿAbbās

[Machine] "O enemy of Allah, you have harmed the Messenger of Allah ﷺ . Indeed, those who harm Allah and His Messenger, Allah curses them in this world and the Hereafter and has prepared for them a humiliating punishment." [Al-Ahzab 57] If the Messenger of Allah ﷺ were alive, you would harm him.  

الحاكم:٤٦١٨أَخْبَرَنِي مُحَمَّدُ بْنُ أَحْمَدَ بْنِ تَمِيمٍ الْقَنْطَرِيُّ ثنا أَبُو قِلَابَةَ الرَّقَاشِيُّ ثنا أَبُو عَاصِمٍ عَنْ عَبْدِ اللَّهِ بْنِ الْمُؤَمَّلِ حَدَّثَنِي أَبُو بَكْرِ بْنُ عُبَيْدِ اللَّهِ بْنِ أَبِي مُلَيْكَةَ عَنْ أَبِيهِ قَالَ جَاءَ رَجُلٌ مِنْ أَهْلِ الشَّامِ فَسَبَّ عَلِيًّا عِنْدَ ابْنِ عَبَّاسٍ فَحَصَبَهُ ابْنُ عَبَّاسٍ فَقَالَ

يَا عَدُوَّ اللَّهِ آذَيْتَ رَسُولَ اللَّهِ ﷺ {إِنَّ الَّذِينَ يُؤْذُونَ اللَّهَ وَرَسُولَهُ لَعَنَهُمُ اللَّهُ فِي الدُّنْيَا وَالْآخِرَةِ وَأَعَدَّ لَهُمْ عَذَابًا مُهِينًا} [الأحزاب 57] لَوْ كَانَ رَسُولُ اللَّهِ ﷺ حَيًّا لَآذَيْتَهُ  

«هَذَا حَدِيثٌ صَحِيحُ الْإِسْنَادِ وَلَمْ يُخَرِّجَاهُ» صحيح