Hoping to retire before you turn 70? Too bad.

The world's richest countries need to drastically hike their retirement ages in order to prevent pension systems from collapsing, according to the World Economic Forum.

Working until at least 70 should become the norm by 2050, the group recommends in a new report. The average retirement age is currently 65 for men in advanced economies and 63 for women.

Here's the problem: People are living longer than ever, but the average retirement age has remained static. Pension funds have been unable to keep pace.

It's a trend that will only accelerate: Babies born today in many advanced economies can expect to live past 100.

WEF described the shortfall in pension funding and a lack of personal retirement savings as a "timebomb."

The group estimated that just eight countries -- the U.S. U.K., Japan, Canada, Australia, India, China and the Netherlands -- face a combined shortfall of $400 trillion by 2050.

"We must address it now or accept that its adverse consequences will haunt future generations, putting an impossible strain on our children and grandchildren," said WEF official Michael Drexler.

Related: How to enjoy a more worry-free retirement

Americans face the largest gap between what they'll need and what they've saved: the collective shortfall hit $28 trillion in 2015 and will rise to $137 trillion in 2050.

WEF said the gap has been fueled by aging populations, but "significantly lower" investment returns over the past decade have also played a role. Returns on stock investments are five percentage points below long-term averages, for example.

WEF said that governments should quickly take action to protect their citizens.

In addition to reviewing their retirement ages, the group recommended countries make it easier for people to save. They should also work to improve financial literacy so that workers are able to understand their retirement savings options.