Shopify is better in terms of security. The reason for this is that all infrastructure is handled by the platform itself. With WooCommerce, the person responsible for infrastructure needs to handle most of the security, including such stuff as updating to the latest version of plugins and themes, keeping systems updated, ensuring good passwords, installing security plugins and other security systems and other good security practices.