Finally, two potential compounds (CH and MAN) targeting CTSG protein were identified, and their reliability was validated through molecular docking analysis. CTSG was associated with immune infiltration and had prognostic value in HNSCC patients, which may be a potential biomarker for predicting the outcome of immunotherapy.