Heap-based buffer overflow in Lua



Published: 2022-04-11 | Updated: 2023-05-01
Risk High
Patch available YES
Number of vulnerabilities 2
CVE-ID CVE-2022-28805
CVE-2022-33099
CWE-ID CWE-122
Exploitation vector Network
Public exploit N/A
Vulnerable software
Subscribe
Lua
Universal components / Libraries / Scripting languages

Vendor Lua

Security Bulletin

This security bulletin contains information about 2 vulnerabilities.

1) Heap-based buffer overflow

EUVDB-ID: #VU62053

Risk: High

CVSSv3.1: 8.5 [CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H/E:U/RL:O/RC:C]

CVE-ID: CVE-2022-28805

CWE-ID: CWE-122 - Heap-based Buffer Overflow

Exploit availability: No

Description

The vulnerability allows a remote attacker to execute arbitrary code on the target system.

The vulnerability exists due to a boundary error in the singlevar function in lparser.c. A remote attacker can use a specially crafted luaK_exp2anyregup call, trigger heap-based buffer overflow and execute arbitrary code on the target system.

Successful exploitation of this vulnerability may result in complete compromise of vulnerable system.

Mitigation

Install update from vendor's website.

Vulnerable software versions

Lua: 5.4.0 - 5.4.4

External links

http://lua-users.org/lists/lua-l/2022-02/msg00001.html
http://lua-users.org/lists/lua-l/2022-02/msg00070.html
http://lua-users.org/lists/lua-l/2022-04/msg00009.html
http://github.com/lua/lua/commit/1f3c6f4534c6411313361697d98d1145a1f030fa


Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability.

2) Heap-based buffer overflow

EUVDB-ID: #VU68952

Risk: Medium

CVSSv3.1: 6.5 [CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:U/RL:O/RC:C]

CVE-ID: CVE-2022-33099

CWE-ID: CWE-122 - Heap-based Buffer Overflow

Exploit availability: No

Description

The vulnerability allows a remote attacker to perform a denial of service (DoS) attack.

The vulnerability exists due to a boundary error in the luaG_runerror component. A remote attacker can send specially crafted data to the application, trigger a heap-based buffer overflow and perform a denial of service (DoS) attack.

Mitigation

Install update from vendor's website.

Vulnerable software versions

Lua: 5.4.0 - 5.4.4

External links

http://lua-users.org/lists/lua-l/2022-05/msg00073.html
http://lua-users.org/lists/lua-l/2022-05/msg00042.html
http://www.lua.org/bugs.html#Lua-stack%20overflow%20when%20C%20stack%20overflows%20while%20handling%20an%20error:~:text=Lua%2Dstack%20overflow%20when%20C%20stack%20overflows%20while%20handling%20an%20error
http://lua-users.org/lists/lua-l/2022-05/msg00035.html
http://github.com/lua/lua/commit/42d40581dd919fb134c07027ca1ce0844c670daf
http://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/RJNJ66IFDUKWJJZXHGOLRGIA3HWWC36R/
http://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UHYZOEFDVLVAD6EEP4CDW6DNONIVVHPA/


Q & A

Can this vulnerability be exploited remotely?

Yes. This vulnerability can be exploited by a remote non-authenticated attacker via the Internet.

Is there known malware, which exploits this vulnerability?

No. We are not aware of malware exploiting this vulnerability.



###SIDEBAR###