Colorectal cancer (CRC) is a major global health concern, resulting in numerous cancer-related deaths. CRC detection, treatment, and prevention can be improved by identifying genes and biomarkers. Despite extensive research, the underlying mechanisms of CRC remain elusive, and previously identified biomarkers have not yielded satisfactory insights. This shortfall may be attributed to the predominance of univariate analysis methods, which overlook potential combinations of variants and genes contributing to disease development. Here, we address this knowledge gap by presenting a novel multivariate machine-learning strategy to pinpoint genes associated with CRC. Additionally, we applied our analysis pipeline to Inflammatory Bowel Disease (IBD), as IBD patients face substantial CRC risk. The importance of the identified genes was substantiated by rigorous validation across numerous independent datasets. Several of the discovered genes have been previously linked to CRC, while others represent novel findings warranting further investigation. A Python implementation of our pipeline can be accessed publicly at https://github.com/AriaSar/CRCIBD-ML.