Pulmonary fibrosis (PF) is a chronic progressive disease that portends a very poor prognosis. It has been suggested that STAT3 is a potential target in PF. This study highlights the importance of cubosomes as a drug delivery system in enhancing the bioavailability of nifuroxazide (NXZD), a poorly soluble STAT3 inhibitor. NXZD-loaded cubosomes (NXZD-LC) were in vitro and in vivo evaluated. In vitro, cubosomes presented a poly-angular nanosized particles with a mean size and zeta potential of 223.73 ± 4.73 nm and − 20.93 ± 2.38 mV, respectively. The entrapment efficiency of nifuroxazide was 90.56 ± 4.25%. The in vivo pharmacokinetic study and the lung tissue accumulation of NXZD were performed by liquid chromatography-tandem mass spectrometry after oral administration to rats. The nanoparticles exhibited a two-fold increase and 1.33 times of bioavailability and lung tissue concentration of NXZD compared to NXZD dispersion, respectively. In view of this, NXZD-LC effectively attenuated PF by targeting STAT3 and NF-κB signals. As a result, NXZD-LC showed a potential anti-inflammatory effect as revealed by the significant decrease in MCP-1, ICAM-1, IL-6, and TNF-α and suppressed fibrogenic mediators as indicated by the significant reduction in TGF-β, TIMP-1, and PDGF-BB in lung tissues. Besides, NXZD-LC improved antioxidant defense mechanisms and decreased LDH and BALF total protein. These effects contributed to decreased collagen deposition. To conclude, cubosomes represent an advantageous pharmaceutical delivery system for enhancing pulmonary delivery of poorly soluble drugs. Additionally, repurposing NXZD as an antifibrotic agent is a promising challenge and new therapeutic approach for unmet therapeutic needs.