For a blood-borne cancer therapeutic agent to be effective, it must cross the blood vessel wall to reach cancer cells in adequate quantities, and it must overcome the resistance conferred by the local microenvironment around cancer cells. The brain microenvironment can thwart the effectiveness of drugs against primary brain tumours as well as brain metastases. In this Review, we highlight the cellular and molecular components of the blood-brain barrier (BBB), a specialized neurovascular unit evolved to maintain brain homeostasis. Tumours are known to compromise the integrity of the BBB, resulting in a vasculature known as the blood-tumour barrier (BTB), which is highly heterogeneous and characterized by numerous distinct features, including non-uniform permeability and active efflux of molecules. We discuss the challenges posed by the BBB and BTB for drug delivery, how multiple cell types dictate BBB function and the role of the BTB in disease progression and treatment. Finally, we highlight emerging molecular, cellular and physical strategies to improve drug delivery across the BBB and BTB and discuss their impact on improving conventional as well as emerging treatments, such as immune checkpoint inhibitors and engineered T cells. A deeper understanding of the BBB and BTB through the application of single-cell sequencing and imaging techniques, and the development of biomarkers of BBB integrity along with systems biology approaches, should enable new personalized treatment strategies for primary brain malignancies and brain metastases.