Due to the flexibility of the towed line array, shear currents caused by an internal solitary wave (ISW) distort the array shape. This will lead to a mismatch between the conventional target detection algorithm and the array shape, resulting in a significant decline in the performance of the towed line array gain, azimuth resolution, etc. Based on the improved motion model of towed cable constructed by Ablow and Schechter (Ocean Eng, 10: 443–457, 1983), we propose a motion model of the towed line array under an ISW according to the Korteweg-De Vries (KdV) equation and solve the model by finite difference method combined with the Newton iteration method. In addition, the DFT beamforming theory is used to detect the target signal after the array shape distortion compensation to verify the validity of the model. The data analysis shows that the array shape distortion caused by the ISW is mainly affected by the relative position between the array and the ISW, the amplitude of the ISW, the fluid layer density, the fluid layer depth, the towing velocity, the tangential/normal drag coefficient, the elastic modulus, and the towed cable density. The influence of elastic modulus and the towed cable density on array shape distortion can be ignored. The detection results show that the output signal power is about 6 dB higher than the output noise power, and the array gain and azimuth resolution are improved after array shape distortion compensation.