Aston Villa captain Jack Grealish was punched by a fan and Manchester United defender Chris Smalling was also confronted on the pitch in two separate incidents on Sunday.
"It is absolutely disgusting and if we don't stamp it out now, next time it could be a knife," Shearer said in his column in The Sun.
"It's that serious. Where are we at in football when some thug thinks that is what he is going to do?"
Grealish was assaulted at St Andrew's by Birmingham fan Paul Mitchell, 27, who was later charged with invading the pitch and assault, while Smalling was confronted in United's defeat to Arsenal at the Emirates Stadium.
"The football authorities have to be seen to nail Birmingham for the behaviour of their fan," Shearer said.
"If that means docking them points, playing in an empty stadium, so be it. There cannot be a strong enough punishment.
"It's completely ridiculous - I can't remember seeing anything as blatant as this."
Birmingham said Mitchell would be banned for life from St Andrew's and Arsenal later pledged the same punishment would be imposed on the pitch invader at their match.
Shearer added: "There has to be the right message here. Come down like a ton of bricks on Birmingham and punish so-called fans where it hurts, with bans and fines.
"It just proves we have a real problem. The authorities have to stamp it out now."
Former Aston Villa midfielder Lee Hendrie said the incident at St Andrew's was the worst of its kind that he had seen and backed Shearer's calls for urgent action.
Hendrie told BBC Radio 5 Live: "It could have been someone running on with a knife - how are you meant to stop this?
"It's going to take something, that's going to cause a big, big scene in football, that's going to make people really stand up.
"Why do we need to wait for that to actually happen before someone gets really hurt? Imagine Jack's family sitting at the side and thinking about what could possibly have happened."
Hendrie was also outraged by Grealish's treatment by a steward as the player celebrated his second-half winner.
Steward 'spoken to'
West Midlands Police confirmed a steward was "spoken to" after television footage appeared to show him pushing Grealish, but no offence had been reported.
"Why can't Grealish go and celebrate with his fans?" Hendrie added. "It's absolutely disgusting what I saw, where a steward has tried to knee him in the back.
"He obviously got taken away by the police, but these are the sort of things we're seeing in football.
"I can't have stuff like that. Why are these people doing it? Where do players get their protection from?"
Professional Footballers' Association chief executive Gordon Taylor said the attack on Grealish was "disgraceful" and "cowardly".
He has called on the Football Association to work with the government, police and stewards at the grounds to help stamp out such incidents.
"It was disgraceful, cowardly and criminal. We have seen an increase in such behaviour at clubs this season. It's been racist abuse, it's been anti-semitism and now it's real fear for the safety of players," Taylor told Sky Sports News.
"From that point of view, we had a meeting just the other week with the Minister for Sport about engaging on this issue between the police and the stewards, which is crucial, and the responsibility of clubs about trying to get the right balance between educating supporters but also having sanctions to make sure we put a lid on it because we've been down this road before and we don't want to go there again and see the game threatened."
When asked about what sanctions could be implemented, Taylor said: "There's a combination you can consider - fines, ground closures, playing games behind closed doors and points deductions. Every case needs to be looked at on its merits but it has to be a job for the national association."