Intracranial aneurysm (IA) is a localized abnormal dilation of the cerebral vascular wall, the degeneration of which is closely related to high oxidative stress. Clinical information and RNA-seq data from five public datasets were downloaded from the Gene Expression Omnibus (GEO). Using the "GSVA" package, enrichment analysis was performed on the gene sets of the oxidative stress, reactive oxygen species (ROS), metabolism, and inflammatory pathways retrieved from the MsigDB and Kyoto encyclopedia of genes and genomes (KEGG) databases. Weighted gene co-expression network analysis (WGCNA) was conducted using the "WGCNA" package, followed by using the "limma" R package to select differentially expressed genes (DEGs). Key genes were determined by applying three machine learning algorithms (random forest, Lasso, and SVM-RFE). The expression levels of the key genes were verified by the quantitative real-time polymerase chain reaction (qRT-PCR) in IA. Finally, ESTIMATE and CIBERPSORT algorithms were used for immune infiltration analysis. The enrichment score of the oxidative stress, ROS, metabolism, and inflammatory pathways was calculated, and we found that these pathways were significantly activated in IA samples with higher immune infiltration. The intersection between the blue module related to oxidative stress (610 genes identified by WGCNA) and 380 upregulated DEGs contained a total of 209 key genes, which were further processed by machine learning algorithms to obtain four crucial diagnostic markers (FLVCR2, SDSL, TBC1D2, and SLC31A1) for IA. These key genes are highly expressed in human brain vascular smooth muscle cells. The expressions of the four markers were significantly positively correlated with the abnormal activation phenotypes of oxidative stress, the ROS and glucometabolic pathways, and suppressive immune infiltration. This study employed WGCNA combined with three machine learning algorithms to identify four oxidative stress-related signature markers for IA, providing novel insights into the clinical management of IA patients.