A WooCommerce store is a WordPress site that takes money, so every plugin, administrator account and API key on it is a route to the checkout page and the card data that passes through it. Attackers go after WooCommerce stores in three main ways: injecting skimming JavaScript into checkout pages, abusing the checkout to test stolen cards, and taking over the WordPress back end through vulnerable plugins or stolen credentials. This guide covers how identity and access work in WooCommerce, the Shop Manager and Administrator roles, REST API keys and webhooks, payment gateway choices and PCI DSS scope, skimming and card testing defences, logging and a hardening baseline. It is for store owners, agencies and developers who run WooCommerce in production. General WordPress hardening is covered in the PHP and WordPress Security Guide; this page focuses on what changes once the site is a store.
This is an independent guide from NHI Mgmt Group, based on WooCommerce's public documentation as of November 2026. It is not sponsored or reviewed by WooCommerce. Product features change, so confirm settings against WooCommerce's current documentation.
Key takeaways
- Gateway choice sets your PCI scope. WooCommerce's own guidance is that offsite gateways move most payment handling to the processor, while integrated gateways keep customers on your site and need at least basic PCI compliance; card numbers should never be stored on the site.
- Script integrity on the checkout is now an explicit PCI DSS expectation. Requirements 6.4.3 and 11.6.1 took effect on 31 March 2025, and SAQ A merchants must confirm their site is not susceptible to attacks from scripts that could affect their e-commerce systems.
- REST API keys are user-bound credentials. Each WooCommerce key is linked to a WordPress user and inherits that user's capabilities, so a Read/Write key tied to an Administrator is effectively an administrator credential.
- Shop Manager is a powerful role. It controls all WooCommerce settings, including payment gateway configuration, orders, refunds and coupons, and should be treated as privileged.
- Plugins are the largest attack surface. WooCommerce warns that one poorly designed plugin or code snippet can put the whole site and its data at risk; fewer, maintained plugins is the most effective control.
How identity and access work in WooCommerce
WooCommerce uses WordPress users, roles and capabilities. There is no separate WooCommerce identity store: customers, staff and integrations are all WordPress users, and authentication happens through WordPress logins, application credentials or WooCommerce REST API keys.
| Identity | How it authenticates | What it can reach | Main risk |
|---|---|---|---|
| Customer | WordPress login created at checkout or sign-up | Own account details and orders | Credential stuffing (MITRE ATT&CK T1110.004) against My Account, stored addresses |
| Shop Manager | WordPress login | All WooCommerce settings, reports, products, orders, refunds, coupons; view all users | Changing payment gateway settings, issuing refunds, exporting customer data |
| Administrator | WordPress login | Everything, including installing plugins and themes | Uploading a malicious plugin or editing checkout templates |
| REST API key | Consumer Key and Consumer Secret, HTTP Basic Auth over HTTPS | WooCommerce REST API with the linked user's capabilities and the key's Read, Write or Read/Write level | Leaked keys in ERP, shipping or marketing connectors |
| Webhook receiver | HMAC hash of the payload using the webhook Secret | Receives order, product and customer events | Short or reused secrets, data sent to a stale endpoint |
| Payment gateway | Gateway API keys stored in WooCommerce settings | Charges, refunds and saved payment tokens at the processor | Keys exposed through database dumps or backups |
| Remote management and plugin connections | Plugin-specific connection keys | Often full control of the site | Keys exposed at the provider, which could let signed commands install unwanted plugins |
Admin roles and privileged access
WooCommerce adds two roles to WordPress: Customer, similar to Subscriber, and Shop Manager. According to WooCommerce, a Shop Manager has full access to WooCommerce settings and configuration, all analytics and reports, products, orders including refunds, coupons, and standard editor capabilities, and can view details of users in all roles. Shop Managers can edit another user only if every role assigned to that user is one Shop Managers may edit.
- Keep Administrators to two or three named people: agencies and developers get their own accounts, never a shared "admin" login. Remove agency accounts when the engagement ends.
- Use Shop Manager for store staff: it avoids plugin and theme installation rights, but remember it can still change payment gateway settings, so it is a privileged role.
- Enforce two-step authentication: WordPress hardening guidance recommends two-step authentication beyond a strong password. Apply it to every Administrator and Shop Manager, with phishing-resistant methods where your plugin supports them. See the Passwordless and Passkeys Guide.
- Disable the dashboard file editor: set
define( 'DISALLOW_FILE_EDIT', true );in wp-config.php so an administrator session cannot be used to edit theme or plugin PHP from the browser. It does not stop malicious plugin uploads, so it complements, rather than replaces, limiting Administrators. - Restrict the database user: WordPress notes that normal operation needs only SELECT, INSERT, UPDATE and DELETE; structural privileges can be granted temporarily for upgrades, after a tested backup.
- Customer accounts: guest checkout reduces stored personal data, but WooCommerce suggests considering disabling guest checkout if you suffer card testing. Decide based on your fraud pattern, and protect customer logins with rate limiting and bot controls either way. See the Retail and E-Commerce Identity Security Guide.
Integrations, API tokens and service accounts
WooCommerce REST API keys
Keys are created under WooCommerce, Settings, Advanced, REST API. Each key has a description, a linked WordPress user and a permission level of Read, Write or Read/Write, and produces a Consumer Key and a Consumer Secret. The Consumer Secret is shown only once. Over HTTPS, clients send the key and secret with HTTP Basic Auth; if the server does not pass the Authorization header, they can be sent as consumer_key and consumer_secret query string parameters. Over plain HTTP, the API requires OAuth 1.0a one-legged signatures with a 15-minute timestamp window.
- One key per integration: a separate key for the ERP, the shipping tool and the marketing platform, each with a description naming the system and owner.
- Dedicated service users: link each key to a dedicated WordPress user with the lowest role that works, not to a person's Administrator account. When a staff member leaves, keys linked to their user do not silently keep admin power.
- Read unless write is needed: reporting and analytics connectors rarely need Write.
- HTTPS only, header not query string: query string credentials end up in web server, proxy and analytics logs. Fix the server so Basic Auth works rather than falling back to query parameters.
- Store secrets outside code: keep consumer secrets in the connecting system's secret store, not in repositories or plugin settings exports. Scan repositories for leaked keys (MITRE ATT&CK Credentials In Files, T1552.001).
- Revoke and reissue: use Revoke Key when an integration is retired or a secret may have leaked, then create a new key; there is no way to view an existing secret again.
Treat these keys as non-human identities with owners, purpose and review dates. See the API Key Management Guide.
Webhooks
Each webhook has a Secret used to generate a hash of the delivered payload, sent in the request headers. If the Secret is left blank it defaults to the current API user's consumer secret, which couples two credentials: set a distinct random secret for each webhook and verify the hash on the receiving side. WooCommerce disables a webhook after more than five consecutive delivery failures; delivery logs are under WooCommerce, Status, Logs, source webhooks-delivery. Review webhook delivery URLs periodically, because a webhook pointing at an old agency endpoint keeps sending order and customer data.
Payment gateways and PCI DSS scope
| Integration type | Where card data is entered | Typical PCI DSS validation | Script risk on your site |
|---|---|---|---|
| Redirect (offsite hosted payment page) | Processor's page | SAQ A, with the script eligibility criterion | Page that redirects can be altered to send customers to a fake payment page |
| Embedded iframe or hosted fields | Processor-served frame inside your checkout | Usually SAQ A, with the script eligibility criterion | Parent page scripts can overlay or replace the frame |
| Integrated (card fields on your page, sent by JavaScript) | Your checkout page | SAQ A-EP or higher | Full: 6.4.3 and 11.6.1 apply directly |
| Card data posted to your server | Your server | SAQ D | Full, plus server-side storage and transmission controls |
Confirm the exact SAQ with your acquirer. PCI SSC's January 2025 change removed requirements 6.4.3, 11.6.1 and 12.3.1 from SAQ A, replacing them with an eligibility criterion that the merchant's site is not susceptible to attacks from scripts; the requirements themselves remain in PCI DSS v4.0.1 and took effect on 31 March 2025. In practice an SAQ A store still needs to know and control which scripts run on the pages that load or redirect to the payment form. See the PCI DSS for E-commerce Payment Page Scripts Guide and the PCI DSS SAQ Types guide.
Gateway API keys and webhook signing secrets sit in the WordPress database. Anyone with a database dump or backup has them, so restrict backup access, encrypt backups, and use the processor's restricted or limited-scope keys where offered. Saved payment methods should use processor tokenisation, never stored card numbers.
Skimming and card testing defences
Web skimming
Skimmers inject JavaScript (T1059.007) into checkout pages, through a vulnerable plugin (Exploit Public-Facing Application, T1190), a compromised administrator account, a tampered third-party script (Compromise Software Supply Chain, T1195.002) or direct changes to theme files and the database. Controls, in order of value:
- Script inventory and authorisation: list every script loaded on cart, checkout and order-pay pages, with a business justification, as 6.4.3 expects. Remove marketing tags from checkout pages entirely where possible.
- Content-Security-Policy: a strict policy on checkout pages limits where scripts load from and where form data can be sent. Start in report-only mode, collect violations, then enforce.
- Subresource Integrity: pin hashes for third-party scripts that do not change between releases.
- Change and tamper detection: monitor the HTTP headers and script content the browser receives on payment pages, as 11.6.1 requires, and file integrity monitoring for plugin and theme directories (watch for new PHP files, a sign of a web shell, T1505.003).
- Admin hardening: most skimmer injections need write access, so the identity controls above are skimming controls.
If you find a skimmer, follow the Web Skimming Incident Playbook: preserve evidence, remove the script, rotate every administrator password, API key and gateway key, and notify your acquirer.
Card testing
Card testers run large numbers of small payments to find valid stolen cards, often against donation or low-price products and guest checkout. WooCommerce's response guidance is to refund suspected fraudulent transactions, consider anti-fraud software and reCAPTCHA on checkout, review targeted products such as donations, consider disabling guest checkout and ask your payment provider to strengthen its fraud controls. Add rate limiting on checkout and payment endpoints, including the Store API routes used by block-based checkout, and alert on spikes in declined authorisations. See the Card Testing and Carding Attacks Defence Guide and the Bot Management Guide.
Logging and detection
WordPress has little security logging by default. WooCommerce writes logs to WooCommerce, Status, Logs, including webhook delivery; WordPress hardening guidance recommends log analysis and file integrity monitoring. Combine web server logs, an activity log plugin or host-level logging, payment processor dashboards and file integrity monitoring, and send them off the server so an attacker with admin access cannot erase them.
| Signal | Source | What it may indicate |
|---|---|---|
| New Administrator or Shop Manager, role change | Activity log | Account takeover or persistence |
| Plugin or theme installed, updated outside a change window | Activity log, file integrity monitoring | Malicious plugin upload, backdoor |
| Change to payment gateway settings or checkout templates | Activity log, file integrity monitoring | Skimmer or payment redirection |
| New or changed script on checkout pages | Payment page monitoring, CSP reports | Web skimming |
| REST API key created, or API calls from new IP ranges | Activity log, web server logs | Key misuse or attacker persistence |
| Spike in declined payments or orders of the same low value | Processor dashboard, order data | Card testing |
| Spike in failed customer logins | Web server or WAF logs | Credential stuffing |
Metrics:
- Number of Administrators and Shop Managers, and percentage with two-step authentication.
- Number of active plugins, and percentage updated within 7 days of a security release.
- REST API keys with a named owner and last review date, and keys linked to personal Administrator accounts (target zero).
- Scripts on payment pages that are authorised and justified (target 100%).
- Declined authorisation rate per hour against baseline.
- Time to detect a change to checkout page scripts.
Hardening baseline
- Inventory: list users by role, REST API keys and linked users, webhooks and destinations, payment gateways and their integration type, plugins and their maintenance status, and scripts on checkout pages.
- Reduce: delete unused plugins and themes, revoke stale keys and webhooks, remove former staff and agency accounts. WordPress advises deleting plugins you do not use.
- Update: keep WordPress, WooCommerce and every plugin current; WooCommerce calls updates crucial. Test on a staging copy, then apply promptly; keep a rollback backup.
- Harden admin access: two-step authentication for privileged roles, DISALLOW_FILE_EDIT, HTTPS for the whole site and admin, wp-config.php readable only by the owner and web server (400 or 440), least-privilege database user.
- Payment page controls: choose the lowest-scope gateway that meets business needs; remove non-essential scripts from checkout; deploy CSP in report-only mode, then enforce; set up payment page change detection.
- Fraud controls: enable processor fraud tools, CAPTCHA or bot protection on checkout, and rate limits.
- Backups and recovery: encrypted, dated, off-site backups of files and database, with restricted access because they contain gateway keys and customer data; test restores.
- Monitoring: activity logging, file integrity monitoring and alerting from the table above.
Common misconfigurations
- API keys linked to an owner's Administrator account: every integration then has full admin power, and revoking the owner breaks all of them.
- Query string API authentication: consumer secrets written to access logs and analytics because the server did not pass the Authorization header.
- Webhook secret left blank: the hash defaults to the API user's consumer secret, so one leak compromises both.
- Marketing and chat scripts on checkout: every third-party script on the payment page is a skimming path and must be justified under 6.4.3.
- Abandoned plugins: plugins without recent updates kept because "the shop needs them", often the entry point for injected code.
- Shared agency logins and remote management keys: one compromise at a provider reaches every store, so give each store its own keys and accounts.
Framework mapping
| Control area | PCI DSS v4.0.1 | NIST SP 800-53 Rev. 5 | MITRE ATT&CK |
|---|---|---|---|
| Payment page script authorisation and integrity | 6.4.3 | SI-7, CM-7 | T1059.007, T1185 |
| Payment page change and tamper detection | 11.6.1 | SI-7 | T1059.007 |
| Patching WordPress, WooCommerce and plugins | Requirement 6 | SI-2 | T1190 |
| Admin MFA and least privilege | Requirements 7 and 8 | IA-2, AC-6 | T1110.004 |
| API keys and integration credentials | Requirement 8 | IA-5 | T1552.001 |
| Third-party scripts and plugins | 6.3.2 (inventory of bespoke and custom software and the third-party components in it) | SA-9 | T1195.002 |
Practitioner checklist
- Confirm your gateway integration type and SAQ with your acquirer, and document scripts on pages that load or redirect to payment.
- Limit Administrators to named individuals and treat Shop Manager as privileged; enforce two-step authentication on both.
- Recreate REST API keys per integration, linked to dedicated least-privilege users, Read unless Write is required.
- Set a unique Secret on every webhook and verify the hash at the receiver.
- Remove unused plugins, update the rest within days of security releases, and test on staging first.
- Set DISALLOW_FILE_EDIT, restrict wp-config.php and the database user.
- Deploy CSP and payment page change detection on checkout pages.
- Enable processor fraud tools, bot protection and rate limiting on checkout.
- Ship activity, file integrity and web server logs off the server and alert on admin, plugin and checkout changes.
Standards and references
- PCI SSC: Important Updates Announced for Merchants Validating to SAQ A
- PCI SSC: Document Library (PCI DSS v4.0.1)
- WooCommerce: Security documentation
- WooCommerce: REST API
- WooCommerce: REST API developer documentation (authentication)
- WooCommerce: Roles and capabilities
- WooCommerce: Webhooks
- WordPress: Hardening WordPress
Related NHI Mgmt Group resources: PHP and WordPress Security Guide · PCI DSS for E-commerce Payment Page Scripts Guide · Card Testing and Carding Attacks Defence Guide · Ecommerce Store Security Checklist