Wall Street is nothing if not opportunistic. And, as much as any corner of financial markets, junk bonds -- issued by companies with low credit ratings -- embody that opportunism.

Allured by interest rates near historic lows, companies with sketchy credit are borrowing money in bond markets at the fastest pace in at least four years. And investors, desperate for income with 10-year U.S. Treasury yields at 2.3%, are shoveling money at those companies; they've poured $4.9 billion into high-yield bond mutual funds and exchange-traded funds so far this year, seven times the amount for the comparable period of 2016, according to research firm EPFR.

But distressing signs are emerging in the U.S. junk-bond market, which has nearly doubled in size over the past decade to about $2 trillion, based on Standard & Poor's estimates. The development could eventually spell big losses for investors in the bonds, in addition to signaling a broader malaise for the economy and stock markets. A downturn in the market also could bring a nasty surprise to investors who have piled into exchange-traded funds such as BlackRock's iShares iBoxx $ High Yield Corporate Bond ETF (HYG) .

The market's still thriving partly because of a "FOMO attitude," or "fear of missing out," Bank of America Merrill Lynch (BAC) analysts wrote in a report last week. The hallmark of a junk bond is that investors typically receive a higher yield to compensate for the higher risk; these days, the risks remain, but the extra yield has practically vanished.

"We're beginning to get a bit nervous," the analysts wrote. "New pockets of stress and familiar areas of decline are popping up throughout both the economy and portions of the market."

A deteriorating junk-bond market is often a warning sign of fraught financial conditions ahead, so economists pay close attention. Some prognosticators had warned about the dangers of the market in early 2016, as tumbling crude prices raised the prospect of widespread defaults among debt-strapped oil drillers. Indeed, defaults totaled $240 billion for the year, more than double the amount in 2015.

The market mostly recovered, though, as oil prices rebounded to around $49 a barrel, allowing many companies to stave off a cash shortfall with fresh financing in the form of new bank loans, stock offerings and bond sales. Now the concern is that the throes could quickly return in other industries such as health care, retail and autos, in what Bank of America describes "rolling blackouts."

Junk-grade companies could also face higher costs as a result of Federal Reserve interest-rate increases, which would make debt more costly to refinance, the analysts wrote.

And Fitch Ratings, in a statement on Monday, noted a new hazard for junk bonds in the offing: President Donald Trump's proposed tax-code changes.

While better-rated companies would benefit from cutting the corporate tax rate to Trump's proposed 15% from the current 35%, junk-grade companies could suffer, according to Fitch. That's because the tax changes may also eliminate the deductibility of interest, which is a big cost-saver for companies with high debt loads.

"The loss of the tax shield generated by interest expense would effectively make debt more costly," the Fitch analysts wrote.

The International Monetary Fund warned in an April report that risk signals were flashing red in the U.S. junk-bond market; as recently as September, they were in the green. The percentage of firms considered "challenged" -- defined as having annual interest expenses higher than earnings -- has climbed to 22.1%, above the roughly 20% level registered just prior to the financial crisis, the IMF said.

A key takeaway from economic history is that a surge in financial risk-taking -- coupled with heavy borrowing -- often ends abruptly in a recession, as happened in 2001 and 2008, according to the IMF.

"Credit booms of this size are often dangerous," the IMF noted.

Firms with about $4 trillion of combined assets could find themselves challenged to meet interest payments under the junk-bond market's current trajectory, according to the IMF.

That's the backdrop for the market's acceleration into 2017. Companies sold about $88 billion of junk bonds in the first three months of the year, the fastest pace in at least five years, according to the Securities Industry and Financial Markets Association.

JPMorgan Chase (JPM) , Bank of America (BAC) and Citigroup (C) all posted blockbuster first-quarter results, partly due to the bounty of fees from debt underwriting. (Junk-rated companies typically pay fatter fees for new debt than companies with better credit.)

EXCLUSIVE LOOK INSIDE: Citigroup is a holding in Jim Cramer's Action Alerts PLUS charitable trust portfolio. Want to be alerted before Cramer and the AAP team buy or sell the stock? Learn more now.

A major concern is the big rush by individual investors into high-yield bond ETFs in recent years. According to Morningstar, assets in the ETFs have increased by 41% since 2012 to $44.8 billion.

Brokerage firms including Barclays and some big investors like the legendary junk-bond investor Carl Icahn have warned that junk-bond ETFs could face steep losses in a market reversal. A vicious circle could begin, where funds start selling assets to meet investor redemptions; then, due to a general lack of liquidity in the market, junk-bond prices would probably fall rapidly, in turn fueling more selling.

"One needs to begin questioning valuations when fundamental risks appear to be forming in various sectors while the Fed continues to indicate further tightening of financial conditions," the Bank of America analysts wrote.

Read More Trending Articles:

More from Rates and Bonds

Long-Term Rates, Not the Fed, Influence Stocks

Long-Term Rates, Not the Fed, Influence Stocks

Rates Are 'About Right,' Says Federal Reserve's Bullard

Rates Are 'About Right,' Says Federal Reserve's Bullard

What Is Present Value and How Is It Calculated?

What Is Present Value and How Is It Calculated?

Economist Perspective: Supply, Supply, Supply

Economist Perspective: Supply, Supply, Supply

Federal Reserve Will Review How Well It Makes Policy and Communicates

Federal Reserve Will Review How Well It Makes Policy and Communicates