vendor:
Lua
by:
Fady Mohamed Osman
7.5
CVSS
HIGH
Heap Use After Free
416
CWE
Product Name: Lua
Affected Version From: 5.3.5
Affected Version To: 5.3.5
Patch Exists: YES
Related CWE: CVE-2019-6706
CPE: lua:5.3.5
Metasploit:
https://www.rapid7.com/db/vulnerabilities/debian-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/redhat_linux-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/centos_linux-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/alpine-linux-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/oracle-solaris-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/alma_linux-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/huawei-euleros-2_0_sp8-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/ubuntu-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/oracle_linux-cve-2019-6706/, https://www.rapid7.com/db/vulnerabilities/suse-cve-2019-6706/
Other Scripts:
N/A
Platforms Tested: None
2019
Lua 5.3.5
During a fuzz session using 'AFL', a heap use after free vulnerability was found in lua 5.3.5. The function 'lua_upvaluejoin' in file lapi.c at line 1287 suffers from a use after free bug when supplied the same function for parameter f1 and f2 and the same upvalue index. The bug is only triggered when the upvalue is closed, as the 'luaC_upvdeccount' function found in file lgc.c at line 678 will decrement the refcount and then free the upvalue if the refcount is zero and if the upvalue is closed.
Mitigation:
Use the patch provided at http://www.lua.org/bugs.html#5.3.5-2