Healthcare conglomerate Johnson & Johnson's (JNJ 0.67%) ongoing litigation over the alleged health effects of its talc-based baby powder continues to hang over the company's head. Recently, an appeals court ruled against Johnson & Johnson's attempt at using bankruptcy protection to shield itself from claims.

An analyst from JPMorgan estimated that Johnson & Johnson's potential talc liabilities could approach $8 billion to $10 billion, which is no small pill to swallow. But should that keep investors away from the stock? Here is why that may not be the case.

Getting up to speed

There are currently somewhere in the neighborhood of 40,000 lawsuits pending against Johnson & Johnson, alleging that its talcum-based baby powder can cause ovarian cancer. The company is officially pulling its talcum powder from shelves worldwide this year, but has fought the allegations against it.

Johnson & Johnson had attempted what some call a Texas Two-Step, a legal procedure in which the company created a subsidiary, LTL, to house the company's potential talc liabilities. It filed for bankruptcy to protect itself from claims. However, an appeals court recently ruled against the move, saying that Johnson & Johnson's strong financial position prevented the move from being done in good faith.

Johnson & Johnson will appeal the court's decision, and there could always be settlements along the way. However, an investor should hope for the best outcome but prepare for the worst. An internet search will reveal a wide range of estimates about the company's potential legal liabilities, including the $8 billion to $10 billion figure given by the analyst. Hypothetically, imagine a real Erin Brockovich scenario where Johnson & Johnson has to pay $10 billion in legal liabilities. How might that affect the company and a potential investment thesis?

Testing Johnson & Johnson's balance sheet

While the litigation isn't good news, Johnson & Johnson is arguably one of the best-equipped companies to deal with the financial damage of a lawsuit. Johnson & Johnson's free cash flow over the past four quarters alone is $17.7 billion, enough to pay for its estimated liabilities in one year! Of course, the company's famous for its dividend, so you need to factor that in. Johnson & Johnson has spent $8.7 billion on dividends over the past year, leaving enough leftover profit to cover $9 billion out of the $10 billion estimate -- again, within just one year.

Not enough peace of mind? Johnson & Johnson is sitting on $24 billion in cash and marketable securities, enough to cover the high end of the liability estimate twice over. Even if you ignored all that and assumed the company was to borrow the funds, Johnson & Johnson is one of two companies with an AAA credit rating from S&P Global.

The litigation is bad publicity and will cost the company some serious coin, but it's hard for a long-term investor to see this as anything more than a speed bump that most won't remember after several years.

The stock looks attractive here

Meanwhile, the stock trades at a forward price-to-earnings ratio (P/E) of 15.7. That's a discount to the S&P 500, which trades at a forward P/E of 18.3. Johnson & Johnson's growth won't excite you; analysts call for earnings per share (EPS) growth averaging 5.5% annually over the next three to five years. However, you get a very safe stock with shining fundamentals, which you've seen above.

Chart showing Johnson & Johnson's PE ratio trending down since 2022.

JNJ PE Ratio (Forward) data by YCharts

The stock market hates uncertainty, and it's reasonable that Johnson & Johnson stock could be somewhat held back by the uncertainty of its talcum powder litigation. The S&P 500 is up more than 8% over the past month, while Johnson & Johnson is down more than 6%. Still, it seems that even a worst-case scenario where it pays significant liabilities is nothing more than a minor setback for a company that's proven its resiliency for decades. The dark clouds could be a great long-term buying opportunity.