A Study Evaluating Whether Pembrolizumab Alone or in Combination With CMP-001 Improves Efficacy of Treatment in Patients With Operable Melanoma

This phase II trial studies the effect of pembrolizumab alone or in combination with CMP-001 in treating patients with melanoma that can be treated by surgery (operable). Immunotherapy with monoclonal antibodies, such as pembrolizumab, may help the body's immune system attack the cancer, and may interfere with the ability of tumor cells to grow and spread. Immunotherapy with CMP-001 may induce changes in body's immune system and may interfere with the ability of tumor cells to grow and spread. The addition of CMP-001 to pembrolizumab could improve the ability of the immune system to shrink tumors and to prevent them from returning.

PRIMARY OBJECTIVE:

I. To evaluate the rate of pathologic complete response (pCR) rate in patients in each arm.

SECONDARY OBJECTIVES:

I. To evaluate the rate of pathologic near-complete/major response (pMR) of the neoadjuvant therapy in each arm.

II. To evaluate the pathologic response rate of un-injected lesions on the combination arm (Arm B).

III. To evaluate relapse-free survival (RFS) in each arm. IV. To evaluate overall survival (OS) in each arm. V. To evaluate the preoperative radiographic response rate in each arm. VI. To evaluate safety and toxicity of neoadjuvant therapy in each arm.

OUTLINE: Patients are randomized to 1 of 2 arms.

ARM A:

NEOADJUVANT PHASE: Patients receive pembrolizumab intravenously (IV) over 30 minutes on day 1 of each cycle. Treatment repeats every 21 days for up to 3 cycles in the absence of disease progression or unacceptable toxicity.

SURGERY: Patients undergo surgery 1-2 weeks after completion of neoadjuvant phase.

ADJUVANT PHASE: After recovery from surgery, patients receive pembrolizumab IV over 30 minutes on day 1 of every other cycle. Treatment repeats every 21 days for up to 16 cycles in the absence of disease progression or unacceptable toxicity.

Patients also undergo computed tomography (CT) or positron emission tomography (PET)/CT throughout the trial and may undergo optional biopsy at baseline and disease progression and optional collection of blood samples throughout the trial.

ARM B:

NEOADJUVANT PHASE: Patients receive VLP-encapsulated TLR9 agonist CMP-001 (CMP-001) subcutaneously (SC) on day 1 of cycle 1 and then intratumorally on days 8 and 15 of cycle 1, days 1, 8, and 15 of cycle 2, and day 1 of cycle 3. Patients also receive pembrolizumab IV over 30 minutes on day 8 of each cycle. Treatment repeats every 21 days for up to 3 cycles in the absence of disease progression or unacceptable toxicity.

SURGERY: Patients undergo surgery 1-2 weeks after completion of neoadjuvant phase.

ADJUVANT PHASE: After recovery from surgery, patients receive pembrolizumab IV over 30 minutes on day 1 of every other cycle. Treatment repeats every 21 days for up to 16 cycles in the absence of disease progression or unacceptable toxicity.

Patients also undergo CT or PET/CT throughout the trial and may undergo optional biopsy at baseline and disease progression and optional collection of blood samples throughout the trial.

After completion of study treatment, patients are followed up at 30 days and then every 3 months if \< 2 years from study entry, every 6 months if 2-5 years from study entry, and every 12 months if \> 5 years from study entry for up to 10 years (15 years total follow up).

Eligibility Criteria:
Inclusion Criteria:

* Patient must be \>= 18 years of age
* Patient must have an Eastern Cooperative Oncology Group (ECOG) performance status of 0 or 1
* Patient must have a histologic diagnosis of melanoma belonging to the following American Joint Committee on Cancer (AJCC) 8th edition TNM stages:

  * T0, Tx or T1-4; and
  * N1b, N2b, N2c, N3b or N3c
* Patients may have a presentation with primary melanoma with concurrent regional nodal and/or in-transit metastasis; or patients may have a history of primary melanoma or unknown primary melanoma presenting with clinically detected regional nodal and/or in-transit recurrence; and may belong to any of the following groups:

  * Primary cutaneous melanoma with clinically apparent regional lymph node metastases and/or in-transit metastases
  * Clinically detected recurrent melanoma at the proximal regional lymph node(s) basin
  * Primary cutaneous melanoma with concurrent nodal disease involving a single (or multiple) regional nodal group(s) if considered potentially surgically resectable at baseline
  * Clinically detected nodal melanoma (if single site) arising from an unknown primary
  * In-transit cutaneous metastases with or without regional lymph node involvement permitted if considered potentially surgically resectable at baseline

    * NOTE: Patients with mucosal and/or uveal melanoma are not eligible for the study
* Patient must be a candidate for definitive surgery and have met with the treating surgical oncologist prior to randomization
* Patient must not have received any live vaccine within 30 days prior to randomization and while participating in the study. Live vaccines include, but are not limited to, the following: measles, mumps, rubella, chicken pox, yellow fever, rabies, Bacillus Calmette-Guerin (BCG), and typhoid (oral) vaccine. Patients are permitted to receive inactivated vaccines and any non-live vaccines including those for the seasonal influenza and COVID-19 (Note: intranasal influenza vaccines, such as Flu-Mist \[registered trademark\] are live attenuated vaccines and are not allowed). If possible, it is recommended to separate study drug administration from vaccine administration by about a week (primarily, in order to minimize an overlap of adverse events)
* Patient must have the presence of injectable and measurable disease based on Response Evaluation Criteria in Solid Tumors (RECIST) 1.1, documented by scans obtained within 4 weeks prior to randomization

  * NOTE: Injectable disease is defined as an accessible lesion in the skin, subcutaneous tissue or lymph nodes (LN) close to the skin and palpable by physical examination or approachable with ultrasound guidance
