Sayyiduna Abdullah bin Amr (may Allah be pleased with them both) heard the Messenger of Allah (peace and blessings be upon him) say: "I would not care what I did if I were to drink theriac, or hang an amulet, or compose poetry of my own accord." Ibn Sirin (may Allah have mercy on him) disliked taking theriac because snake flesh is put into it. Imam Ahmad (al-Bayhaqi) (may Allah have mercy on him) said: For this reason al-Shafi'i disliked it, and he said: It is not permissible to eat theriac made with the flesh of snakes, except in a state of necessity in which carrion becomes permissible.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الضحايا / 19633