But officials leading agencies in homeland security who echo Mr. Trump’s fiery language on immigration were initially deemed ineligible under the federal Vacancies Act. The law states that acting officials who take over cabinet-level positions must be next in the line of succession, have the approval of the Senate or have served 90 days under the previous secretary.

The White House, however, is exploring a loophole in the law, according to an administration official. Under this route, the White House would tap someone to be the assistant secretary of the Countering Weapons of Mass Destruction Office, which is vacant, and then elevate that person to be the acting secretary of homeland security.

The chief of that office is known as an “inferior officer,” and under an exception in the laws governing appointments, such officials can be appointed to acting positions with the sole approval of the president, the official said.