Security forces foil major terror bid