The existing conventions do not prohibit attacking militants while they are in the middle of civilians, even if they are not doing that as part of some hostage/human shield operation. It may be considered morally not ok, but doing so does not violate any obligation.