Critical
Security advisory
Zend/zend_hash.c in PHP before 7.0.15 and 7.1.x before 7.1.1 mishandles certain cases that require large array allocations, which allows remote attackers to execute arbitrary code or cause a denial of service (integer overflow, uninitialized memory access, and use of arbitrary destructor function pointers) via crafted serialized data.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2017-5340
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 12:14 UTC · Revision 1
Source evidence
Zend/zend_hash.c in PHP before 7.0.15 and 7.1.x before 7.1.1 mishandles certain cases that require large array allocations, which allows remote attackers to execute arbitrary code or cause a denial of service (integer overflow, uninitialized memory access, and use of arbitrary destructor function pointers) via crafted serialized data.
osv:CVE-2017-5340
Complete source record
{
"id": "e32ed07aea7b795ce1dbebae0882444a4b0ae3e34cfcd6d8b2cc620b9ab87324",
"url": "https://osv.dev/vulnerability/CVE-2017-5340",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2017-5340",
"summary": "Zend/zend_hash.c in PHP before 7.0.15 and 7.1.x before 7.1.1 mishandles certain cases that require large array allocations, which allows remote attackers to execute arbitrary code or cause a denial of service (integer overflow, uninitialized memory access, and use of arbitrary destructor function pointers) via crafted serialized data.",
"evidence": "osv:CVE-2017-5340",
"products": [],
"severity": "critical",
"structured": {
"id": "CVE-2017-5340",
"aliases": [
"CVE-2017-5340"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/php/php-src",
"type": "GIT",
"events": [
{
"introduced": "60fffd296abce5fc071f3c173c25a2696cf683c6"
},
{
"fixed": "cc766d7730bdec064e32f8009154fa672b34ef9b"
},
{
"introduced": "0221e9f827632942225586687a33cfd554860d5e"
},
{
"fixed": "9abbc3cc6d0f448435ca38bef694f671bf7303d8"
},
{
"fixed": "4cc0286f2f3780abc6084bcdae5dce595daa3c12"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "7.0.0"
},
{
"fixed": "7.0.15"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "7.1.0"
},
{
"fixed": "7.1.1"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "4cc0286f2f3780abc6084bcdae5dce595daa3c12"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-5340.json",
"vanir_signatures": [
{
"id": "CVE-2017-5340-12d1fca6",
"digest": {
"length": 2665,
"function_hash": "291942526429879441159894536430346133521"
},
"source": "https://github.com/php/php-src/commit/9abbc3cc6d0f448435ca38bef694f671bf7303d8",
"target": {
"file": "ext/gd/libgd/gd_gd2.c",
"function": "_gd2GetHeader"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2017-5340-7501d6a6",
"digest": {
"threshold": 0.9,
"line_hashes": [
"302809697189148475297750884608790259821",
"25269136893474997921766866731112141155",
"176995661728580401951558063694425109185",
"282407999817348256037465684465485374719",
"27203332826222208118957196914128024108",
"327578526711602898995701292075519451415",
"101648155586618325587449013706940504782",
"84422741966942976358390282422869288177"
]
},
"source": "https://github.com/php/php-src/commit/4cc0286f2f3780abc6084bcdae5dce595daa3c12",
"target": {
"file": "Zend/zend_hash.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2017-5340-7570f682",
"digest": {
"length": 534,
"function_hash": "108479502598115741326499771321871644248"
},
"source": "https://github.com/php/php-src/commit/4cc0286f2f3780abc6084bcdae5dce595daa3c12",
"target": {
"file": "Zend/zend_hash.c",
"function": "_zend_hash_init"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2017-5340-a887e78f",
"digest": {
"threshold": 0.9,
"line_hashes": [
"268808390959611610380382661363715926383",
"332457077737297600470842301867489262455",
"183820387990733455444215637150999073887",
"296117839669516092864788658433251533836"
]
},
"source": "https://github.com/php/php-src/commit/9abbc3cc6d0f448435ca38bef694f671bf7303d8",
"target": {
"file": "ext/gd/libgd/gd_gd2.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
}
],
"vanir_signatures_modified": "2026-10-20T13:23:47Z"
}
}
],
"modified": "2026-10-20T13:23:47.596571058Z",
"provider": "osv",
"references": [
"https://access.redhat.com/errata/RHSA-2018:1296",
"https://security.netapp.com/advisory/ntap-20180112-0001/",
"https://bugs.php.net/bug.php?id=73832",
"https://github.com/php/php-src/commit/4cc0286f2f3780abc6084bcdae5dce595daa3c12"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2017-5340",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 387620,
"published_at": "2017-01-11T06:59:00.16+00:00"
}