if someone’s wife passes away, would the mother in law would be mahram for him or not? Also, if someone’s husband passes away then would the father in law is mahram for her or not?
Yes, the mother in law would still be mahram for the husband of a deceased wife and similarly for the wife of a deceased husband the father in law would also be mahram.
Original Source Link (from Way Back Machine archive)