Under a provision of immigration law, Congress has already delegated to the president broad power to issue a proclamation indefinitely blocking “the entry of any class of aliens into the United States” that he or she thinks would be “detrimental to the interests of the United States.” No president has ever used that power in such a sweeping way, but the text provides a potential statutory basis for a President Trump to carry out his plan, specialists said.

Still, if Mr. Trump won the White House and invoked that power as a justification to bar all foreign Muslims, people affected by that policy inside the United States — like a person seeking reunification with a family member, or a university that wanted to invite someone to come speak — could file a lawsuit challenging it.

Several legal questions would be raised by such a policy.

First, as a matter of international law, a treaty the United States has ratified, the International Covenant on Civil and Political Rights, bars laws that discriminate against people because of their religion. It protects “all persons,” not just citizens of a member state.

But any lawsuit invoking that provision of the treaty would face an uphill struggle, the specialists said, because Congress has not acted to make that provision enforceable by domestic courts. So even if Mr. Trump’s policy clearly violated the provision, it is doubtful that the Supreme Court would decide that the treaty provided the judiciary with authority to strike the policy down, the specialists said.