It’s the “shock” market rally — cash-rich US companies have plunged nearly $4 trillion of their cash into buying back their stock since 2008, which is why all the stock indexes are hovering near record territory.

“It has massively manipulated the market,” said Richard Bowen, the former Citi executive who blew the whistle on the bank during the subprime mortgage crisis, and noted how these share buybacks in the open market were once deemed illegal. The Securities and Exchange Commission eased the rules in the early ’80s.

“This market scares the crap out of me,” Bowen, sensing a potential financial disaster, told The Post.

The buyback binge is not isolated to market giants like Apple, which spent $7.2 billion in the first three months of this year on stock buybacks. Crowd-sourcing review site Yelp’s board just approved a 200 million share repurchase.

Even Bowen’s former employer, Citigroup, recently announced a whopping $15.6 billion stock buyback.

Critics wonder if this is the best use of cash for a company. But the effect on stock price and CEO bonuses make this a win-win for management.

The bonuses are tied to better earnings when a company buys its shares back, because it retires the shares. So the next quarter’s earnings will improve, because the formula for earnings-per-share basis, has a smaller denominator.

In this low-interest environment, many companies, including Apple, are borrowing money to buy back shares, not even dipping into their own coffers.

“We’ve been in a market bubble for a long time, and share buybacks are a big part of the bubble made possible by artificially low interest rates that still exist today,” said financial commentator Peter Schiff.

These repurchase programs are responsible for most of the net inflows into US equities in the latest bull market, one study shows, and it has only grown since the Great Recession.

In the three-year period ending in 2012, 449 companies in the S&P 500 index deployed 54 percent of their earnings, or $2.4 trillion, buying back their own stock, according to another study.

Last year, a whopping 66 percent of corporate earnings went to buybacks.

Bowen says he’s worried, because for most Americans, the stock market is a display of public confidence. But it may all be a huge fantasy, Bowen added, a Ponzi scheme that will end in tears.

Schiff says that could occur if interest rates keep rising, ensnaring corporations that financed stock repurchases with debt. “They are going to have to sell their stock to repay the debt they can’t afford,” he said. “That’s going to end up destroying a lot of shareholder value if corporations have to sell equity into a bear market.”

Howard Silverblatt, senior index analyst at S&P Dow Jones Indices, is not as fearful, saying much corporate long-term debt has been refinanced, and carries low interest rates.