This wasn’t even borderline legal. It was straight up illegal. Well sort of. It was within the remit of her Ministerial powers but the circumstances weren’t precisely what this power was designed for. However, nobody was going to complain that she was going to use this on the Malfoys.