Patients with cirrhosis commonly undergo endoscopic cyanoacrylate injection for gastric and esophageal variceal bleeding. However, postoperative infections can increase the risk of rebleeding and mortality. This study aimed to determine the risk of postoperative infections and its associated factors following cyanoacrylate injection treatment in these patients. A retrospective analysis was conducted on 57 patients treated with ligation (ligation group), 66 patients treated with cyanoacrylate injection (injection group), and 91 patients treated with conservative treatment (control group) at the Nanchong Central Hospital. The rate of postoperative infection was similar among the cyanoacrylate, ligation, and conservative treatment groups, with no significant statistical difference observed ( P = 0.97). Multivariate analysis identified postoperative Child-Pugh score and renal insufficiency as two independent risk factors for postoperative infection. The rebleeding rate in the injection group was significantly lower than in the other groups ( P = 0.01). Mortality was significantly higher in the control group compared with the ligation and injection groups ( P = 0.01). Cyanoacrylate combined with lauromacrogol injection did not significantly increase the risk of infection compared with ligation and conservative treatments, and it was more effective in reducing the risk of rebleeding. This method is safe, effective, and holds clinical value for broader application.