Summary
CVE-2022-51023 is an unauthenticated SQL injection vulnerability (CWE-89) in PHPOK, affecting versions 4.5.000 through 5.4.080. The flaw is in the api.php endpoint and can be exploited remotely without authentication to extract database contents. The CVE record lists a CVSS v4.0 score of 8.8 (High) and a CVSS v3.1 score of 8.2 (High).
Technical details
- Root cause: The
sortparameter handled byapi.phpis not properly sanitized before it is used in an SQLORDER BYclause. - Trigger conditions: An attacker sends a crafted GET request to
/api.php?c=project&f=indexwith a malicioussortvalue, such as anextractvaluepayload. - Attack vector: Network. No authentication or user interaction is required.
- Impact: Error-based SQL injection that lets an attacker extract database information through error messages. The CVSS v3.1 vector rates confidentiality impact as High and integrity impact as Low.
- Exploitation: The CVE record notes that exploitation was observed in October 2023 (reported by The Shadowserver Foundation).
Affected software
- PHPOK 4.5.000 through 5.4.080 (all versions before 5.4.081)
Severity
- CVSS v4.0: 8.8 (High). Vector:
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N - CVSS v3.1: 8.2 (High). Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N
Mitigation and recommended actions
- Immediate: Upgrade PHPOK to version 5.4.081 or later, which contains the fix.
- If you cannot patch immediately: I found no vendor-documented workaround. As a general precaution, restrict network access to
/api.phpwhere it is not needed, and review web server and database logs for requests to/api.php?c=project&f=indexwith unusualsortvalues (for example, ones containingextractvalue).

