This article investigates the detection and defense method of timeâvarying formation for unmanned aerial vehicles (UAVs) against external disturbance and false data injection attacks (FDIAs). First, to detection attacks, a distributed attack identification filter is constructed for each UAV. Second, two distributed extended state observers are designed to separate and estimate external disturbances and FDIAs. Third, the distributed timeâvarying formation tracking protocol and defense strategy for attacks is designed by utilizing the estimated information. The formation system is shown to asymptotically track the desired formation and trajectory and meanwhile reject the disturbance and attacks if the expected formation satisfies the feasible condition by stability analysis. Finally, a numerical example is provided to demonstrate the effectiveness of the proposed approach.