Libyan gains may offer ISIS a base for new attacks