Cancer can significantly impact cortisol levels in several ways. Firstly, the diagnosis and treatment of cancer itself can be highly stressful, leading to elevated cortisol levels. Secondly, certain types of cancer, such as adrenal tumors, can directly affect the adrenal glands' ability to produce cortisol. Additionally, cancer treatments like chemotherapy and radiation can disrupt the endocrine system, affecting cortisol production and regulation.