In this paper, a one-dimensional two-phase inverse Stefan problem is studied. The free surface is considered unknown here, which is more realistic from the practical point of view. The problem is ill-posed since small errors in the input data can lead to large deviations from the desired solution. To obtain a stable numerical solution, we propose a method based on discrete mollification combined with space marching. We use the integration matrix in Bernstein polynomial basis for the discrete mollification method. Through this method, our numerical integration does not involve any direct function integration and only contains algebraic calculations. Furthermore, the stability and convergence of the process are proved. Finally, the results of this paper are illustrated and examined through some numerical examples. The numerical examples supporting our theoretical analysis are provided and discussed. [ABSTRACT FROM AUTHOR]