WASHINGTON — The Securities and Exchange Commission is considering taking civil action against Standard & Poor’s for its rating of a 2007 mortgage debt offering. Such action could be just the first shot in a legal assault against the major credit rating agencies.

The three major agencies — S&P, Moody’s Investors Service and Fitch Ratings — gave high ratings to mortgage investments that turned out to be worthless and contributed to the 2008 financial crisis.

If the SEC charges S&P with violating securities laws, it would mark the first time it’s brought an enforcement action against a top rating agency.

New York-based McGraw-Hill Cos., which owns Standard & Poor’s Ratings Services, said Monday in a regulatory filing that the SEC staff had told the company it’s considering recommending that the agency act. The SEC’s staff said it may recommend to the five SEC commissioners that they seek a civil fine and restitution.

The formal notice from the SEC’s enforcement staff gives S&P a chance to make a case that there’s no basis for charges. S&P said it’s been cooperating with the SEC and will continue to do so.

Regardless of the outcome of the S&P case, the entire rating agency industry may be facing enforcement actions related to the financial crisis.