  Reference-frame-independent measurement-device-independent quantum key
distribution (RFI-MDI-QKD) can remove all potential detector side-channel
attacks and the requirement of real-time alignment of reference frames.
However, all previous RFI-MDI-QKD implementations assume the perfect state
preparation in sources, which is impractical and may lead to security
loopholes. Here, we propose a RFI-MDI-QKD protocol which is robust against
state preparation flaws. Comparing to the conventional six-state RFI-MDI-QKD,
our scheme can be realized with only four flawed states, which improves the
practical security of RFI-MDI-QKD and simplifies the experimental
implementation. In addition, simulation results demonstrate that source flaws
in Z basis have adverse effect on the performance of RFI-MDI-QKD while the
source flaws in X and Y bases have almost no effect. We hope that this work
could provide a valuable reference for practical implementations of
RFI-MDI-QKD.
