“ ‘Upon a motion to dismiss [for failure to state a cause of action], the sole criterion is whether the subject pleading states a cause of action, and if, from the four corners of the complaint, factual allegations are discerned which, taken together, manifest any cause of action cognizable at law, then the motion will fail’ ” (U.S. Bank N.A. v Stein, 81 AD3d 927, 928 [2011], quoting Maurillo v Park Slope U-Haul, 194 AD2d 142, 145 [1993]). The court must afford the pleading a liberal construction, accept the facts alleged in the pleading as true, accord the plaintiff the benefit of every possible inference, and determine only whether the facts as alleged fit within any cognizable legal theory (see Goshen v Mutual Life Ins. Co. of N.Y., 98 NY2d 314, 326 [2002]; Leon v Martinez, 84 NY2d 83, 87-88 [1994]; Prestige Caterers, Inc. v Siegel, 88 AD3d 679 [2011]; Peery v United Capital Corp., 84 AD3d 1201, 1201-1202 [2011]).
Applying those principles to the instant case, the Supreme Court properly determined that the plaintiffs stated a cause of action to recover damages for legal malpractice (see Ulico Cas. Co. v Wilson, Elser, Moskowitz, Edelman & Dicker, 56 AD3d 1, 8 [2008]; Sitar v Sitar, 50 AD3d 667, 669-670 [2008]; see also Rudolf v Shayne, Dachs, Stanisci, Corker & Sauer, 8 NY3d 438, 442 [2007]; McCoy v Feinman, 99 NY2d 295, 301-302 [2002]). Accordingly, the Supreme Court correctly denied that branch of the defendant’s motion which was pursuant to CPLR 3211 (a) *826(7) to dismiss the cause of action to recover damages for legal malpractice for failure to state a cause of action. Angiolillo, J.E, Dickerson, Lott and Miller, JJ., concur.