So many American home mortgages are going bad that the nation's housing-finance system could suffer serious and lasting damage, according to the head of the nation's largest buyer of mortgage loans.

"The cold facts are that the bad risk already in the system has cost the industry hundreds of millions of dollars, and we face potential losses of millions more," David O. Maxwell, chairman of the Federal National Mortgage Association, told a bankers meeting here this week.

And even though the problem is now apparent, "too much credit risk is still getting in" the system, he said.

"The problem is zapping the strength of too many mortgage finance institutions and even threatening the reputation of the home mortgage itself," Maxwell said.

" . . . We must act now to restrict the amount of risk coming into the system," he said.

The problem is critical because so much of the mortgage finance system now depends on the willingness of investors on Wall Street and elsewhere to buy mortgages or securities based on mortgages. One of the most attractive features of these mortgage-based investments is their low default risk. Anything detracting from their reputation for safety would tend to make investors demand a higher yield which, in turn, would raise interest rates for home buyers.

"We must maintain the unmatched reputation of the American mortgage as a premier investment," Maxwell said. "That reputation must be protected at all costs because it is the underpinning of our housing finance system."

Maxwell's remarks served to refocus attention on a fundamental problem that all lenders face: Will the borrower repay and, if not, will the collateral cover the lender's loss?

This problem is known as credit risk, and was once far and away the dominant consideration for lenders in making mortgage loans.

But since the run-up of interest rates beginning in 1979, a different problem has occupied lenders' minds. This problem is known as interest-rate risk -- the threat that rates may rise after a mortgage is written, leaving it below market, or "under water."

This can result in losses to the lender even though the borrower is paying like clockwork.

Efforts to combat interest-rate risk have given rise to the adjustable-rate mortgage as well as a variety of devices for passing the risk on to less-interest-sensitive investors.

Maxwell acknowledged that some new types of mortgages -- particularly those allowing "negative amortization," or an increase in the amount owed -- were "ill advised."

But he said that "the preponderance of the problem loans have been 30-year, fixed-rate conventional" ones made during the 1981-82 recession.

"In all candor, in our efforts to survive as an industry, we probably qualified many people who should have remained out of the home-buying market in 1981 and 1982," he said. The industry did this assuming that the kind of rapid appreciation of housing prices that took place in the 1970s would continue. But it did not.

"We lost the cure-all," Maxwell said. ". . . We're hit with an unusual one-two punch: low housing inflation with relatively high interest rates."

Maxwell cited, but rejected at least for the moment as too Draconian, a number of steps that his company might take to cut credit risk. These included demanding higher down payments, changing appraisal requirements or refusing to buy any loan of a type with a record for higher risk -- second mortgages or investor loans, for example.

Instead, he said, Fannie Mae will adopt what he terms "selective surgery" to weed out problem loan types. Advanced technology now allows the industry "to control risk by paying far more attention to underwriting and servicing performance," he said.

Maxwell added that Fannie Mae is developing a data base that will allow it to tailor underwriting decisions to specific cases while squeezing as much risk out of a loan transaction as possible.

He also indicated that Fannie Mae will become more aggressive in dealing with lenders who sell it bad loans, going so far as to refuse to do business with chronic offenders.

Fannie Mae is the largest player in the so-called secondary mortgage market. Its portfolio and mortgage-backed securities involve one out of every 10 American home mortgages. So its actions are likely to have an important effect on the way the mortgage market works.

The Fannie Mae chairman acknowledged that more concern with credit risk will mean that some people will be denied loans who might otherwise have received them. But he defended his approach as necessary to keep down rates for creditworthy borrowers. And he said his "surgical" approach will disqualify fewer people than across-the-board "amputation."