Your original sentence is understandable, but it’s slightly unbalanced because it combines a future action (“to take legal action”) with a past action (“foils”). Here are cleaner versions:
Best corrected version (news style):
Meta to take legal action against Israeli spyware firm NSO Group after foiling phishing attacks.
More formal:
Meta has announced plans to take legal action against Israeli spyware firm NSO Group following its disruption of phishing attacks.
Headline style:
Meta to sue NSO Group after foiling phishing attacks.
More journalistic (balanced):
Meta said it will pursue legal action against Israeli spyware firm NSO Group after detecting and blocking phishing attacks.
Emphasis on security action:
Meta to take legal action against Israeli spyware firm NSO Group after stopping phishing campaigns targeting users.
More formal corporate tone:
Meta has stated it will initiate legal proceedings against NSO Group following the disruption of phishing activity on its platforms.
Concise headline options:
- Meta to sue NSO Group after blocking phishing attacks
- Meta targets NSO Group with legal action over phishing attempts
- Meta moves to sue NSO after foiling cyberattacks
