The American STS Space Shuttle had the engines that provided a large portion of its thrust mounted directly on the shuttle itself. The Space Shuttle Main Engines
(SSME) were designed to be reusable and were put on the orbiter to be recovered. Because the shuttle was side-mounted on the External Fuel Tank, the SSMEs had to gimbal as much as 10 degrees to accommodate for the offset center of mass. If this wasn't done, the stack would tip over and likely spin catastrophically out of control.
The Buran mounted on the Energia had a different design from the STS stack. The Buran Orbiter itself didn't provide the main thrust to get itself to space (I believe it only provided a bit of thrust at the end to adjust and reach its orbit.) The main engines were instead that of the Energia rocket.
How did the Energia rocket compensate for the offset center of mass? Via gimbaling of the engines on the Energia, or some offsetting design in the rocket itself?