Shanghai is not part of any Chinese province. Instead, it is one of China's four direct-administered municipalities (alongside Beijing, Tianjin, and Chongqing), meaning it is governed directly by the central government and holds the same administrative rank as a province.
This unique status grants Shanghai significant economic and legislative autonomy, allowing it to function as a major global financial hub with its own municipal government, separate from provincial oversight.