The Messenger of Allah ﷺ ruled that the child belongs to the marriage bed.
أن رسول الله ﷺ قضى بالولد للفراش.
No references are available.
Ibn Majah (2005) and Ahmad (173) both narrated it from the hadith of Sufyan bin Uyayna, from Ubaydullah bin Abu Yazid, from his father, from Umar, and he related it. Its isnad is sahih. Abu Yazid is al-Makki, the ally of Banu Zahra, and it is said that he was a companion.Bayhaqi (7/402) narrated it through the route of Shafii, from Sufyan bin Uyayna, from Ubaydullah bin Abu Yazid, from his father, who said, "Umar bin Khattab sent for an old man from Banu Zahra who used to live in our house, so I went with him to Umar bin Khattab. Umar asked him about a case of birth from the births of the pre-Islamic era. He said, 'As for the marriage bed, it belongs to so-and-so, and as for the seed, it belongs to so-and-so.' Umar said, 'You have spoken the truth, but the Messenger of Allah ﷺ ruled that the child belongs to the marriage bed.'"