{"id":"CVE-2022-31627","aliases":["BIT-libphp-2022-31627","BIT-php-2022-31627","BIT-php-min-2022-31627","EUVD-2022-53079","GHSA-2c24-m9rj-gq8m","UBUNTU-CVE-2022-31627","USN-5530-1","openSUSE-SU-2024:12218-1"],"status":"published","title":"Heap buffer overflow in finfo_buffer","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.","severity":{"version":"3.1","score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.02141,"percentile":0.82314,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-590","CWE-787"],"published":"2022-07-15T00:00:00Z","modified":"2026-10-28T02:30:26Z","fixes":[{"ecosystem":"Bitnami","package":"libphp","fixed_in":["8.1.8"],"sources":["osv"]},{"ecosystem":"Bitnami","package":"php","fixed_in":["8.1.8"],"sources":["osv"]},{"ecosystem":"Bitnami","package":"php-min","fixed_in":["8.1.8"],"sources":["osv"]},{"ecosystem":"Ubuntu:22.04:LTS","package":"php8.1","fixed_in":["8.1.2-1ubuntu2.2"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"php8","fixed_in":["8.1.8-1.1"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Bitnami","package":"libphp","ranges":[{"type":"SEMVER","events":[{"introduced":"8.1.0"},{"fixed":"8.1.8"}]}]},{"source":"osv","ecosystem":"Bitnami","package":"php","ranges":[{"type":"SEMVER","events":[{"introduced":"8.1.0"},{"fixed":"8.1.8"}]}]},{"source":"osv","ecosystem":"Bitnami","package":"php-min","ranges":[{"type":"SEMVER","events":[{"introduced":"8.1.0"},{"fixed":"8.1.8"}]}]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"php8.1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.1.2-1ubuntu2.2"}]}],"versions":["8.1.0~rc4-1ubuntu2","8.1.0-1","8.1.2-1ubuntu1","8.1.2-1ubuntu2","8.1.2-1ubuntu2.1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"php8.1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.1.2-1ubuntu2.2"}]}],"versions":["8.1.0~rc4-1ubuntu2","8.1.0-1","8.1.2-1ubuntu1","8.1.2-1ubuntu2","8.1.2-1ubuntu2.1"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"php8","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"8.1.8-1.1"}]}]}],"products":[{"vendor":"php","product":"php"},{"vendor":"php group","product":"php"}],"references":[{"url":"https://bugs.php.net/bug.php?id=81723","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Patch","Third Party Advisory","advisory","web"]},{"url":"https://security.netapp.com/advisory/ntap-20220826-0008/","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory"]},{"url":"https://security.gentoo.org/glsa/202209-20","tags":["vendor-advisory","x_refsource_GENTOO","x_transferred","Third Party Advisory","advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-31627","tags":["web","advisory"]},{"url":"https://github.com/advisories/GHSA-2c24-m9rj-gq8m"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/31xxx/CVE-2022-31627.json","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2022-31627","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-5530-1","tags":["advisory"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2022-31627","tags":["report"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2022-31627","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2022-31627","title":"Heap buffer overflow in finfo_buffer","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.","status":"published","published":"2022-07-28T05:50:09.522Z","modified":"2024-09-16T21:02:46.605Z","cvss":[{"version":"3.1","score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","level":"high","assessor":"cna"}],"cwes":["CWE-590"],"updated_at":"2026-11-02T14:34:34.940806Z"}],"euvd":[{"id":"EUVD-2022-53079","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.","status":"published","published":"2022-07-28T05:50:09Z","modified":"2024-09-16T21:02:46Z","cvss":[{"version":"3.1","score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"updated_at":"2026-11-03T00:55:09.104839Z"}],"ghsa":[{"id":"GHSA-2c24-m9rj-gq8m","title":"In PHP versions 8.1.x below 8.1.8, when fileinfo functions, such as finfo_buffer, due to...","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.","status":"published","published":"2022-07-29T00:00:48Z","modified":"2023-01-28T05:07:41Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-787"],"updated_at":"2026-11-02T14:44:33.554453Z"}],"nvd":[{"id":"CVE-2022-31627","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.","status":"published","published":"2022-07-28T06:15:07.547Z","modified":"2026-06-17T04:45:50.163Z","cvss":[{"version":"3.1","score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","level":"high","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-590","CWE-787"],"updated_at":"2026-11-02T14:07:24.037422Z"}],"osv":[{"id":"CVE-2022-31627","title":"Heap buffer overflow in finfo_buffer","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.","status":"published","published":"2022-07-28T05:50:09.522Z","modified":"2026-10-28T02:30:26.103956264Z","cvss":[{"version":"3.1","score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"cwes":["CWE-590"],"updated_at":"2026-11-02T15:44:25.516981Z"},{"id":"UBUNTU-CVE-2022-31627","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.","status":"published","published":"2022-07-15T00:00:00Z","modified":"2026-04-22T13:23:29.942707Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"},{"version":"3.1","score":7.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L","level":"high"}],"updated_at":"2026-11-02T16:53:53.899276Z"},{"id":"BIT-libphp-2022-31627","title":"Heap buffer overflow in finfo_buffer","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.","status":"published","published":"2025-08-11T13:53:38.342Z","modified":"2026-09-08T08:48:08.374747017Z","updated_at":"2026-11-02T15:28:32.162822Z"},{"id":"BIT-php-2022-31627","title":"Heap buffer overflow in finfo_buffer","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.","status":"published","published":"2024-03-06T11:04:02.496Z","modified":"2026-09-08T08:48:18.257682979Z","updated_at":"2026-11-02T15:28:34.343258Z"},{"id":"BIT-php-min-2022-31627","title":"Heap buffer overflow in finfo_buffer","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.","status":"published","published":"2025-01-14T19:21:50.208Z","modified":"2026-09-08T08:47:53.223540462Z","updated_at":"2026-11-02T15:28:34.343258Z"},{"id":"openSUSE-SU-2024:12218-1","title":"php8-8.1.8-1.1 on GA media","description":"These are all security issues fixed in the php8-8.1.8-1.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T02:40:58.632362Z","updated_at":"2026-11-02T16:58:35.485255Z"},{"id":"USN-5530-1","title":"php8.1 vulnerability","description":"It was discovered that PHP incorrectly handled certain memory operations\nwhen obtaining file information. A remote attacker could use this issue to\ncause PHP to crash, resulting in a denial of service, or possibly execute\narbitrary code.\n","status":"published","published":"2022-07-25T11:22:22Z","modified":"2026-04-22T10:26:25.835174Z","updated_at":"2026-11-02T16:58:16.20937Z"}]}}
