Praise be to Allah.
Firstly: In the answer to question no. 166813 , we have noted that the active substance in cannabis, which affects the brain and nervous system, is that which is referred to by the acronym THC, which stands for tetrahydrocannabinol. This substance causes intoxication and is haraam.
Secondly: It is not permissible to deliberately add any intoxicant substance or [psychoactive] drug to food, medicine or anything else.
But if it is in fact added to something, the sin of that is on the one who adds it.
Then we should examine the food or medicine: if the percentage of the intoxicant substance is negligible, no trace of it can be found and it does not cause intoxication in the one who eats or drinks a large amount of this food or medicine, then there is nothing wrong with consuming it.
Regarding the permissibility of using medicines that contain a small amount of intoxicating alcohol, there have been several statements from Islamic Fiqh Councils and fatwas from Ifta’ committees and councils in the Muslim world, whilst noting that it is preferable to avoid adding alcohol to any medicine, so as to avoid a dubious matter.
For more information, please see the answer to question no. 256355 .
It says in Fataawa al-Lajnah ad-Daa’imah li’l-Ifta’ (22/123): The way vinegar is made in Egypt is done by adding beer to it. Then it is placed in a wooden barrel, and some other substances are added to it until it turns into vinegar. This is known as Egyptian vinegar. This is as it is explained in the ninth grade curriculum. What is the ruling on consuming this vinegar?
Answer: it is not permissible to put any intoxicating substance into anything that is intended to be used as medicine, food or drink, or in anything that is intended to be used to make food, drink or a condiment, whether that intoxicating substance is beer or something else.
There is a fatwa of the Permanent Committee on the ruling on mixing medicine with alcohol and the ruling on using it. The text of this fatwa is as follows:
It is not permissible to mix medicines with alcohol that causes intoxication.
But if medicine is mixed with alcohol, it is permissible to use it if the percentage of alcohol is very low and does not affect the colour, taste or smell of the medicine and drinking it does not cause intoxication. Otherwise it is haraam to use that which is mixed with alcohol. End quote.
Shaykh ‘Abdullah ibn Qa‘ood, Shaykh ‘Abdullah ibn Ghadyaan, Shaykh ‘Abd ar-Razzaaq ‘Afeefi, Shaykh ‘Abd al-‘Azeez ibn ‘Abdillah ibn Baaz.
Based on that:
It is not permissible to add this substance, THC, to any kind of medicine or anything else, no matter what the percentage.
But if it has already been added to some medicine, and the percentage is negligible, so that it has not left any trace in what it has been mixed with, then there is nothing wrong with taking it.
And Allah knows best.