Praise be to Allah.
Ruling on using stem cells in vaccines
There is nothing wrong with using stem cells for medical treatment and vaccines, if their source is permissible. That includes miscarried foetuses if the miscarriage occurred naturally, or was aborted for a Islamically legitimate reason, with the permission of both parents.
It is haraam to take stem cells and use them if they source is haraam, such as taking them from a foetus that was aborted deliberately, for no Islamically legitimate reason, or from deliberate fertilization between an egg from a donor and sperm from another donor, for the purpose of producing a embryo in order to take cells from it.
This is mentioned in a statement of the Islamic Fiqh Council of the Muslim World League, issued during its seventeenth session in Makkah al-Mukarramah in 2003 CE. Topic: Transferring and growing stem cells, depending the sources of those cells. It has been quoted previously in the answer to a question on the ruling on stem cells; please see the answers to question no. 108125, where this statement is quoted at length.
Ruling on receiving the vaccine
Among other things, the statement of the Islamic Fiqh Council referred to above says:
“All countries must oppose the abortion of foetuses in order to obtain their organs and cells, and it is not permissible to benefit from that which has been taken in unlawful ways to take part in setting up their banks. Trustworthy organisations should be in charge of this matter and these cells should be collected in ways that are Islamically acceptable, in order to treat those who need transplant of cells.”
However, despite that, if cells taken from aborted foetuses are used in the vaccine, and we are unaware of the nature of these foetuses and whether they were miscarried naturally or aborted deliberately, for an Islamically legitimate reason or otherwise, then what appears to be the case is that it is permissible to receive this vaccine, because we are not certain as to whether its source is haraam, and the basic principle is that things are permissible.
And Allah knows best.