<br><br><div class="gmail_quote">On Dec 29, 2007 9:23 PM, Joshua Gargus &lt;<a href="mailto:schwa@fastmail.us">schwa@fastmail.us</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div>If security is the goal, this seems not to be the first place to spend scarce developer time. &nbsp;</div><div><br></div><div>What are the vectors by which an attacker can cause such malicious bytecodes to be executed? &nbsp;The first three that come to mind are:
</div><div><span style="white-space: pre;">        </span>- direct access to method dictionaries and/or unrestricted compiler access</div><div><span style="white-space: pre;">        </span>- providing malicious input to a system-provided binary code loader
<span style="white-space: pre;">        </span></div><div><span style="white-space: pre;">        </span>- exploiting bugs in the compiler<br></div><div><br></div><div>If the first attack&nbsp;vector is available, crashes due to malicious bytecodes are the least of your problems; arbitrary code execution is a bigger concern. &nbsp;Glancing at the SecureSqueak page, it seems like you probably have a plan for this. &nbsp;Have you already solved this problem? &nbsp;If not, there&#39;s no point in bulletproofing the VM against ill-formed bytecodes.
</div><div><br></div><div>As I mentioned in response to Mathieu, it seems to me that the second attack vector can mostly be dealt with by load-time inspection. &nbsp;I&#39;m not intimately familiar with Squeak&#39;s bytecodes, but I&#39;d be surprised if there were more than a few where run-time checks are actually required.
</div><div><br></div><div>The third case assumes that the compiler is restricted in some way (eg: the attacker cannot simply &quot;crash&quot; the system by compiling a method containing &quot;Smalltalk snapshot: false andQuit: true&quot;); instead they have to find a way to write code such that the compiler accidently generates invalid bytecodes. &nbsp;To provide an extra layer of security,&nbsp;we can always subject the newly-compiled method to the same inspection as we do above when loading binary code.
</div></div></blockquote><div><br><br>Thanks for the input, Josh. I&#39;ll be starting this thread up again when I&#39;m actually ready to submit changes to the VM or fork it. <br></div></div><br>My developer time isn&#39;t scarce. I have about another 50 years left in me :-).
<br><br>To provide more information about what I&#39;m doing, I&#39;m loading code remotely (and transparently, using a distributed object architecture) as bytecodes. The literals in CompiledMethods are rebound when the code is loaded. The code itself is stored in Namespaces, so named literals can only refer to a small set of objects that that code has access to.
<br clear="all"><br>Remotely loaded code wouldn&#39;t usually have access to MethodDictionary-s or CompiledMethods, nor the Compiler. My intention is that code is loaded into a sort of a browser, much like you could load a Project into Squeak now, meaning that code would be from a public source and could be malicious.
<br><br>Gulik.<br><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a>