This phase I trial studies the safety and best dose of ipilimumab, nivolumab, or both in combination with temozolomide in treating patients with newly diagnosed glioblastoma or gliosarcoma. Monoclonal antibodies, such as ipilimumab and nivolumab, may block tumor growth in different ways by targeting certain cells. Drugs used in chemotherapy, such as temozolomide, work in different ways to stop the growth of tumor cells, either by killing the cells, by stopping them from dividing, or by stopping them from spreading. It is not yet known which combination is a better treatment for glioblastoma or gliosarcoma.