It has reached me that the Messenger of Allah ﷺ ruled that the child belongs to the marriage bed, and for the fornicator is the stone.
حدثنا محمد بن جعفر حدثنا عوف
بلغني أن رسول الله ﷺ قضى أن الولد لصاحب الفراش وللعاهر الحجر
Its isnad is sahih, but it is mursal. Since Hasan narrated it many times from Abu Hurairah, he placed it in his Musnad, and it has already passed at 9273 and 10107, as in the following hadith.