Shape measurement of single nanoparticles in fluids is an outstanding challenge with applications in characterizing synthetic functional nanoparticles and in early warning detection of rod-shaped pathogens in water supplies. Here we introduce a novel technique to measure the aspect ratio of rod-shaped particles by analyzing changes in the polarization state of a laser beam transmitted through an optical microcavity through which the particle diffuses. The resolution in aspect ratio measurement is found to be around 1%. Our work opens the new possibility of in situ and single-particle shape measurement, which has promising applications in nanoparticle characterization, water monitoring, and beyond.