Does an illegitimate child have a mahram? Hope for an explanation.
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
According to Syeikh Nawawi bin Umar, mahram is defined by the jurists as: “A person who is prohibited for a person to marry and its prohibition is in the form of al-ta’bid (forever) with a mubah reason and not due to the honour or a hindrance that may disappear.” 
The explanation regarding the people considered as mahram is stated in the statement of Allah SWT:
حُرِّمَتْ عَلَيْكُمْ أُمَّهَاتُكُمْ وَبَنَاتُكُمْ وَأَخَوَاتُكُمْ وَعَمَّاتُكُمْ وَخَالَاتُكُمْ وَبَنَاتُ الْأَخِ وَبَنَاتُ الْأُخْتِ وَأُمَّهَاتُكُمُ اللَّاتِي أَرْضَعْنَكُمْ وَأَخَوَاتُكُم مِّنَ الرَّضَاعَةِ وَأُمَّهَاتُ نِسَائِكُمْ وَرَبَائِبُكُمُ اللَّاتِي فِي حُجُورِكُم مِّن نِّسَائِكُمُ اللَّاتِي دَخَلْتُم بِهِنَّ فَإِن لَّمْ تَكُونُوا دَخَلْتُم بِهِنَّ فَلَا جُنَاحَ عَلَيْكُمْ وَحَلَائِلُ أَبْنَائِكُمُ الَّذِينَ مِنْ أَصْلَابِكُمْ وَأَن تَجْمَعُوا بَيْنَ الْأُخْتَيْنِ إِلَّا مَا قَدْ سَلَفَ ۗ إِنَّ اللَّهَ كَانَ غَفُورًا رَّحِيمًا
“Prohibited to you [for marriage] are your mothers, your daughters, your sisters, your father’s sisters, your mother’s sisters, your brother’s daughters, your sister’s daughters, your [milk] mothers who nursed you, your sisters through nursing, your wives’ mothers, and your step-daughters under your guardianship [born] of your wives unto whom you have gone in. But if you have not gone in unto them, there is no sin upon you. And [also prohibited are] the wives of your sons who are from your [own] loins, and that you take [in marriage] two sisters simultaneously, except for what has already occurred. Indeed, Allah is ever Forgiving and Merciful.” 
Whilst the term illegitimate child is defined as: 
- Out of wedlock child born as a result of fornication or rape and not from doubtful intercourse nor is it a child of a slave.
- A child born less than 6 months and 2 lahzah (seconds) according to the Qaamriah calendar from the date of tamkin (intercourse).
- A baby born more than 6 months and less than 4 years from the known or certain assumption date of imkan al-dukhul (intercourse) that the pregnancy occurs before the solemnization or the husband didn’t have intercourse after marriage or none of the husband’s semen is transferred into the vagina of the wife, hence, it is prohibited to name the baby as the child of the baby’s mother’s husband or the person responsible for the pregnancy of the woman that gives birth to the baby.
Answering the above question, the mahram of an illegitimate child is the child’s mother and the maternal family members such as the child’s mother, grandmother, grandfather, mother’s siblings. The child’s siblings are also considered as the child’s siblings with the same mother. Thus, they are also considered mahram of the illegitimate child.
This differs from the child’s relationship with his biological father, its ruling is different from his mother. Madhhab Syafie issued a ruling that clearly shows how there is no bond between a father and his illegitimate child. This is as decided by the National Muzakarah Fatwa Council Committee for Religious Affairs Malaysia which states:
An illegitimate child is prohibited from being named as the child of a man that causes his birth or whoever claims to be the father of the child. Thus, they can’t accept or give inheritance, not a mahram and cannot be the wali to the child. 
May Allah SWT give us all understanding in obeying all His commandments and grant us strength to avoid all His prohibitions. Amin.
 See Kasyifah al-Saja, pg. 114
 Seet: http://e-smaf.islam.gov.my/e-smaf/index.php/main/mainv1/fatwa/pr/15450