The Prophet ﷺ said: A woman gets inheritance from the three following: one she has set free, a foundling, and her child about whom she has invoked a curse on herself if she was untrue in declaring he was not born out of wedlock. (Using translation from Abū Dāʾūd 2906)
عَنْ رَسُولِ اللهِ ﷺ قَالَ تُحْرِزُ الْمَرْأَةُ ثَلَاثَةَ مَوَارِيثَ عَتِيقَهَا وَلَقِيطَهَا وَالْوَلَدَ الَّذِي لَا عَنَتْ عَلَيْهِ