Changes for page Homoiconicity

Last modified by Nicolas Gregoire on 2012/01/05 00:18

From version Icon 2.1 Icon
edited by Nicolas Gregoire
on 2012/01/04 23:25
Change comment: There is no comment for this version
To version Icon 2.2 Icon
edited by Nicolas Gregoire
on 2012/01/05 00:12
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -1,3 +1,5 @@
1 +== Definition ==
2 +
1 1  Homoiconicity is the property of a programming language that the code and the data are stored in the same format. For example, the following languages are homoiconics :
2 2  
3 3  * ASM : using bytes stored in memory
... ... @@ -8,3 +8,36 @@
8 8  
9 9  
10 10  
13 +
14 +
15 +== Triggering embedded code ==
16 +
17 +In some contexts (like browsers), XSLT code execution can be triggered while a XML document is parsed, via a xsl:stylesheet tag. The executed XSLT code can be stored on the Internet or in the XML document itself (homoiconicity + self-reference trick). A [[blog post>>http://scarybeastsecurity.blogspot.com/2011/01/harmless-svg-xslt-curiousity.html||rel="__blank"]] by Chris Evans describes a pseudo SVG file triggering a simple RAM DoS . But we can do better ;-)
18 +
19 +== Simple dynamic SVG images ==
20 +
21 +We can create XML files which will be interpreted by browsers like perfectly valid self-contained dynamic SVG images. The SVG file is then generated on the fly by the (Turing complete) XSLT engine of the browser. In the following example, the XSLT code will
22 +
23 +* fingerprint the underlying XSLT engine
24 +* draw a circle (red if Webkit, green, otherwise)
25 +* display some properties
26 +*
27 +
28 +== Evil SVG images ==
29 +
30 +Exploitcolor depends of the OS, ...) and exploit a specific vulnerability. This was demonstrated with[[CVE-2011-1774>>http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-1774||rel="__blank" title="CVE-2011-1774"]] and a Webkit exploit tested on Windows, Linux, iOS and webOS.
31 +
32 +From a security point of view, it is important to audit
33 +
34 +
35 +
36 +
37 +As the SVG format is valid XML too, t
38 +
39 +The process is the following :
40 +
41 +* The source XML file (do not
42 +
43 +
44 +
45 +