{"schemaVersion":3,"id":"CVE-2022-31627","aliases":["UBUNTU-CVE-2022-31627","USN-5530-1","openSUSE-SU-2024:12218-1"],"status":"published","duplicateOf":null,"title":null,"description":"In PHP versions 8.1.x below 8.1.8, when fileinfo functions, such as finfo_buffer, due to incorrect patch applied to the third party code from libmagic, incorrect function may be used to free allocated memory, which may lead to heap corruption.","dates":{"published":"2022-07-28T05:50:09.522Z","modified":"2024-09-16T21:02:46.605Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.8,"severity":"critical","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.7,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Ubuntu","score":7.7,"severity":"high","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","exploitability":5.6,"impact":9.2,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":9.8,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.02141,"percentile":0.81879,"severity":"low","asOf":"2026-10-21T00:00:00.000Z","change":{"pp":0.06099999999999994,"baselineDate":"2026-09-21T00:00:00.000Z","baselineScore":0.0208},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.02036,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.02141,"percentile":0.81879}],"last30":[{"date":"2026-09-21T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.0208,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.02141,"percentile":null},{"date":"2026-10-21T00:00:00.000Z","score":0.02141,"percentile":0.81879}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_9C68620EF0282231","name":"Exploit Reference (bugs.php.net)","source":"reference","url":"https://bugs.php.net/bug.php?id=81723","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-590","name":"Free of Memory not on the Heap","description":"The product calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().","type":"weakness","status":"Incomplete","abstraction":"Variant","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/590.html"},{"id":"CWE-787","name":"Out-of-bounds Write","description":"The product writes data past the end, or before the beginning, of the intended buffer.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/787.html"}],"affected":[{"vendor":"ubuntu","product":"php8.1","name":"php8.1","label":"php8.1","ecosystem":"Ubuntu","cpePart":null,"purl":"pkg:deb/ubuntu/php8.1","purlType":"deb","versions":[{"text":"< 8.1.2-1ubuntu2.2","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 8.1.2-1ubuntu2.2","eol":null,"hubHref":null},{"vendor":"php group","product":"php","name":"PHP","label":"php","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 8.1.X, < 8.1.8","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 8.1.X, < 8.1.8","eol":null,"hubHref":"/vendor/php_group/php"},{"vendor":"php","product":"php","name":"php","label":"php","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 8.1.0, < 8.1.8","noFixRecorded":false,"fixedIn":null}],"versionsText":"≥ 8.1.0, < 8.1.8","eol":{"isEol":null,"eolDate":null,"matchMethod":"cpe","cycle":null,"product":{"name":"php","label":"PHP","category":"lang"}},"hubHref":"/vendor/php/php"},{"vendor":"opensuse","product":"php8&distro=openSUSE Tumbleweed","name":"php8","label":"php8&distro=openSUSE Tumbleweed","ecosystem":"openSUSE","cpePart":null,"purl":"pkg:rpm/opensuse/php8&distro=openSUSE Tumbleweed","purlType":"rpm","versions":[{"text":"< 8.1.8-1.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 8.1.8-1.1","eol":null,"hubHref":null}],"affectedCount":4,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://bugs.php.net/bug.php?id=81723","label":"bugs.php.net/bug.php?id=81723","hostname":"bugs.php.net","tags":["X Refsource MISC","Exploit","Issue Tracking","Patch","Third Party Advisory"]},{"url":"https://security.netapp.com/advisory/ntap-20220826-0008/","label":"security.netapp.com/advisory/ntap-20220826-0008/","hostname":"security.netapp.com","tags":["X Refsource CONFIRM","Third Party Advisory"]},{"url":"https://security.gentoo.org/glsa/202209-20","label":"security.gentoo.org/glsa/202209-20","hostname":"security.gentoo.org","tags":["Vendor Advisory","X Refsource GENTOO","Third Party Advisory"]},{"url":"https://ubuntu.com/security/CVE-2022-31627","label":"ubuntu.com/security/CVE-2022-31627","hostname":"ubuntu.com","tags":["REPORT"]},{"url":"https://ubuntu.com/security/notices/USN-5530-1","label":"ubuntu.com/security/notices/USN-5530-1","hostname":"ubuntu.com","tags":["Advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-31627","label":"www.cve.org/CVERecord?id=CVE-2022-31627","hostname":"www.cve.org","tags":["REPORT"]},{"url":"https://www.suse.com/security/cve/CVE-2022-31627","label":"www.suse.com/security/cve/CVE-2022-31627","hostname":"www.suse.com","tags":["WEB"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31627","label":"nvd.nist.gov/vuln/detail/CVE-2022-31627","hostname":"nvd.nist.gov","tags":["Oval","Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2022-07-28T05:50:09.522Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-09-16T21:02:46.605Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-21T18:33:56.962Z","stale":false,"partial":false}}