{"id":"CVE-2026-6104","state":"PUBLISHED","title":"Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding","description":"In PHP versions 8.4.* before 8.4.21 and 8.5.* before 8.5.6, when an encoding name containing an embedded NUL byte is passed to mb_convert_encoding() or related mbstring functions, the code incorrectly assumes that when strncasecmp() returns 0 it means the strings have the same length. This can lead to out-of-bounds read of global memory, potentially causing a crash or information disclosure or crash. Affected functions include mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables(), and mb_detect_order(), as well as the mbstring.detect_order and mbstring.http_output INI settings.","publishedAt":"2026-05-10T04:35:17.328Z","updatedAt":"2026-07-15T00:41:42.455Z","severity":{"score":6.3,"label":"Medium","version":"4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:L/SI:N/SA:L/RE:M/U:Amber","source":"php"},"assigner":"php","products":["PHP Group PHP"],"affected":[{"vendor":"PHP Group","product":"PHP","packageName":"mbstring","defaultStatus":"unaffected","versions":[{"version":"8.4.*","status":"affected","lessThan":"8.4.21","versionType":"semver"},{"version":"8.5.*","status":"affected","lessThan":"8.5.6","versionType":"semver"}]}],"references":["https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53","https://access.redhat.com/security/cve/CVE-2026-6104","https://bugzilla.redhat.com/show_bug.cgi?id=2468573","https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-6104.json","https://access.redhat.com/errata/RHSA-2026:22649"],"weaknesses":["CWE-125"],"ingestedAt":"2026-10-29T20:12:49.727Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/6xxx/CVE-2026-6104.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-6104","state":"PUBLISHED","datePublished":"2026-05-10T04:35:17.328Z","dateUpdated":"2026-07-15T00:41:42.455Z","assignerShortName":"php","assignerOrgId":"dd77f84a-d19a-4638-8c3d-a322d820ed2b","dateReserved":"2026-04-11T04:15:03.938Z"},"containers":{"cna":{"title":"Global buffer over-read in mb_convert_encoding() with attacker-supplied encoding","descriptions":[{"lang":"en","value":"In PHP versions 8.4.* before 8.4.21 and 8.5.* before 8.5.6, when an encoding name containing an embedded NUL byte is passed to mb_convert_encoding() or related mbstring functions, the code incorrectly assumes that when strncasecmp() returns 0 it means the strings have the same length. This can lead to out-of-bounds read of global memory, potentially causing a crash or information disclosure or crash. Affected functions include mb_convert_encoding(), mb_detect_encoding(), mb_convert_variables(), and mb_detect_order(), as well as the mbstring.detect_order and mbstring.http_output INI settings."}],"affected":[{"vendor":"PHP Group","product":"PHP","packageName":"mbstring","defaultStatus":"unaffected","versions":[{"version":"8.4.*","status":"affected","lessThan":"8.4.21","versionType":"semver"},{"version":"8.5.*","status":"affected","lessThan":"8.5.6","versionType":"semver"}]}],"references":[{"url":"https://github.com/php/php-src/security/advisories/GHSA-74r9-qxhc-fx53","tags":["vendor-advisory"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"LOW","subConfidentialityImpact":"LOW","vulnIntegrityImpact":"NONE","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"LOW","subAvailabilityImpact":"LOW","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"MODERATE","providerUrgency":"AMBER","version":"4.0","baseSeverity":"MEDIUM","baseScore":6.3,"vectorString":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:L/SI:N/SA:L/RE:M/U:Amber"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-125","lang":"en","description":"CWE-125 Out-of-bounds Read","type":"CWE"}]}],"providerMetadata":{"shortName":"php","orgId":"dd77f84a-d19a-4638-8c3d-a322d820ed2b","dateUpdated":"2026-05-10T04:35:17.328Z"},"datePublic":"2026-05-07T00:00:00.000Z","credits":[{"lang":"en","value":"Akshay Jain","type":"reporter"},{"lang":"en","value":"Ilija Tovilo","type":"remediation developer"}],"source":{"advisory":"GHSA-74r9-qxhc-fx53","discovery":"EXTERNAL"},"x_generator":{"engine":"Vulnogram 0.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-05-11T13:04:44.572023Z","id":"CVE-2026-6104","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-05-11T13:04:58.462Z"}},{"title":"php: global buffer over-read in mb_convert_encoding() with attacker-supplied encoding","descriptions":[{"lang":"en","value":"A flaw was found in PHP. When an encoding name containing an embedded NUL byte is passed to `mb_convert_encoding()` or related mbstring functions, an out-of-bounds read of only 1 byte can occur due to the incorrect processing of string lengths. This issue can cause a denial of service or limited information disclosure."}],"affected":[{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","packageName":"php8.4","defaultStatus":"affected","versions":[{"version":"0:8.4.21-1.el10_2","status":"unaffected","lessThan":"*","versionType":"rpm"}],"collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:10.2"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 10","packageName":"php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:10"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 6","packageName":"php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:6"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 7","packageName":"php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:7"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","packageName":"php:7.4/php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:8"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 8","packageName":"php:8.2/php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:8"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","packageName":"php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:9"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","packageName":"php:8.2/php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:9"]},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux 9","packageName":"php:8.3/php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/o:redhat:enterprise_linux:9"]},{"vendor":"Red Hat","product":"Red Hat Hardened Images","packageName":"php","defaultStatus":"unaffected","collectionURL":"https://access.redhat.com/downloads/content/package-browser/","cpes":["cpe:/a:redhat:hummingbird:1"]}],"references":[{"url":"https://access.redhat.com/security/cve/CVE-2026-6104","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2468573","name":"RHBZ#2468573","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-6104.json","tags":["x_sadp-csaf-vex"]},{"url":"https://access.redhat.com/errata/RHSA-2026:22649","tags":["vendor-advisory","x_refsource_REDHAT"]}],"metrics":[{"other":{"content":{"namespace":"https://access.redhat.com/security/updates/classification/","value":"Important"},"type":"Red Hat severity rating"}},{"cvssV3_1":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","baseScore":8.2,"baseSeverity":"HIGH","confidentialityImpact":"LOW","integrityImpact":"NONE","privilegesRequired":"NONE","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H","version":"3.1"},"format":"CVSS"}],"problemTypes":[{"descriptions":[{"cweId":"CWE-125","description":"Out-of-bounds Read","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"redhat-SADP","orgId":"0b0ca135-0b70-47e7-9f44-1890c2a1c46c","dateUpdated":"2026-07-15T00:41:42.455Z"},"datePublic":"2026-05-10T04:35:17.328Z","solutions":[{"lang":"en","value":"RHSA-2026:22649: Red Hat Enterprise Linux AppStream (v. 10)"}],"timeline":[{"lang":"en","time":"2026-05-10T06:01:02.802Z","value":"Reported to Red Hat."},{"lang":"en","time":"2026-05-10T04:35:17.328Z","value":"Made public."}],"workarounds":[{"lang":"en","value":"To mitigate this vulnerability, sanitize any input containing a NUL byte before calling the vulnerable mbstring functions. Also, verify your PHP configuration to ensure the vulnerable INI settings are using securely hardcoded encodings."}],"x_adpType":"supplier","x_generator":{"engine":"sadp-cli 1.0.0"}}]}}}