Major surgeries, including those for cancer, can also temporarily weaken the immune system. The physical stress of surgery and the recovery period can divert the body's resources away from maintaining immune function. Additionally, the use of immunosuppressive drugs to prevent complications can further weaken the immune response.