In general, any filthy substance in solid form would still be impure.
In terms of using alcohol as a flavor ingredient, it would be unlawful and filthy if the source is wine (i.e., alcohol derived from grapes. This would also apply if derived from dates or raisins).
If the source of the flavor ingredient is alcohol derived from grains (non-wine alcohol), then it would be permissible and not filthy ONLY if:
(a) it is not used as an intoxicant,
(b) it is not used in an amount that intoxicates,
(c) it is not used as intoxicants are used (i.e., for alcoholic consumption, even if a little)
(d) it is not used in vain (lahw) or as done by the religiously corrupt (fussaq).
One would have to be careful to fulfill all of these conditions, as otherwise it would be filthy and sinful to consume.
[Mawsili, Ikhtiyar; Maydani, Lubab]