Jang et al. show that disruption of oral-gut microbial compartmentalization characterizes gastrointestinal cancers. By quantifying mouth-to-feces microbial transmission, they identify robust diagnostic signatures that accurately classify gastric and colorectal cancers across seven independent cohorts, highlighting a new non-invasive framework for microbiome-based cancer detection.