EGPWS/TAWS is the fix for this problem...
The original Ground Proximity Warning Systems were indeed quite limited due to their inability to know anything about anything besides what was under the plane at the time. While one could theoretically use ground-mapping radar techniques similar to military terrain following radar for this, that would be dancing in a minefield of classification and relatively advanced signal processing, making it impractical for use in the civil aviation environment.
Instead, EGPWS (enhanced ground proximity warning system)/TAWS uses the aircraft's idea of its own position (from the onboard navigation systems) along with a database of terrain info to generate forward looking warnings in addition to the more straightforward radio-altimeter warnings generated by GPWS. This is what is found on basically all aircraft in mainline airline service these days, as well as many more modern business jets and commuter-type aircraft as well.
but even TAWS won't save you if you're getting lied to about where you are!
Nonetheless, it's still possible to have a non-pilot-error CFIT in an EGPWS/TAWS equipped aircraft -- on one fateful day in Ethiopia, a British Mediterranean Airlines A320 nearly became a crater twice over thanks to the ADS VOR/DME providing bad bearing information to anyone who tried to use it as a navaid -- without GPS, the only thing the TAWS had to go on was the VOR-updated IRU position, which was being thrown off by the bad data from the ADS VOR. Luckily for the passengers, the crew had their wits about them and caught the situation before smashing into the ground, but even with GPS being nearly universal in airliners compared to its prevalence in 2003, interference, spoofing, or jamming of GPS signals is still a threat, as this year's Red Flag exercises are reminding us quite vividly by taking out GPS service across much of the western CONUS.