He heard the Prophet ﷺ say, "Whoever claims descent from someone other than his father, or attaches himself as a client to people other than his rightful patrons, upon him is the curse of Allah, the angels, and all of mankind."
أنه سمع النبي ﷺ يقول: من ادعى إلى غير أبيه، أو تولى غير مواليه فعليه لعنة الله والملائكة والناس أجمعين.
Imam Ahmad (3037), Abu Yaala (2540), and Tabarani in al-Kabir (12475) all narrated it through the route of Affan, who said, Wahib narrated to us, who said, Abdullah bin Uthman bin Khuthaym narrated to us, from Saeed bin Jubayr, from Ibn Abbas, and he mentioned it. Its chain is sahih. Wahib, with the diminutive form, is Ibn Khalid bin Ajlan, a trustworthy and firm narrator among the narrators of the six major collections. Ibn Hibban graded it sahih (417) and narrated it through this same route.This hadith is among the additions of Ibn Majah, for he narrated it through the route of Ibn Abu Dayf, who said, Abdullah bin Uthman bin Khuthaym narrated to us, and he mentioned it (2609), except that Ibn Abu Dayf is "obscure" as stated in al-Taqrib.There are other hadiths on this subject warning against attributing oneself to someone other than one's father, but they do not contain the mention of the curse of the angels, so they will be mentioned in their proper places.