Case law on this seemingly requires some nexus to a border. In Almeida-Sanchez v US[0], a Mexican citizen was stopped while driving on an east-west road that was near the border but that didn't connect to the border. The marijuana that was found in his car was excluded because there was no proof he was actually crossing a border, just near it.
So I'd expect, under a functioning legal system, a warrant would be required to search your phone if you landed in JFK on a flight from Altoona.
This jogged my memory, though I couldn't find the example I was thinking of. But here's an item that is pretty similar:
https://en.wikipedia.org/wiki/Tenaha,_Texas_asset_forfeiture...
Edit: Not on the border, btw. Just people travelling inside US. I guess it was their mistake to carry cash instead of getting a bank check or something.
no need to imagine
https://en.wikipedia.org/wiki/Civil_forfeiture_in_the_United...