{"id":71825,"date":"2025-10-16T19:45:40","date_gmt":"2025-10-16T16:15:40","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-62495-type-confusion-in-string-addition-in-quickjs\/"},"modified":"2025-10-16T19:45:40","modified_gmt":"2025-10-16T16:15:40","slug":"cve-2025-62495-type-confusion-in-string-addition-in-quickjs","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-62495-type-confusion-in-string-addition-in-quickjs\/","title":{"rendered":"CVE-2025-62495 &#8211; Type confusion in string addition in QuickJS"},"content":{"rendered":"<p>CVE ID : CVE-2025-62495<\/p>\n<p>Published :  Oct. 16, 2025, 4:15 p.m. | 25\u00a0minutes ago<\/p>\n<p>Description : An integer overflow vulnerability exists in the QuickJS regular expression engine (libregexp) due to an inconsistent representation of the bytecode buffer size.<\/p>\n<p>  *  The regular expression bytecode is stored in a DynBuf structure, which correctly uses a $text{size}_text{t}$ (an unsigned type, typically 64-bit) for its size member.<\/p>\n<p>  *  However, several functions, such as re_emit_op_u32 and other internal parsing routines, incorrectly cast or store this DynBuf $text{size}_text{t}$ value into a signed int (typically 32-bit).<\/p>\n<p>  *  When a large or complex regular expression (such as those generated by a recursive pattern in a Proof-of-Concept) causes the bytecode size to exceed $2^{31}$ bytes (the maximum positive value for a signed 32-bit integer), the size value wraps around, resulting in a negative integer when stored in the int variable (Integer Overflow).<\/p>\n<p>  *  This negative value is subsequently used in offset calculations. For example, within functions like re_parse_disjunction, the negative size is used to compute an offset (pos) for patching a jump instruction.<\/p>\n<p>  *  This negative offset is then incorrectly added to the buffer pointer (s-&gt;byte_code.buf + pos), leading to an out-of-bounds write on the first line of the snippet below:<\/p>\n<p>put_u32(s-&gt;byte_code.buf + pos, len);<\/p>\n<p>Severity: 7.1 | HIGH<\/p>\n<p>Visit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-62495 Published : Oct. 16, 2025, 4:15 p.m. | 25\u00a0minutes ago Description : An integer overflow vulnerability exists in the QuickJS regular expression engine (libregexp) due to an inconsistent representation of the bytecode buffer size. * The regular expression bytecode is stored in a DynBuf structure, which correctly uses a $text{size}_text{t}$ (an &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-71825","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/71825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=71825"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/71825\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=71825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=71825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=71825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}