Sayyiduna Uqbah bin Amir (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) said: "Do not go to women (in seclusion)." The Companions said: "O Messenger of Allah! Except for the in-laws (i.e., exempt the in-law)." He said: "The in-law is death itself."
Yahya bin Bustam said: By 'in-law' is meant the husband's relatives such as brothers, i.e., the woman's brother-in-law, etc.
Brief Explanation
(Commentary on Hadith 2677)
The Shaykhs have mentioned this hadith in the chapter regarding seclusion (khalwah) with a non-mahram woman, from which it is understood that seclusion with a non-mahram woman is forbidden (haram). By "non-mahram" (ajnabi) is meant every person with whom marriage to that woman is permissible. "Hamu" also refers to the husband's relatives with whom marriage to that woman would be permissible, such as the husband's brother, his nephew (brother's son), his nephew (sister's son), paternal cousin, maternal cousin, etc.—those with whom, in any lawful circumstance, marriage to that woman could occur. However, those relatives who are mahram are not meant here, such as the husband's father and the husband's son; it is permissible for them to be alone with her, because the son's wife is forbidden (haram) for them: «﴿وَحَلَائِلُ أَبْنَائِكُمُ الَّذِينَ مِنْ أَصْلَابِكُمْ﴾ [النساء : 23]».
But the wives of your sons who are from your own loins are forbidden to you.