aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-04-01 16:17:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-04-01 16:17:48 -0300
commite64b0cada8909b97029c7fcccf12e312e7d2a9c9 (patch)
tree04584a55dc4d83510ce655d93685631d76110f07
parent7316d61a66a3dda73009d9bcf9b1bc63351b3563 (diff)
downloadlua-e64b0cada8909b97029c7fcccf12e312e7d2a9c9.tar.gz
lua-e64b0cada8909b97029c7fcccf12e312e7d2a9c9.tar.bz2
lua-e64b0cada8909b97029c7fcccf12e312e7d2a9c9.zip
several bugs related to precompiled code
-rw-r--r--bugs53
1 files changed, 53 insertions, 0 deletions
diff --git a/bugs b/bugs
index 1dbca762..a52ba06d 100644
--- a/bugs
+++ b/bugs
@@ -1797,9 +1797,62 @@ patch = [[
1797} 1797}
1798 1798
1799Bug{ 1799Bug{
1800what = [[The validator for precompiled code has several flaws that
1801allow malicious binary code to crash the application]],
1802report = [[Peter Cawley, on 2008/03/24]],
1803since = [[5.0]],
1804example = [[
1805a = string.dump(function()return;end)
1806a = a:gsub(string.char(30,37,122,128), string.char(34,0,0), 1)
1807loadstring(a)()
1808]],
1809patch = [[ ]],
1810}
1811
1812Bug{
1813what = [[maliciously crafted precompiled code can blow the C stack]],
1814report = [[Greg Falcon, on 2008/03/25]],
1815since = [[5.0]],
1816example = [[
1817function crash(depth)
1818 local init = '\27\76\117\97\81\0\1\4\4\4\8\0\7\0\0\0\61\115\116' ..
1819 '\100\105\110\0\1\0\0\0\1\0\0\0\0\0\0\2\2\0\0\0\36' ..
1820 '\0\0\0\30\0\128\0\0\0\0\0\1\0\0\0\0\0\0\0\1\0\0\0' ..
1821 '\1\0\0\0\0\0\0\2'
1822 local mid = '\1\0\0\0\30\0\128\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0'
1823 local fin = '\0\0\0\0\0\0\0\2\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\2\0' ..
1824 '\0\0\97\0\1\0\0\0\1\0\0\0\0\0\0\0'
1825 local lch = '\2\0\0\0\36\0\0\0\30\0\128\0\0\0\0\0\1\0\0\0\0\0\0' ..
1826 '\0\1\0\0\0\1\0\0\0\0\0\0\2'
1827 local rch = '\0\0\0\0\0\0\0\2\0\0\0\1\0\0\0\1\0\0\0\1\0\0\0\2\0' ..
1828 '\0\0\97\0\1\0\0\0\1'
1829 for i=1,depth do lch,rch = lch..lch,rch..rch end
1830 loadstring(init .. lch .. mid .. rch .. fin)
1831end
1832for i=1,25 do print(i); crash(i) end
1833]],
1834patch = [[ ]],
1835}
1836
1837Bug{
1838what = [[code validator may reject (maliciously crafted) correct code]],
1839report = [[Greg Falcon, on 2008/03/26]],
1840since = [[5.0]],
1841example = [[
1842z={}
1843for i=1,27290 do z[i]='1,' end
1844z = 'if 1+1==2 then local a={' .. table.concat(z) .. '} end'
1845func = loadstring(z)
1846print(loadstring(string.dump(func)))
1847]],
1848patch = [[ ]],
1849}
1850
1851Bug{
1800what = [[ ]], 1852what = [[ ]],
1801report = [[ , on ]], 1853report = [[ , on ]],
1802since = [[i ]], 1854since = [[i ]],
1803example = [[ ]], 1855example = [[ ]],
1804patch = [[ ]], 1856patch = [[ ]],
1805} 1857}
1858