CVE-2022-31625 | Freeing unallocated memory in php_pgsql_free_params()

Exp

In PHP versions 7.4.x below 7.4.30, 8.0.x below 8.0.20, and 8.1.x below 8.1.7, when using Postgres database extension, supplying invalid parameters to the parametrized query may lead to PHP attempting to free memory using uninitialized data as pointers. This could lead to RCE vulnerability or denial of service.

Published: 2022-06-16 Last update: 2024-11-21 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-31625 is rated High Exploit Risk (76.5/100): CVSS High severity, with medium exploitation likelihood (EPSS 1.48%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2022-31625

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2022-31625

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-05-18 0.77% 1.48% +0.71%
2 2025-12-28 0.54% 0.77% +0.22%
3 2025-12-27 0.54%

Full EPSS history (23 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-31625

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
8.1 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.2 5.9 [email protected]
8.1 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
2.2 5.9 [email protected]
6.8 2.0 MEDIUM
AV:N/AC:M/Au:N/C:P/I:P/A:P Click to expand
Access vector (AV:N)
Can be exploited remotely over network reachability.
Access complexity (AC:M)
Exploitation needs some favorable conditions, but not exceptional ones.
Authentication (AU:N)
No authentication is required.
Confidentiality impact (C:P)
Partial confidentiality impact.
Integrity impact (I:P)
Partial integrity impact.
Availability impact (A:P)
Partial availability impact.
8.6 6.4 [email protected]

Weakness enumeration for CVE-2022-31625

OS Trackers for CVE-2022-31625

vendor priority summary link
alpine high CVE-2022-31625: 2 source package rows (php8, php81); 5 state rows across 4 repos (3.17-community, 3.18-community, 3.19-community, edge-community); fixed 5, open 0. https://security.alpinelinux.org/vuln/CVE-2022-31625
debian not yet assigned CVE-2022-31625 not yet assigned priority: Debian including 1 source packages (php7.4), 1 status rows across 1 suites (bullseye): resolved 1. https://security-tracker.debian.org/tracker/CVE-2022-31625
gentoo high CVE-2022-31625: 1 GLSA(s) (202209-20), 1 atom(s) (dev-lang/php); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-31625
redhat medium https://access.redhat.com/security/cve/CVE-2022-31625
suse high CVE-2022-31625 severity important: SUSE including 554 source package names (8-4.1:apache2-mod_php8-8.0.10-150400.4.8.1, 8-4.1:php8-8.0.10-150400.4.8.1, …), 2067 product×package rows across 48 product lines (Container bci/php, Container bci/php-apache, … (48 product lines)): Fixed 2067. https://www.suse.com/security/cve/CVE-2022-31625/
ubuntu medium CVE-2022-31625 medium priority: Ubuntu including 6 source packages (php5, php7.0, php7.2, php7.4, php8.0, php8.1), 84 status rows across 14 suites (bionic, focal, impish, jammy, kinetic, lunar, mantic, noble, oracular, plucky, questing, trusty, upstream, xenial): DNE 70, released 10, needs-triage 3, needed 1. https://ubuntu.com/security/CVE-2022-31625

Affected software / configurations for CVE-2022-31625

Vendor Product Version Raw CPE
php php >= 7.4.0, < 7.4.30 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
php php >= 8.0.0, < 8.0.20 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
php php >= 8.1.0, < 8.1.7 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*
debian debian_linux 10.0 cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
debian debian_linux 11.0 cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*

References for CVE-2022-31625

cvelogic Threat Intelligence