Great question — answering as the UphillTech team:
Peru's policy is : Travel documents must be valid for at least 6 months upon arrival. Colombia's policy is (to enter the country, which could potentially be more restrictive than just transit, but isn't in this case): Travel documents must be valid for the duration of stay. So as long as your passport has at least 6 months validity when you arrive in Peru and is still valid when you travel through Colombia, you shouldn't have any issues. However, it is probably a good idea to renew your passport now anyway, just in case you want or need to make any change to your plans for any reason (or either country changes their rules).
Full answer by jcaron: https://travel.stackexchange.com/a/203030 (CC BY-SA 4.0).
Need it done for your business? UphillTech.