I heard Saad, who was the first to shoot an arrow in the path of Allah, and Abu Bakrah, who scaled the fortress of Taif along with a group of men and came over to the Prophet ﷺ. They both said, "We heard the Prophet ﷺ say, 'Whoever claims descent from someone other than his real father, knowing the truth, Paradise is forbidden to him.'"
سمعت سعدا- وهو أول من رمى بسهم في سبيل الله- وأبا بكرة، وكان تسور حصن الطائف في أناس، فجاء إلى النبي ﷺ قالا: سمعنا النبي ﷺ يقول: من ادعى إلى غير أبيه وهو يعلم فالجنة عليه حرام.
Bukhari reported it in the Book of Military Expeditions (4326) and Muslim in the Book of Faith (62:115), both from the hadith of Asim, from Abu Uthman, as mentioned. The wording given is Bukhari's.Abu Bakra had come to the Prophet ﷺ while he was at Taif, along with a group of slaves, twenty-three in number, all of whom had embraced Islam. Bukhari mentioned this right after, saying, Hisham said, and Mamar informed us, from Asim, from Abu Aliyah, or Abu Uthman Nahdi, who said, I heard Saad and Abu Bakra narrating from the Prophet ﷺ.Asim said, I said, "Two men have testified before you, and that is enough for you with them." He said, "Indeed. As for one of them, he was the first to shoot an arrow in the cause of Allah, and as for the other, he came down to the Prophet ﷺ as the third of twenty-three from Taif."Hisham is Ibn Yusuf Sanani.