Wiktionary
taste of one's own medicine
n. {{context|idiomatic|usually preceded by (term a English)|lang=en}} harsh treatment inflicted on one who previously inflicted similar or equivalent treatment on others.