In order to have standing in derivative litigation, a stockholder must have already been a stockholder at the time of the bad act that gave rise to the litigation. This requirement prevents people from observing some bad act and then buying into a lawsuit.
CHAPTER 1. GENERAL CORPORATION LAW
Subchapter XIII. Suits Against Corporations, Directors, Officers or Stockholders
§ 327. Stockholder's derivative action; allegation of stock ownership.
In any derivative suit instituted by a stockholder of a corporation, it shall be averred in the complaint that the plaintiff was a stockholder of the corporation at the time of the transaction of which such stockholder complains or that such stockholder's stock thereafter devolved upon such stockholder by operation of law.