* Absolute neutrophil count (ANC) \>= 1,500 /mcL (obtained within 4 weeks prior to randomization)
* Hemoglobin (Hgb) \>= 9 g/dL or \>= 5.6 mmol/L (obtained within 4 weeks prior to randomization)
* Platelets \>= 100,000 / mcL (obtained within 4 weeks prior to randomization)
* Serum creatinine =\< 1.5 x institutional upper limit of normal (ULN) or measured or calculated creatinine clearance \> 60 mL/min (glomerular filtration rate \[GFR\] can also be used in place of creatinine or creatinine clearance \[CrCl\] for patients with creatinine levels \> 1.5 x institutional ULN) (obtained within 4 weeks prior to randomization)
* Serum total bilirubin =\< 1.5 x institutional ULN; for total bilirubin level \> 1.5 x ULN but =\< 3 x ULN, the direct bilirubin must be =\< the institutional ULN (obtained within 4 weeks prior to randomization)
* Aspartate aminotransferase (AST) (serum glutamic-oxaloacetic transaminase \[SGOT\]) and alanine aminotransferase (ALT) (serum glutamate pyruvate transaminase \[SGPT\]) =\< 2.5 x institutional ULN (obtained within 4 weeks prior to randomization)
* International normalized ratio (INR) or prothrombin time (PT) =\< 1.5 x institutional ULN unless patient is receiving anticoagulant therapy as long as PT or partial thromboplastin time (PTT) is within therapeutic range of intended use of anticoagulants (obtained within 4 weeks prior to randomization)
* Activated partial thromboplastin time (aPTT) =\< 1.5 x institutional ULN unless patient is receiving anticoagulant therapy as long as PT or PTT is within therapeutic range of intended use of anticoagulants (obtained within 4 weeks prior to randomization)
* Patients must not be pregnant or breast-feeding due to the potential harm to an unborn fetus and possible risk for adverse events in nursing infants with the treatment regimens being used. All patients of childbearing potential must have a blood test or urine study within 14 days prior to randomization to rule out pregnancy. A urine or serum pregnancy test must be repeated within 72 hours prior to receiving the first dose of pembrolizumab if the test done for eligibility/randomization is done outside of this 72 hour window. If the urine test is positive or cannot be confirmed as negative, a serum pregnancy test will be required. A patient of childbearing potential is defined as anyone, regardless of sexual orientation or whether they have undergone tubal ligation, who meets the following criteria: 1) has achieved menarche at some point, 2) has not undergone a hysterectomy or bilateral oophorectomy; or 3) has not been naturally postmenopausal (amenorrhea following cancer therapy does not rule out childbearing potential) for at least 24 consecutive months (i.e., has had menses at any time in the preceding 24 consecutive months)
* Patients must not expect to conceive or father children by using accepted and effective method(s) of contraception or abstaining from sexual intercourse from time of randomization, while on study treatment, and continue for 26 weeks after the last dose of protocol treatment
* Patient must have the ability to understand and the willingness to sign a written informed consent document. Patients with impaired decision-making capacity (IDMC) who have a legally authorized representative (LAR) or caregiver and/or family member available will also be considered eligible
* Patient must not have received prior systemic therapy for melanoma including systemic therapy with an anti-PD-1, anti-PD-L1, anti-CTLA-4, BRAF/MEK inhibitor combination and/or TLR-9 agonist
* Patient must not have a diagnosis of immunodeficiency or be receiving systemic steroid therapy or any other form of immunosuppressive therapy within 7 days prior to randomization, except as noted here

  * Patients who are currently receiving steroids at a dose of prednisone =\< 5 mg daily (or equivalent) are permitted to enroll
  * Patients who require topical, ophthalmologic and inhalational steroids are permitted to enroll
  * Patients with hypothyroidism who are stable on hormone replacement are permitted to enroll
  * Patients who require active immunosuppression with corticosteroids at a dose of prednisone \> 5 mg daily (or equivalent) for any reason are ineligible
  * Patients with adrenal insufficiency are ineligible
  * Patients who have developed autoimmune disorders of grade 4 while on prior immunotherapy are not permitted to enroll on this study. Patients who developed autoimmune disorders of grade =\< 3 may enroll if the disorder has resolved to grade =\< 1 and the patient has been off systemic corticosteroids at doses \> 5 mg for at least 2 weeks prior to randomization
* Human immunodeficiency virus (HIV)-infected patients on effective anti-retroviral therapy with undetectable viral load within 6 months prior to randomization are eligible for this trial
* For patients with evidence of chronic hepatitis B virus (HBV) infection, the HBV viral load must be undetectable on suppressive therapy, if indicated
* Patients with a history of hepatitis C virus (HCV) infection must have been treated and cured. For patients with HCV infection who are currently on treatment, they are eligible if they have an undetectable HCV viral load
* Patients with a history of brain metastases are not eligible for this study as they do not meet the eligibility staging criteria
* Patients with a prior or concurrent malignancy whose natural history or treatment does not have the potential to interfere with the safety or efficacy assessment of the investigational regimen are eligible for this trial
* Patients with known history or current symptoms of cardiac disease, or history of treatment with cardiotoxic agents, should have a clinical risk assessment of cardiac function using the New York Heart Association Functional Classification. To be eligible for this trial, patients should be class 2B or better
* Patient must not have had an allogeneic tissue/solid organ transplant
* Patient must not have a history of (non-infectious) pneumonitis that required steroids or current pneumonitis
* Patient must not have severe hypersensitivity (\>= grade 3) to pembrolizumab and/or any of its excipients
* Patient must not have an active infection requiring systemic therapy
* Patient must not have a known psychiatric or substance abuse disorder that would interfere with the patient's ability to cooperate with the requirements of the study