  We propose a novel mechanism of impurity screening in (1+1)$d$ quantum
critical states described by conformal field theories (CFTs). An impurity can
be screened if it has the same quantum numbers as some gapless degrees of
freedom of the CFT. The common source of these degrees of freedom is the chiral
primary fields of the CFT, but we uncover that topological defect lines of the
CFT may also take this role. Theoretical analysis relies on the insight that
the impurities can be interpreted as edge modes of certain symmetry-protected
topological (SPT) states. By stacking a SPT state with a CFT, one or two
interfaces on which the SPT edge modes reside are created. If screening occurs
due to topological defect lines, a symmetry-enriched CFT with exotic boundary
states are obtained. The boundary conditions that appear in these cases are
difficult to achieve using previously known methods. Numerical simulations are
performed in two quantum spin chains whose bulks are described by the
SU(3)$_{1}$ and Spin(5)$_{1}$ CFTs and edges are coupled to spin-1/2
impurities. In both cases, low-energy eigenvalues are consistent with
analytical predictions.
