WASHINGTON — The $5.1 billion that JPMorgan Chase has agreed to pay hardly ends its legal troubles over mortgage securities it sold. It’s merely a down payment.

JPMorgan still faces heavy financial burdens. The bank has set aside $23 billion to cover legal costs — and it may need it all.