The leading-edge contamination (LEC) problem of an infinite-swept wing is computed by solving the full two-dimensional Navier–Stokes equation using a very high spectral accuracy compact scheme. The initial condition is given by the steady attachment-line boundary layer forming over the leading-edge of an infinite swept wing or a yawed cylinder. The contamination is shown as due to either a convecting or a stationary vortex far outside the attachment-line boundary layer at the leading edge. This mechanism is proposed to account for the sub-critical instability onset observed for attachment-line boundary layer. (The criticality is for Reynolds number (based on momentum thickness) exceeding 100––an empirically suggested value based on earlier experiments.) The presented results show the problem to be essentially two-dimensional. Inflow and outflow of computational domain are chosen so that we consider cases of both sub- and super-critical instabilities. The receptivity mechanism of leading-edge contamination for both cases is investigated with respect to different parameters. Finally, we have also analyzed the computed solutions by proper orthogonal decomposition (POD) to highlight the low-dimensional nature and to provide a quantitative measure of leading-edge contamination events.