quickjs — security advisory
A type confusion vulnerability exists in the handling of the string addition (+) operation within the QuickJS engine. * The code first checks if the left-hand operand is a string. * It then attempts to convert the right-hand operand to a primitive value using JS_ToPrimitiveFree. This conversion can trigger a callback (e.g., toString or valueOf). * During this callback, an attacker can modify the type of the left-hand operand in memory, changing it from a string to a different type (e.g., an object or an array). * The code then proceeds to call JS_ConcatStringInPlace, which still treats the modified left-hand value as a string. This mismatch between the assumed type (string) and the actual type allows an attacker to control the data structure being processed by the concatenation logic, resulting in a type confusion condition. This can lead to out-of-bounds memory access, potentially resulting in memory corruption and arbitrary code execution in the context of the QuickJS runtime.
- Products
- quickjs
- Affected versions
- 2025.04.26-1
- Fixed versions
- Not specified
- CVEs
- CVE-2025-62494
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 22:39 UTC · Revision 1
Source evidence
A type confusion vulnerability exists in the handling of the string addition (+) operation within the QuickJS engine. * The code first checks if the left-hand operand is a string. * It then attempts to convert the right-hand operand to a primitive value using JS_ToPrimitiveFree. This conversion can trigger a callback (e.g., toString or valueOf). * During this callback, an attacker can modify the type of the left-hand operand in memory, changing it from a string to a different type (e.g., an object or an array). * The code then proceeds to call JS_ConcatStringInPlace, which still treats the modified left-hand value as a string. This mismatch between the assumed type (string) and the actual type allows an attacker to control the data structure being processed by the concatenation logic, resulting in a type confusion condition. This can lead to out-of-bounds memory access, potentially resulting in memory corruption and arbitrary code execution in the context of the QuickJS runtime.
osv:DEBIAN-CVE-2025-62494
quickjs
Fixed versions: Not specified
quickjs
Fixed versions: Not specified
Complete source record
{
"id": "83f01d4411d95d094e96b653f67e40c7f1e25400b619fc968bf8df94b0291f1f",
"url": "https://osv.dev/vulnerability/DEBIAN-CVE-2025-62494",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "DEBIAN-CVE-2025-62494",
"summary": "A type confusion vulnerability exists in the handling of the string addition (+) operation within the QuickJS engine. * The code first checks if the left-hand operand is a string. * It then attempts to convert the right-hand operand to a primitive value using JS_ToPrimitiveFree. This conversion can trigger a callback (e.g., toString or valueOf). * During this callback, an attacker can modify the type of the left-hand operand in memory, changing it from a string to a different type (e.g., an object or an array). * The code then proceeds to call JS_ConcatStringInPlace, which still treats the modified left-hand value as a string. This mismatch between the assumed type (string) and the actual type allows an attacker to control the data structure being processed by the concatenation logic, resulting in a type confusion condition. This can lead to out-of-bounds memory access, potentially resulting in memory corruption and arbitrary code execution in the context of the QuickJS runtime.",
"evidence": "osv:DEBIAN-CVE-2025-62494",
"products": [
{
"name": {
"value": "quickjs",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2025.04.26-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "quickjs",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "2025.04.26-1",
"evidence": "/affected/1/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "DEBIAN-CVE-2025-62494",
"aliases": [
"DEBIAN-CVE-2025-62494"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "quickjs",
"purl": "pkg:deb/debian/quickjs?arch=source&distro=trixie",
"ecosystem": "Debian:13"
},
"versions": [
"2025.04.26-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2025-62494.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "quickjs",
"purl": "pkg:deb/debian/quickjs?arch=source&distro=forky",
"ecosystem": "Debian:14"
},
"versions": [
"2025.04.26-1"
],
"database_specific": {
"source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2025-62494.json"
},
"ecosystem_specific": {
"urgency": "not yet assigned"
}
}
],
"modified": "2026-10-23T17:47:26.661149007Z",
"provider": "osv",
"upstream": [
"CVE-2025-62494"
],
"references": [
"https://security-tracker.debian.org/tracker/CVE-2025-62494"
]
},
"related_cves": [
{
"value": "CVE-2025-62494",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 416956,
"published_at": "2025-10-16T16:15:39.943+00:00"
}