Skip to main content
Vulnerability Database/CVE-2024-13316

CVE-2024-13316: Scratch & Win WordPress Auth Bypass Flaw

CVE-2024-13316 is an authentication bypass flaw in the Scratch & Win WordPress plugin that lets unauthenticated attackers create discount coupons. This post covers technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-13316 Overview

CVE-2024-13316 affects the Scratch & Win – Giveaways and Contests plugin for WordPress, developed by akashmalik. The plugin fails to enforce a capability check on the apmswn_create_discount() function in all versions up to and including 2.8.0. Unauthenticated attackers can invoke this function over the network to create arbitrary discount coupons on affected sites. The flaw is classified as Missing Authorization [CWE-862]. Successful abuse allows adversaries to generate coupons that reduce merchant revenue, distribute unauthorized discounts, or seed follow-on fraud campaigns. The vulnerability requires no authentication, no user interaction, and low attack complexity.

Critical Impact

Unauthenticated remote attackers can create arbitrary discount coupons on affected WordPress sites, causing direct revenue loss and enabling coupon abuse at scale.

Affected Products

  • Akashmalik Scratch & Win – Giveaways and Contests plugin for WordPress
  • All versions up to and including 2.8.0
  • WordPress sites using the scratch-win-giveaways-for-website-facebook plugin

Discovery Timeline

  • 2025-02-18 - CVE-2024-13316 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-13316

Vulnerability Analysis

The Scratch & Win plugin exposes an AJAX action handled by the apmswn_create_discount() function. This function is designed to create WooCommerce-style discount coupons used by the giveaway workflow. The function lacks a WordPress capability check and does not validate the caller's identity or role before executing the coupon creation logic.

Because the endpoint is reachable without authentication, any remote client can send a crafted request and receive a valid coupon in return. Attackers can automate this process to mint large volumes of coupons, share them publicly, or apply them at checkout to defraud the store owner. The impact is limited to integrity of the coupon dataset; confidentiality and availability of the site are not directly affected.

Root Cause

The root cause is a missing authorization control [CWE-862] on a privileged action. The apmswn_create_discount() handler is registered without a current_user_can() check and without a nonce validation gate. The developer likely intended the function to be invoked only by an authenticated administrator, but no capability enforcement was implemented at the handler entry point.

Attack Vector

An unauthenticated attacker sends an HTTP request to the WordPress AJAX endpoint that triggers the vulnerable action. The plugin processes the request and creates a discount coupon in the site's database. No credentials, session tokens, or user interaction are required. Details of the vulnerable code path are documented in the WordPress Plugin Code Review and the Wordfence Vulnerability Report.

No public proof-of-concept exploit code has been published for this vulnerability at the time of writing.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2024-13316

Indicators of Compromise

  • Unexpected discount or coupon entries in the WooCommerce or WordPress database that were not created by an administrator.
  • HTTP POST requests to admin-ajax.php referencing the apmswn_create_discount action from unauthenticated sources.
  • Spikes in coupon redemption volume or unusual coupon codes appearing at checkout.

Detection Strategies

  • Review web server access logs for requests to wp-admin/admin-ajax.php containing the apmswn_create_discount action parameter, especially from clients without valid session cookies.
  • Audit the WordPress wp_posts table for shop_coupon entries with unfamiliar authors, timestamps, or discount values.
  • Correlate coupon creation events with the absence of a corresponding administrator login in the audit trail.

Monitoring Recommendations

  • Enable WordPress activity logging to capture coupon create, update, and delete events with source IP metadata.
  • Alert on high-frequency requests to the plugin's AJAX action from a single IP or user agent.
  • Monitor WooCommerce revenue reports for anomalous discount usage patterns that could indicate coupon minting abuse.

How to Mitigate CVE-2024-13316

Immediate Actions Required

  • Update the Scratch & Win plugin to the latest version above 2.8.0 that includes the capability check fix.
  • If an update is not immediately feasible, deactivate and remove the plugin from the WordPress installation.
  • Audit and revoke any unauthorized coupons created since the plugin was installed.

Patch Information

The vendor addressed the missing authorization issue in updates tracked by the WordPress plugin repository. Fix details are available in the vendor changesets: WordPress Plugin Changeset 3212730 and WordPress Plugin Changeset 3239997. Site operators should upgrade to a patched release and verify the fix by testing the AJAX endpoint from an unauthenticated context.

Workarounds

  • Block unauthenticated POST requests containing the apmswn_create_discount action at the web application firewall (WAF) layer.
  • Restrict access to admin-ajax.php by IP allowlist where operationally feasible.
  • Temporarily disable the plugin until a patched version is deployed and validated.
bash
# Example WAF rule fragment to block unauthenticated calls to the vulnerable action
# ModSecurity-style pseudo rule
SecRule REQUEST_URI "@contains /wp-admin/admin-ajax.php" \
  "chain,deny,status:403,id:1013316,msg:'Block CVE-2024-13316 unauth coupon creation'"
  SecRule ARGS:action "@streq apmswn_create_discount" \
    "chain"
    SecRule &REQUEST_COOKIES:wordpress_logged_in_* "@eq 0"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.