Thyroid-associated ophthalmopathy (TAO) is the most common autoimmune inflammatory diseases of the orbit. The CD40-CD40L pathway has been regarded as a potential molecular mechanism contributing to the development and progression of TAO, and RNA aptamers with specific binding affinity to CD40 (CD40Apt) represents a promising inhibitor of the CD40-CD40L signaling in TAO treatment. In this study, CD40Apt was confirmed to specifically recognize mouse CD40-positive ortibtal fibroblast. Mouse orbital fibroblasts were isolated from TAO mice model orbital tissues and validated. In TGF-β-induced orbital fibroblast activation model in vitro, CD40Apt administration inhibited TGF-β-induced cell viability, decreased TGF-β-induced α-SMA, Collagen I, Timp-1, and vimentin levels, and suppressed TGF-β-induced phosphorylation of Erk, p38, JNK, and NF-κB. In TAO mice model in vivo, CD40Apt caused no significant differences to the body weight of mice; furthermore, CD40Apt improved the eyelid broadening, ameliorated inflammatory infiltration and the hyperplasia in orbital muscle and adipose tissues in model mice. Concerning orbital fibroblast activation, CD40Apt reduced the levels of CD40, collagen I, TGF-β, and α-SMA in orbital muscle and adipose tissues of model mice. Finally, CD40Apt administration significantly suppressed Erk, p38, JNK, and NF-κB phosphorylation. In conclusion, CD40Apt, specifically binds to CD40 proteins in their natural state on the cell surface with high affinity, could suppress mouse orbital fibroblast activation, therefore improving TAO in mice model through the CD40 and downstream signaling pathways. CD40Apt represents a promising antagonist of the CD40-CD40L signaling for TAO treatment.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12967-023-04217-0.