A nonce is not a permission: Subscriber label deletion in SmartyParcel
An AJAX handler guarded only by a nonce that every logged-in customer receives let any Subscriber delete the shipping labels and tracking records of any order in the store.
- Advisory
- CVE-2026-107788
- CVE
- CVE-2026-107788
- Affected
- SmartyParcel / WC Ukr Shipping (WordPress plugin) < 1.23.4, patched in 1.23.4
- Weakness
- CWE-862 · Missing Authorization
- Reading
- ~6 min · 28 Oct 2026
WordPress gives plugin authors two tools that look alike and do different jobs. A nonce answers “did this request come from a page we rendered for this user?”. A capability check answers “is this user allowed to do this?”. Plugins regularly ship the first and assume they have the second.
SmartyParcel (formerly WC Ukr Shipping) is a WooCommerce shipping plugin, originally built for Ukrainian carriers such as Nova Poshta. Its “remove shipping label” AJAX handler checked a nonce and nothing else. That nonce was printed on the checkout page for every logged-in visitor. The result is CVE-2026-107788: any Subscriber or Customer could delete the shipping label and tracking record of any order in the store.
A little theory: nonces, wp_ajax_ and object-level authorization
Three ideas explain this bug class.
-
wp_ajax_means “any logged-in user”. A plugin registers an AJAX action withadd_action('wp_ajax_my_action', ...). WordPress runs that handler for any authenticated user who postsaction=my_actionto/wp-admin/admin-ajax.php. That includes a Subscriber, and on WooCommerce sites the Customer role that every buyer with an account gets. Thewp_ajax_nopriv_variant opens the handler to anonymous visitors as well. Theadmin-ajax.phpURL says “admin”, but neither hook is limited to admins. -
A nonce is CSRF protection, not authorization.
wp_verify_nonce()checks that a token was issued for this user session and action and is still fresh. It stops an attacker from tricking someone else’s browser into sending the request. It does nothing against a user sending the request themselves: they read the nonce from a page they can already see. Whoever can load the page that prints the nonce can call the endpoint, so a nonce is only as restrictive as that page. -
Authorization has two layers. The function-level question is “may this role use this action at all?”, answered with
current_user_can('manage_woocommerce')or similar. The object-level question is “may this user act on this record?”: does the customer own order 1234, can this editor touch that post? Missing the first is CWE-862 (Missing Authorization). Getting the first right but taking a raw ID from the request with no ownership check is CWE-639 (an IDOR). A delete-by-ID handler with neither check is the worst case.
The concrete finding
I found this in August 2026 on version 1.21.13, tested with WooCommerce 11.0.1. I was reviewing fresh security fixes in WordPress plugins, and this release’s changelog said “Fixed patchstack vulnerability issue”, so I diffed it against 1.21.12. The fix added a CheckManageWooPermission middleware to two order routes. The label route right next to them did not get it.
The router
The plugin uses a small framework (vendor/kirillbdev/wcus-core). Its router registers every route on wp_ajax_, and on wp_ajax_nopriv_ only for routes marked public:
public function addRoute($route)
{
$this->routes[ $route->action ] = $route;
add_action('wp_ajax_' . $route->action, [ $this, 'dispatchAction' ]);
if ($route->public) {
add_action('wp_ajax_nopriv_' . $route->action, [ $this, 'dispatchAction' ]);
}
}So anonymous users cannot reach the label route, but every logged-in account can. Each route’s only default middleware is VerifyCsrfToken, which is a nonce check:
public function handle($request)
{
if ( ! wp_verify_nonce($request->get('_token', ''), 'wc-ukr-shipping')) {
wp_send_json([
'success' => false
]);
}
}The route table shows the gap. The two order routes received the new middleware in 1.21.13. The label route did not:
// SmartyParcel
new Route('wcus_smartyparcel_remove_label', SmartyParcelController::class, 'removeLabel'),
// ...
new Route(
'wcus_update_order_shipping_address',
OrdersController::class,
'updateOrderShippingAddress',
[
'middleware' => [CheckManageWooPermission::class]
]
),CheckManageWooPermission is the check the label route was missing: if ( ! current_user_can('manage_woocommerce')) { wp_send_json([...]); }.
Where the nonce comes from
The wc-ukr-shipping nonce is not an admin secret. The frontend asset loader puts it into the checkout page’s JavaScript globals:
$globals = [
'ajaxUrl' => admin_url('admin-ajax.php'),
'homeUrl' => home_url(),
'nonce' => wp_create_nonce('wc-ukr-shipping'),
// ...
];Any logged-in customer who opens /checkout/ gets a valid token for that action.
The handler
public function removeLabel(Request $request): ResponseInterface
{
try {
$label = $this->shippingLabelsRepository->findById((int)$request->get('id'));
if ($label === null) {
throw new \Exception('Label by id ' . $request->get('label_id') . ' not found');
}
$this->shippingLabelsRepository->deleteById((int)$label['id']);
// ... fire the "label voided" automation event for the orderdeleteById() is a plain $wpdb->delete() on the wc_ukr_shipping_labels table by primary key. (A side note: the error message interpolates label_id while the lookup reads id, so the “not found” text prints an empty ID. That is a vendor slip and has no bearing on the bug.) Nothing between the request and the delete asks who the user is or whether the label’s order belongs to them. Label IDs are sequential integers, so an attacker can try them in order.
Proving it
On a local test install, as a Subscriber:
# 1. Log in as a Subscriber (cookie jar cj.txt), add any product to the cart,
# then read the nonce from the checkout page.
NONCE=$(curl -s -b cj.txt http://shop.test/checkout/ \
| grep -oE '"nonce":"[a-f0-9]+"' | head -1 | cut -d'"' -f4)
# 2. Delete a label row that belongs to someone else's order.
curl -s -b cj.txt http://shop.test/wp-admin/admin-ajax.php \
--data-urlencode action=wcus_smartyparcel_remove_label \
--data-urlencode _token="$NONCE" \
--data-urlencode id=6A database check showed the victim row was gone. There is also a non-destructive way to see the gap. Send a non-existent id and the handler returns a business error (“Label by id … not found”). Send the same Subscriber’s request to the patched wcus_update_order_shipping_address and you get “You do not have permission to access this action.” One route checks permissions; the other never asks.
How to find this in your own code
- List every
wp_ajax_action (including framework routers that calladd_actionin a loop) and find the capability check on the path to each handler. If the only guard ischeck_ajax_referer()orwp_verify_nonce(), treat the handler as open to every account. - Find out where each nonce is printed. Search for
wp_create_nonce('<action>')andwp_localize_script. If the nonce appears on a frontend page such as checkout, My Account or a shortcode, then every user who can see that page holds it. - Follow request IDs into writes. Any
$_POST['id']ororder_idthat reaches$wpdb->delete,$wpdb->update,wp_delete_postorupdate_post_metaneeds an ownership check unless the caller is already restricted to shop managers. - Diff security fixes against their siblings. When a release adds a check to some routes, look at every other route in the same table. This bug was found that way.
- Test with a low-privilege account. Make a Subscriber, grab the frontend nonce and replay every admin AJAX action. Compare the responses: a “not found” or validation error means the request got past authorization.
The fix
The issue is fixed in 1.23.4; update to that version or later. For your own handlers, decide which of the two layers applies.
An admin-only action like voiding a label needs the function-level check, the same one the plugin already had in CheckManageWooPermission:
public function removeLabel(Request $request): ResponseInterface
{
if ( ! current_user_can('manage_woocommerce')) { // function level
wp_send_json_error(['message' => 'Forbidden'], 403);
}
$this->shippingLabelsRepository->deleteById((int) $request->get('id'));
// ...
}An action that customers are meant to use on their own orders cannot rely on a role check, because every customer has the same role. It must load the record and compare its owner with the current user:
$label = $this->shippingLabelsRepository->findById((int) $request->get('id'));
$order = $label ? wc_get_order((int) $label['order_id']) : false;
if ( ! $order || $order->get_customer_id() !== get_current_user_id()) { // object level
wp_send_json_error(['message' => 'Not found'], 404);
}Keep the nonce as well. It still protects against CSRF. In a router-based plugin, the stronger fix is to make capability middleware the default for every route, so a new route has to opt out of admin-only access explicitly instead of opting in. That turns “forgot to add the check” from a vulnerability into a broken feature that someone will notice.
Impact
You need an authenticated account, but only the lowest role. WooCommerce stores routinely create a Customer account for every buyer, and many allow open registration, so on a typical store that is effectively anyone.
The attacker can delete the shipping-label and tracking records of any order in the store. That breaks fulfilment and tracking for affected orders, and the “label voided” automation event fires for them too. There is no data read and no code execution. The CVE record carries a CVSS 3.1 score of 4.3 from CISA’s ADP enrichment (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N), which fits an integrity-only bug that is easy to trigger.
Disclosure timeline
| Date | Event |
|---|---|
| 2026-08-14 | Bug found and confirmed on a local install of 1.21.13 |
| 2026-10-08 | CVE-2026-107788 reserved |
| 2026-10-10 | 1.23.4 released (“Fixed known issues from Patchstack”) |
| 2026-10-21 | WPScan advisory and CVE-2026-107788 published |
| 2026-10-28 | This write-up |
References
- CVE-2026-107788: WPScan advisory, CVE record
- WordPress developer docs: Nonces,
current_user_can(), AJAX in plugins - CWE-862: Missing Authorization, CWE-639: Authorization Bypass Through User-Controlled Key
- Related: Logged in is not the same as allowed, the same class on REST routes
Takeaway
A nonce proves where a request came from, not who is allowed to send it.
Every wp_ajax_ handler that changes data needs current_user_can() for the action and an ownership check for the specific record.