The full-back came off after the interval and was replaced by Victor Lindelof as United made it three consecutive Premier League wins.
Scott McTominay struck late with a powerful header after Douglas Luiz had levelled the scores following Rasmus Hojlund’s early goal.
The win took United within five points of Villa and within six of fourth-placed Tottenham, raising hopes of a challenge for Champions League qualification that would have seemed unlikely only weeks ago.
Still, it continues to be a frustrating season on the injury front for Ten Hag. United lost Lisandro Martinez for around two months of action while beating West Ham last week, so the sight of Shaw going off too will have concerned supporters.
The England international was ruled out between August and November with a muscle injury and Ten Hag has confirmed Shaw will be assessed.
“Precaution,” said the Dutchman when asked of Shaw’s substitution.
“He had some complaints and we can't take any risks with him because he's had any injuries in the past. We'll have to see how it goes in the next few days.
“It's not an advantage to lose him, everyone knows my philosophy to have left-footers at left centre-back and left-back. We have to make compromises and it is not to our advantage."
Of the victory, Ten Hag told Sky Sports: “It is a massive win for us. We've got closer and that was the aim for today.
“That was absolutely our target and we've done it. The way we did it, I liked it. I especially liked the first 20 minutes when we controlled the game. At 1-1 we had to fight back and we are really happy for today.”