Saad reported,

I heard the Prophet ﷺ say, "Whoever claims descent from someone other than his father, knowing that the man is not his father, Paradise is forbidden to him."I mentioned this to Abu Bakra, and he said, "I heard it too. My own ears heard it and my heart retained it from the Messenger of Allah ﷺ."

Bukhari 6767

Sahih

فذكرته لأبي بكرة فقال وأنا سمعته أذناي ووعاه قلبي من رسول الله ﷺ

البخاري 6767صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Obligatory duties
Chapter
One who claims lineage to other than his father
Numbering
Darussalam 6767
Bukhari 6767