Legal. Congress authorized the President to attack ISIS. Their bases in Syria are covered under the international law concept of "hot pursuit".
No different than following the Viet Cong into Cammbodia and Laos in the Viet Nam war. Perfectly legal.
Yeah, that worked out well. For Kerry, at least. I wonder if he will Christmas in Appelo.