The Messenger of Allah ﷺ ruled that the child belongs to the marriage bed.
حدثنا أبو بكر بن أبي شيبة حدثنا سفيان بن عيينة عن عبيد الله بن أبي يزيد عن أبيه
أن رسول الله ﷺ قضى بالولد للفراش
No references are available.
Sourcing, [sahih] Ahmad reported it, 1/25, and Atraf Musnad, 5/88, and Musnad Faruq, 1/425–426, from Sufyan through this chain. Humaydi (Deobandiyyah, 24) said, Sufyan narrated to us, Ubaydullah bin Abu Yazid narrated to me, my father informed me, through this chain, at greater length, and its chain of transmission is hasan. Busiri graded it sahih, and the preceding hadith serves as a corroborating witness for it.