The two-year US Treasury yield surged to 4% for the first time since June amid a global selloff in government debt as the war in the Middle East intensifies.