Overview
In blockchain, front-running occurs when a 'searcher' or validator sees a profitable transaction in the mempool (the waiting area for transactions) and submits their own transaction with a higher gas price to ensure it is processed first.
Example
If someone is about to buy a large amount of a token on a DEX (which will drive the price up), a front-runner will buy the token first, wait for the victim's trade to push the price up, and then sell for a profit.
Mitigation
Techniques like 'commit-reveal' schemes, private transaction relays, and specialized DEX designs are used to combat front-running.