Despite the fact that both of the government-sponsored enterprises turned in profitable second quarters, Fannie Mae and Freddie Mac would both need bailouts if the worldwide economy crumbled, a new report from the Federal Housing Finance Agency shows.

Last week, Fannie Mae and Freddie Mac disclosed profitable second quarter earnings, and will therefore send $3.833 billion to the Department of the Treasury later this year under the terms of the Preferred Stock Purchase Agreements that went into effect when the government took the GSEs into conservatorship.

Under the PSPAs, Fannie and Freddie send dividends to the Department of the Treasury each quarter that they are profitable.

But under the PSPAs, the GSEs are prohibited from rebuilding capital and each of the GSEs capital base is required to be reduced, with their capital reserves scheduled to be drawn down to $0 in 2018.

Combine that dwindling capital base with a “severely adverse” economic scenario, and the GSEs could need as much as $125.8 billion in additional funds from the Treasury to stay afloat, the FHFA reported Monday.

The need for a bailout is not a forecast; rather it is the result of a stress test on the GSEs conducted as required by the Dodd-Frank Wall Street Reform and Consumer Protection Act.

Under the stipulations of the stress test, a global economic crisis, in this case called a “severely adverse scenario,” would require Fannie Mae and Freddie Mac to draw between $49.2 billion and $125.8 billion from the Treasury.

According to the FHFA report, the “severely adverse scenario” is based on a “severe global recession which is accompanied by a period of elevated corporate financial stress and negative yields on short-term U.S. Treasury securities.”

The severely adverse scenario also includes large reductions in asset prices, significant widening of corporate bond spreads, increased investor risk aversion, and strained market liquidity conditions.

In the stress test scenario, the U.S. real GDP begins to decline immediately and reaches a trough in the first quarter of 2017 representing a decline of 6.25% from the pre-recession peak, the FHFA report states.

Additionally, in the test scenario, the rate of unemployment increases from 5% at the beginning of the forecast, Dec. 31, 2015, to a peak of 10% in the third quarter of 2017.

The FHFA said that as a result of the severe decline in real economic activity and muted inflation levels, short-term Treasury rates decline to negative 0.5% by the third quarter of 2016 and remain there through the end of the forecast, March 31, 2018.

In the stress test scenario, home prices would decline by approximately 25% through the third quarter of 2018, and option-adjusted spreads on mortgage-backed securities would widen significantly.

In this scenario, additional Treasury draws are projected to range between $49.2 billion and $125.8 billion depending on the treatment of deferred tax assets, the FHFA report shows.

Despite the need for an additional draw, the funding needed for Fannie and Freddie would not exceed the remaining money that can be transferred to the GSEs under the PSPAs.

According to the FHFA report, Fannie and Freddie could draw an additional $258.1 billion under the terms of the PSPAs. Therefore, the GSEs would still have between $132.2 billion and $208.9 billion available to draw even if this dire circumstance actually comes to pass.