There are several reasons why cats like to sneak up on their owners' feet:
1. I want to play with you
There's actually a reason why cats do this. They often ambush their owners, probably because they're too bored at home. They'll ambush you the moment you come home.
This way, the owner can play with it, and it will make the owner much happier. 
2. I love you so much
It holds a very high position in its heart. If you are a stranger to the cat, it will not bother to provoke you.
Only when you hold a high position in its heart, and play at its feet, will it feel safe enough.
So, if a cat is attacking your feet, it means it loves you very much and you hold a high place in its heart. You don't need to worry about it biting or scratching you.
3. It is welcoming you.
Cats have many ways of welcoming their owners, so some cats will ambush you the moment you open the door. Actually, this is their way of welcoming their owners home, and they will rub against you afterwards.
So when its owner comes home, spend some time with it and reward it with some cat treats, and it will be very happy.
4. It's preparing to retaliate against you because you treated it badly.
Actually, when a cat attacks your foot, you should pay attention to its expression. If it looks fierce, it means you have offended it or treated it badly, and attacking your foot is its way of getting revenge.
At this point, you need to be careful, otherwise you might be hurt by the cat. Once such behavior occurs, you should reflect on whether you have been managing the cat properly at home, which could have led to the cat attacking your feet.