This was done before in 2011 also and the answer is the same as it was then.
Social Security holds $2.6 trillion in special-issue Treasury securities. Those bonds are part of the $14.3 trillion debt amassed by the U.S. government, and benefits are paid out of those securities.
So, the theory goes, if Treasury redeemed the needed Social Security bonds, and issued new marketable Treasury bonds to make good on the Social Security bonds, it would be a one for one swap and the debt ceiling would not be increased.
There is a technical wrinkle involving the fact that payroll taxes that are collected are supposed to be immediately turned into Treasury securities, but there could be ways around that, such as putting the monies in a noninterest bearing account, as during the 1985 debt crisis.
[...]
“I’m now 99.9 percent positive that Treasury has legal authority to pay Social Security benefits in both cases of a government shutdown and hitting the debt limit, since the payment of benefits shouldn’t affect the debt limit because it reduces the trust funds to the exact extent that it increase publicly-held debt,” Fichtner said. “What I don’t know is whether Treasury has to pay benefits if it chooses not to.”
Dean Baker, co-director of the Center for Economic and Policy Research who has derided “the phony crisis” of Social Security, also believes the checks could keep flowing. “I would think that they could legally pay Social Security by reducing the obligations of the fund,” he said. “It no doubt would be a huge political issue.”