06Intoxicants
Every intoxicant is khamr, and every khamr is forbidden — whatever its source, and whatever it is called.
Muslim · ṣaḥīḥ; Q 5:90
Forbidden also: to sell it, carry it, serve it, press it, or take its price — ten are cursed in connection with it.
Tirmidhī, Ibn Mājah · ṣaḥīḥ
Where scholars distinguish
Vinegar — wine that has turned of itself is pure and lawful by agreement. Deliberately converting it is disputed: permitted per Ḥ, disliked or forbidden per the others.
Ethanol as a solvent — where it is not derived from khamr, is present in trace amounts, and leaves no effect, most contemporary councils permit it. This covers most flavourings, vanilla extract and mouthwash.
Foods cooked with wine — forbidden. Heat does not remove what was deliberately added, and the taste remains.
The governing test is istiḥālah — whether the substance has genuinely transformed into something else, or merely been diluted. Dilution changes nothing.