Understanding upstream flame propagation in scramjets is challenging, particularly concerning flame flashback in a combustor with a novel strut-cavity flame holder. Two-dimensional unsteady Reynolds-averaged Navier–Stokes (URANS) simulations were performed to investigate how Mach number and wall divergence affect flame behavior. The utility of the strut-cavity flame holder was highlighted through a study of its non-reacting flow characteristics. Flow dynamics are significantly altered as the shear layer above the cavity interacts with the downstream hydrogen jet. Shear layer dynamics and fuel-air mixing are improved through key factors such as shock-train behavior, cavity oscillations, and transverse fuel injection. The submerged fuel jet is less exposed to supersonic flow and demonstrates reduced entropy rise, achieving a 16% increase in mixing efficiency compared to standalone struts and a 46% improvement over transverse injection without a flame holder. Thermal choking shifts the shock train upstream, facilitating interactions with the shear layer and enhancing vortex formation, which decreases flow speed and promotes upstream flame propagation. The presence of OH radicals indicates that flame flashback follows a periodic pattern with an initial gradual slope, suggesting effective anchoring. Stability and flashback likelihood are affected by low-speed zones, vortex merging, and wall divergence. At Mach 3, combustion efficiency improves without wall divergence due to increased heat release, while wall divergence prevents flame flashback by sustaining supersonic core flow and managing flow-flame interactions. At higher core flow velocities, flame stabilization occurs at the cavity's separation corner, despite a tendency for upstream propagation, with validation of the URANS results achieved through two-dimensional large eddy simulations.