How can I check if iPhone has been manipulated or compromised firmware?
Typically these modifications are not sustained beyond reboot. The ones that were are called ‘untethered’ and the last one im aware of that was 9.3.4. If the iOS version is beyond that it would almost certainly have to be of the ‘tethered’ variety and simply rebooting the phone should disable any such modifications

Additionally if there is a newer iOS version available to update, doing so will break any access to the files required to remodify the phone in the future and new files will be required to redo the process at that point.