My ears heard it and my heart retained it from Muhammad ﷺ, that he said, "Whoever claims a father other than his own, knowing that he is not his father, paradise is forbidden to him."He said, "Then I met Abu Bakrah and mentioned this to him, and he said, 'My ears heard it and my heart retained it from Muhammad ﷺ.'"Asim said, "I said, 'Abu Uthman, two men have testified before you, but what men they are!'"He replied, "As for one of them, he was the first to shoot an arrow in the path of Allah," meaning Saad bin Malik, "and the other came from Taif on foot among some twenty-odd men." Then he mentioned their virtue.
حدثنا النفيلي حدثنا زهير حدثنا عاصم الأحول قال حدثني أبو عثمان قال
سمعته أذناي ووعاه قلبي من محمد ﷺ أنه قال من ادعى إلى غير أبيه وهو يعلم أنه غير أبيه فالجنة عليه حرام قال فلقيت أبا بكرة فذكرت ذلك له فقال سمعته أذناي ووعاه قلبي من محمد ﷺ قال عاصم فقلت يا أبا عثمان لقد شهد عندك رجلان أيما رجلين فقال أما أحدهما فأول من رمى بسهم في سبيل الله أو في الإسلام يعني سعد بن مالك والآخر قدم من الطائف في بضعة وعشرين رجلا على أقدامهم فذكر فضلا
Bukhari narrated it in Al-Maghazi, Chapter on the Battle of Taif, no. 4326, 4327, and Muslim narrated it in Al-Iman, Chapter on the state of faith of one who disowns his father while knowing it, no. 63, both from the hadith of Asim al-Ahwal, with this same wording.