Corporate America, egged on by ridiculously-low borrowing costs, has built up more debt than any time since the end of the Great Recession.

The credit binge has allowed companies to grow faster, invest in the future and reward shareholders with huge dividends and share buybacks.

Yet elevated levels of debt will also make businesses vulnerable when the next recession strikes or if borrowing costs spike because of rising interest rates. Either outcome will make it harder for Corporate America to pay back the $4 trillion of debt coming due by 2022.

This risk has been underlined by the recent surge in Treasury yields and rising concerns that inflation could force the Federal Reserve to consider aggressive rate hikes.

"Removing the easy money punch bowl could trigger the next default cycle," S&P Global Ratings wrote in a recent report titled "Debt high, defaults low -- something's gotta give."

For nearly a decade, companies have taken advantage of extremely cheap money set by the Fed and foreign central banks trying to pump up sluggish growth.

Excluding the highly leveraged financial sector, corporate debt relative to GDP matched an all-time high during the third quarter of 2017, according to an analysis of the most recent numbers by Informa Financial Intelligence.

"It's certainly a reason to be cautious, particularly when we are long into this growth cycle and the Fed is raising rates," said David Ader, chief macro strategist at Informa Financial Intelligence.

"Everything is fine and well -- until it isn't," he said.

Related: Ray Dalio: 70% chance of recession before 2020

Financial regulators, on guard for signs of another crisis, are paying close attention to the build-up of corporate debt.

"Leverage in the nonfinancial business sector remains high, with net issuance of risky debt climbing in recent months," the Fed said on Friday in a semiannual report to Congress. Although the Fed believes "vulnerabilities" here are "moderate," it warned that business sector leverage is "elevated."

Credit risk in the corporate sector has been on the rise, according to an early warning monitor of risks to financial stability run by the Treasury Department's Office of Financial Research.

Two key business debt metrics studied by the OFR have been flashing "red" since early 2016 after years of more moderate risk in this space.

S&P estimates that about $4.4 trillion of corporate debt is scheduled to mature through 2022, including $1.3 trillion of junk bonds issued to risky companies.

"We consider a sharper-than-expected rise in inflation or interest rates to be a potential risk for corporate funding," S&P wrote.

The other issue is that many companies pay interest based on what the bond market is doing. If rates rise, as they have recently, interest expenses go up.

Related: Tax cut scorecard: Workers $6B; Shareholders $171B

The good news is that while overall debt may have returned to Great Recession levels, excessive debt has not. S&P estimates that 27% of U.S. corporate debt is from "highly leveraged" companies, compared with 42% in 2007.

Corporate America is also minting money right now, thanks to the roaring U.S. and global economy. Booming corporate profits, for as long as they last, should overshadow any modest uptick in borrowing costs.

"A strong economy can support higher rates," said Frank Rybinski, director of macro strategy at Aegon Asset Management. "At this point, I'm not very concerned."

Not only is the economy gathering steam, but the Republican tax overhaul is creating a huge windfall for many companies. They can use their tax savings, as well as repatriated foreign profits, to pay down debt.

S&P said the corporate tax rate cut "could help cash flows, extending this stage of the cycle, albeit at the risk of more aggressive Fed tightening."

Yet certain provisions in the tax overhaul could make life tougher for some companies that have borrowed heavily. Specifically, the tax law reduces companies' ability to deduct interest payments from their tax bill, creating a headwind.

"As earnings decline in a downturn, the new tax rules will exacerbate any reduction in cash flow and could lead to a higher default rate," Moody's wrote in a recent report.

The credit ratings firm estimates that high-leverage companies have $424 billion of debt coming due between 2018 and 2022.

"The torrid pace of new debt since 2012 has increased the volume of debt companies will need to refinance down the road," Moody's wrote.