A computational investigation has been conducted to study the effect and mechanisms of the passive control of a supersonic flow over a rectangular two-dimensional cavity. The passive control was included through the use of a porous surface over a vent chamber in the floor of the cavity.The passive control effectively suppressed the low-frequency pressure oscillations for the open type cavity, (length-to-depth ratio = 6.0). The mechanism for the suppression was observed to be the stabilization of the motion of the free shear layer. For the closed type cavity flow, (length-to-depth ratio = 17.5), the passive control modified the flow field to nearly that of an open type cavity flow; further the cavity drag was reduced by a factor of 4. The computational results of both cases showed good agreement with the available experimental data and the predictions of a semi-empirical formula.This study demonstrates that the passive control concept can be used to improve the aerodynamic characteristics of open and closed cavity flow fields.