Saad bin Abu Waqqas and Abu Bakra reported,

My ears heard and my heart retained Muhammad ﷺ saying, "Whoever claims descent from someone other than his true father, knowing that he is not his father, paradise is forbidden to him."

Ibn Majah 2610

Sahih

حدثنا علي بن محمد حدثنا أبو معاوية عن عاصم الأحول عن أبي عثمان النهدي قال

سمعت سعدا وأبا بكرة وكل واحد منهما يقول

سمعت أذناي ووعى قلبي محمدا ﷺ يقول من ادعى إلى غير أبيه وهو يعلم أنه غير أبيه فالجنة عليه حرام

ابن ماجه 2610صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Legal punishments
Chapter
Who claims lineage to other than his father or affiliates with other than his patrons
Numbering
Darussalam 2610
Ibn Majah 2610