<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>On the road to Bandol &#187; Security</title>
	<atom:link href="https://javacard.vetilles.com/category/java-card-2x/security/feed/" rel="self" type="application/rss+xml" />
	<link>https://javacard.vetilles.com</link>
	<description>A weblog on Java Card, security, and other things personal</description>
	<lastBuildDate>Mon, 18 Aug 2025 06:48:26 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.32</generator>
	<item>
		<title>Java Card++ ?</title>
		<link>https://javacard.vetilles.com/2025/08/18/java-card/</link>
		<comments>https://javacard.vetilles.com/2025/08/18/java-card/#comments</comments>
		<pubDate>Mon, 18 Aug 2025 06:47:58 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=26403</guid>
		<description><![CDATA[I was part of the team that defined the binary format that has been in use since the end of the 1990&#8217;s. The selected solution was not my preferred one, as I preferred a pre-linked version. At the time, everybody agreed that on-card verification was too ambitious, so this was never considered for Java Card [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I was part of the team that defined the binary format that has been in use since the end of the 1990&#8217;s. The selected solution was not my preferred one, as I preferred a pre-linked version. At the time, everybody agreed that on-card verification was too ambitious, so this was never considered for Java Card 2.1, the ancestor of today&#8217;s Java Card specification.</p>
<p>In the following years, we wasted a lot of time working on a much more ambitious version of Java Card, which never made it, but we never worked on addressing this issue of unverified bytecode, mostly because we had the cryptographic protections provided by GlobalPlatform. If nobody can load unverified bytecode, where is the problem?</p>
<p>As an evaluator, this allowed me to reverse engineer many types of Java Card, as I was allowed to download unverified (and very much illegal) bytecode into cards. Over time, most virtual machines have included runtime countermeasures, and some implementations have been difficult to attack with illegal bytecode for quite a while.</p>
<p>Yet, Java Card has become an industry standard. Strong implementations exist, in which loading unverified bytecode is about impossible, and then, exploiting unverified bytecode is challenging. But on the other hand, weaker platforms also exist, and recently, following a combination of mistakes from various stakeholders, <a href="https://security-explorations.com/esim-security.html" class="liexternal">one of them was broken</a>; luckily, by a researcher, not by a criminal.</p>
<p>The real surprise is not that this has happened. It is that it took over 25 years for it to happen. The lack of on-card verification has always been a weakness in the Java Card story. Over the past 25 years, there have been a few attempts to address the issue, but the industry never adopted them. Isn&#8217;t a solution to this issue a bit overdue?</p>
<p>The smart card industry is a small industry, with few actors, and Java Card has been a great success, its interoperability providing the basis for the deployment of billions of products every year. But the industry has been complacent, and although I am not part of it any more, I bear some of this responsibility since I have headed the Java Card Forum&#8217;s Technical Committee for a few years. I defended off-card bytecode verification many times, for instance  <a href="https://javacard.vetilles.com/2011/10/19/the-misuse-of-bytecode-verification/" class="liexternal">in 2011</a> and quite vehemently <a href="https://javacard.vetilles.com/2013/11/21/the-off-card-byte-code-verifier-is-fine-thank-you/" class="liexternal">in 2013</a>.</p>
<p>But that was over 10 years ago, and I would now argue that it&#8217;s time to fix this issue. Despite minor updates, the core Java Card technology is over 25 years old. The similarity between the latest version of the Java Card Virtual Machine specification with its first interoperable version is striking. There have been almost no changes. The CAP file format is antiquated, and an update could allow all vendors to ensure that no illegal bytecode is allowed to run on the any card.</p>
<p>From a now outsider&#8217;s viewpoint, I believe that after the recent developments and an issue impacting the security of millions of unsuspecting users, the usual denials sound really out of touch with reality, so I am asking the Java Card community a simple question: Since you are pushing for Java Card to be the basis for our personal security, and asking us to trust you with our sensitive data, including our identity, isn&#8217;t it now the right time to put this bytecode issue behind us once and for all?</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2025/08/18/java-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logical Attacks in the Java Card security landscape</title>
		<link>https://javacard.vetilles.com/2016/11/10/logical-attacks-in-the-java-card-security-landscape/</link>
		<comments>https://javacard.vetilles.com/2016/11/10/logical-attacks-in-the-java-card-security-landscape/#comments</comments>
		<pubDate>Thu, 10 Nov 2016 18:11:05 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[logical attack]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=26293</guid>
		<description><![CDATA[Logical attacks on Java Card have been known for a long time, and they have also been a focus of a lot of academic research, which still continues today. Earlier this week at Cardis 2016, there have been two presentations on logical attacks. I will not discuss the details of the attacks that are being [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Logical attacks on Java Card have been known for a long time, and they have also been a focus of a lot of academic research, which still continues today. Earlier this week at <a href="https://2016.cardis.org/" title="Cardis 2016" class="liexternal">Cardis 2016</a>, there have been two presentations on logical attacks. I will not discuss the details of the attacks that are being disclosed; the important thing is that the publicly available information about logical attacks is increasing regularly over time.</p>
<p>What amazed me most during these presentations is the very low security level of some cards that are being sold in 2016. Among my surprises, I noted:</p>
<ul>
<li><strong>Object meta-data in the heap.</strong> I would have expected the object meta-data (headers) to be separated from heap data in a dedicated array of <em>handles</em>. But apparently, there is a significant proportion of cards that don&#8217;t use that basic protection (actually, my surprise comes from the fact that cards have more and more memory, and handles help to manage large heaps with a 16-bit reference).</li>
<li><strong>Single key encryption key.</strong> In some cards, key material stored in <code>SecretKey</code> and <code>PrivateKey</code> objects are encrypted, but the same key is used for all objects. This weakness may be the most symptomatic of how logical attacks are being ignored, as it provides a good protection against hardware attacks (like a memory dump), but no protection at all from logical attacks that &#8220;jump&#8221; the firewall.</li>
<li><strong>No key encryption.</strong> Apparently, some cards don&#8217;t even bother to encrypt their secrets at all. That&#8217;s really bad, I even have trouble believing it (which explains the &#8220;apparently&#8221;). Yet, it only shows great disdain for any security, not just logical attacks.</li>
</ul>
<p>The problem with the two first issues come from one of the most powerful features of logical attacks. These attacks run as a legitimate Java Card application, and they are able to <em>impersonate</em> an application. As such, they can defeat some protections (like the encryption of keys, or the integrity protections of a PIN counter) without breaking the protection itself. Basically, you don&#8217;t need the key if someone holds the door for you.</p>
<p>Now, we come to the main reason why logical attacks are not being considered. Most smart cards must undergo some kind of security evaluation before they reach the market. This evaluation is performed by security laboratories, including Riscure, which presented on of the Cardis papers. These laboratories find vulnerabilities, for instance using logical attacks, and they then try to build attacks from these vulnerabilities. A card will fail the evaluation only if such a complete attack can be built.</p>
<p>Furthermore, laboratories follow strict guidelines, often those defined in the <a href="https://www.ssi.gouv.fr/archive/site_documents/JIL/JIL-The_application_of_attack_potential_to_smartcards_V2-1.pdf" class="lipdf">Application of Smart Card Attack Potential</a> to rate the difficulty of attacks, and only attacks that are rated under some predetermined level can be considered.</p>
<p>All of this make perfect sense, since the laboratory is supposed to evaluate the ability of a potential attacker with given skills and resources to &#8220;break&#8221; the card. For this reason, these evaluations have often focused greatly on cryptography: if an attacker is able to &#8220;guess&#8221; a secret/private key, then the card is most likely broken.</p>
<p>The problem with logical attacks is that, in order to be exploited, they need to be combined with other attacks. In particular, most (all) deployed cards only allow the loading of an application after a successful GlobalPlatform authentication. In order to exploit a logical attack, this authentication (or the checks related to that authentication) needs to be broken. This is a very strong condition, which makes it very unlikely. So, from a traditional smart card evaluation point of view, I admit that it makes perfect sense to ignore logical attacks as being a remote possibility of attack.</p>
<p>Before continuing, I need to distinguish between two kinds of security evaluations: <em>black-box</em> evaluations, in which the laboratory only has access to the cards, without any non-public documentation, and <em>white-box</em> evaluations, in which the laboratory has access to full information, including source code and tests.</p>
<p>Logical attacks are very interesting to learn about the targeted platform, and get information about the implementation options used by a card, and globally revere engineer the platform. As such, they are not useful in white-box evaluations, where reverse engineering is not required. However, they are very useful in black-box evaluation, because this is how an evaluator learns about the cards, and uses this knowledge to select the hardware attacks that are most likely to work. In a black-box evaluation, or in a real attack, logical attacks are an essential tool to optimize attacks. When they don&#8217;t work, the attacker is blind in performing attacks, and likely to waste a lot of time. In addition, the attacker will immediately get the feeling that the vendor has invested on the card&#8217;s security, which is bad news (from an attacker&#8217;s point of view).</p>
<p>The papers from Cardis 2016 are interesting in this perspective, because the researchers have started to investigate the cards a bit further. In particular, on some cards, they have identified the fact that the implementation of some APIs does not follow the Java Card specification, and/or uses proprietary bytecode instructions. Through that work, they are getting closer to &#8220;traditional&#8221; hacking, where vulnerabilities are found in the OS and exploited. They are not there yet, but it is coming.</p>
<p>Finally, and possibly most importantly, the smart card industry is evolving, in particular for the SIM market. There is a move toward eUICC, and possibly toward some kind of &#8220;software SIMs&#8221; that would leverage the security features of a device&#8217;s main chipset rather than run on a dedicated hardware. Such a software SIM would still be quite isolated from the main OS, for instance using TrustZone, but <a href="http://bits-please.blogspot.fr/" class="liexternal">some researchers</a> have shown that TrustZone software can be broken. And then, logical attacks become plausible, and very interesting for attackers, in particular for their application impersonation capabilities.</p>
<p>In my previous jobs, I have long fought the idea that the security of Java Card implementation should be left to competition as a differentiation feature for vendors, mostly because customers can&#8217;t tell the difference. As Java Card moves out of dedicated hardware, its security landscape is going to evolve, and hopefully this change will be considered by the industry.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2016/11/10/logical-attacks-in-the-java-card-security-landscape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Card software attacks</title>
		<link>https://javacard.vetilles.com/2016/06/03/java-card-software-attacks/</link>
		<comments>https://javacard.vetilles.com/2016/06/03/java-card-software-attacks/#comments</comments>
		<pubDate>Fri, 03 Jun 2016 11:29:20 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=25883</guid>
		<description><![CDATA[There have been two papers at SSTICâ€™16 that outline the limits of bytecode verification in the context of Java Card. One of the papers, by Guillaume Bouffard and Julien Lancia, describes a bug found in Oracle&#8217;s bytecode verifier through fuzzing (yes, itâ€™s been fixed). The second one, by Jean Dubreuil, outlines several logical and combined [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>There have been two papers at <a href="https://www.sstic.org/2016/" class="liexternal">SSTICâ€™16</a> that outline the limits of bytecode verification in the context of Java Card. One of the papers, <a href="https://www.sstic.org/2016/presentation/fuzzing_and_overflows_in_java_card_smart_cards/" class="liexternal">by Guillaume Bouffard and Julien Lancia</a>, describes a bug found in Oracle&#8217;s bytecode verifier through fuzzing (yes, itâ€™s been fixed). The second one, <a href="https://www.sstic.org/2016/presentation/java_card_security_software_and_combined_attacks/" class="liexternal">by Jean Dubreuil</a>, outlines several logical and combined attacks through legal applets.</p>
<p>I will refrain from commenting on the first paper because of my previous involvement with Oracleâ€™s Java Card technology, but I would like to make a few comments on the second one.</p>
<p>First, this paper is very well-written, and the attacks are really easy to understand, at least if you have the appropriate background. The attacks are all interesting, and some of them, in particular on the logical part, seem a little bit too easyâ€¦ Maybe some quality issues in some places.</p>
<p>I have two remarks, though.</p>
<p>First, the general comment about logical attacks that </p>
<blockquote><p>the correctness implementation of the JCVM embedded on sensitive products must be carefully checked
</p></blockquote>
<p> is OK, but the following statement about the bytecode verifier (BCV) sounds strange:</p>
<blockquote><p>Today, a huge part of the security of the products relies on the robustness of the BCV but these attacks demonstrate that the BCV is not always sufficient enough to protect the JCVM against this type of software attacks.
</p></blockquote>
<p>A BCV reasons on the application, and makes no claim that the applications will run securely on a buggy JCVM implementation. There is nothing to demonstrate here, because the BCV has never been intended to protect against this type of software attacks. We need to stress that there is nothing to be done at the level of the BCV to counter these attacks. Here, we need to verify the JCVM implementations.</p>
<p>The second remark is about a sentence in the conclusion, which states that</p>
<blockquote><p>tests like TCK are not designed to find this kind of bugs in implementations.
</p></blockquote>
<p>Thatâ€™s true for the stack overflow bug, which is an implementation bug. However, it is not obvious for the two other bugs:</p>
<ul>
<li>The firewall check on a cast should be tested by the TCK. I am actually surprised that it isnâ€™t, but I donâ€™t have access to the TCK these days.</li>
<li>Similarly, the implementation bug on the switch instructions is a also a compliance issue, and should be somehow caught by the TCK (it is more of a corner case, though, so it raises the question of required TCK coverage).</li>
</ul>
<p>In the end, I agree on the fact that labs should have a library of malicious applets of all kinds that they use in evaluations, but compliance issues should be as much as possible checked by the TCK.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2016/06/03/java-card-software-attacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fiction (maybe): Who will refuse to break a secure element?</title>
		<link>https://javacard.vetilles.com/2016/02/19/fiction-maybe-who-will-refuse-to-break-a-secure-element/</link>
		<comments>https://javacard.vetilles.com/2016/02/19/fiction-maybe-who-will-refuse-to-break-a-secure-element/#comments</comments>
		<pubDate>Fri, 19 Feb 2016 18:44:41 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Mobile Security]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[logical attack]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=25857</guid>
		<description><![CDATA[Apple is refusing to break an iPhone for the FBI. I believe that they are right to do so, but also that this position isn&#8217;t that easy to stand for everybody. So, here is a little fiction (well, I think it is fiction) about this. The iPhone is a secure device, so the best way [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Apple is refusing to break an iPhone for the FBI. I believe that they are right to do so, but also that this position isn&#8217;t that easy to stand for everybody. So, here is a little fiction (well, I think it is fiction) about this.</p>
<p>The iPhone is a secure device, so the best way for Apple to refuse breaking the phone is to claim that they can&#8217;t do it. Here is the story line:</p>
<ul>
<li>The iPhone includes a secure element.</li>
<li>The security code is stored and verified in the secure element.</li>
<li>The phone encryption key also is stored in the secure element.</li>
<li>In order to get that key from the secure element, the security code must be presented.</li>
<li>We don&#8217;t know how to break into the secure element, so we can&#8217;t bypass that security mechanism.</li>
</ul>
<p>It is a bit technical, but it is true from the point of view of Apple and &#8220;standard&#8221; developers. But the last statement (we don&#8217;t know how to break into the secure element) may not work for everybody.</p>
<p>First, regardless of the secure element, physical attacks are feasible, and there are many kinds. Some of them, like power analysis, do not even require to destroy the chip in any way. Of course, many such attacks will require &#8220;opening&#8221; the secure element to expose the chip and do other things that may destroy it. In the case of the FBI, who wants to attack a single chip that they must not destroy, this is not really nice.</p>
<p>Then, the secure element on the iPhone is most likely based on Java Card. This means that it is possible to load applications on it. Of course, Java Card includes security measures, so the application needs to be a malicious one; well, there are malicious applications around, and here, we are working with software. This makes a big difference. Now, here is the checklist for FBI:</p>
<ol>
<li>Get Apple to provide 100 secure elements configured exactly like the targeted one, with the card management keys (required to load an app).</li>
<li>Get some hacker to develop a malicious application that gets the value of the code, or bypasses the code check, or gets the value of the encryption key, &#8230;</li>
<li>Establish an attack procedure and test it on actual phones.</li>
<li>Get Apple to provide the management key for the targeted phone.</li>
<li>Run the attack on the targeted phone, and bingo!</li>
</ol>
<p>This is slightly different. Apple still needs to collaborate, but not at the same level. Step 4, in particular, is about providing a key that can only be used on the terrorist&#8217;s phone. Step 1 is a bit more difficult, since Apple needs to support hacking efforts on their phones.</p>
<p>There is also a need to get a hacker. This may not be as difficult as it sounds, because as far as I know, the population of hackers capable of doing such a thing is small but includes:</p>
<ul>
<li>security evaluators working at labs who necessarily have ties to NIST (very close to NSA, here), or to the equivalent in another country;</li>
<li>people working in various companies and institutions who depend greatly on government contracts;</li>
<li>and a few real hackers, who could do some work for money, fame, or both.</li>
</ul>
<p>All these people, for various reasons, are far more vulnerable than Apple, and it is quite likely that FBI will be able to find one to cooperate with them.</p>
<p>And then, what&#8217;s left? Well, the security of some secure elements and Java Card implementations are really really good, and they will be protected against more attacks, performed by most attackers. Luckily, the handful of guys who may be able to break these implementations may not be willing to do so.</p>
<p>Still, it sounds like a good idea to support Apple here.</p>
<p><strong>Final thought</strong></p>
<p>This is now a problem that every security professional/company who is involved in the development, testing, or evaluation of consumer or industrial devices must think about: How will I react to injunctions from law enforcement? Should I make sure that I don&#8217;t know how to hack my device? </p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2016/02/19/fiction-maybe-who-will-refuse-to-break-a-secure-element/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Off-Card Bytecode Verifier is fine, thank you!</title>
		<link>https://javacard.vetilles.com/2013/11/21/the-off-card-byte-code-verifier-is-fine-thank-you/</link>
		<comments>https://javacard.vetilles.com/2013/11/21/the-off-card-byte-code-verifier-is-fine-thank-you/#comments</comments>
		<pubDate>Thu, 21 Nov 2013 13:42:50 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[logical attack]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=877</guid>
		<description><![CDATA[REWRITTEN on 23 Nov. 2013. A few weeks ago, a friend sent me a link to the Cardis program, with the message &#8220;A bug in the verifier?&#8221;. Looking at the program, I saw a paper entitled Manipulating frame information with an Underflow attack undetected by the Off-Card Verifier, by Thales Communications and Security. This sounded [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>REWRITTEN on 23 Nov. 2013.</p>
<p>A few weeks ago, a friend sent me a link to the <a href="http://cardis.sec.t-labs.tu-berlin.de/program.html" class="liexternal">Cardis</a> program, with the message &#8220;A bug in the verifier?&#8221;. Looking at the program, I saw a paper entitled <em>Manipulating frame information with an Underflow attack undetected by the Off-Card Verifier</em>, by Thales Communications and Security. This sounded like bad news, so I got a copy of the paper and read it. </p>
<p>The good news is that there is no bug. Nevertheless, reading the paper made me unhappy. As a consequence, the first version of this blog post was a flame, in which I qualified the paper of &#8220;dishonest, not innovative, and misleading&#8221;.</p>
<p>Publishing the flame triggered some discussions, with people at Thalès and with other people, in particular with Jean-Louis Lanet of XLIM. They provided me their views on the topic, and I have decided to revise my original flame into a more mundane and constructive post.</p>
<h4>Dishonest, or just a bad title.</h4>
<p>As mentioned above, the paper&#8217;s title is&#8221;Manipulating frame information with an Underflow attack undetected by the Off-Card Verifier&#8221;. However, section 3.2 of the paper surprisingly starts with the sentence: &#8220;The standard Oracle bytecode verifier detects the underflow attack&#8221;. There is no other reference to a verifier that would not detect that attack, and that makes the title sound really dishonest, at least the &#8220;undetected&#8221; part of it.</p>
<p>More specifically, it seems that the objective of the paper is not to point to an issue in the off-card verifier, as the title seems to, but rather to point to the fact that there exist ways to bypass the verification. A revision of the title in the proceedings would do just fine.</p>
<h4>Not innovative, or not published.</h4>
<p>The paper describes an attack that uses the <code>dup_x</code> instruction to perform a stack underflow. This stack underflow allows the authors to access the content of a stack frame, including the current context, and to change it. The question is: is this a new attack? As a virtual machine implementer and evaluator, I would say no immediately. This attack very easily comes to mind as soon as you know the content of a stack frame (as an implementer does). This attack has therefore been in my &#8220;bag of tricks&#8221; when I was an evaluator, and was even quite a practical one.</p>
<p>Now, the smart card industry is secretive, and evaluators are even more secretive. Very few actual attacks have been described in scientific papers. It seems that the attack to mention stack underflow is the EMAN2 attack described by Bouffard <em>et al.</em> at Cardis in 2011. However, they only abuse the return address, labeling the current context &#8220;unknown value&#8221;. In that context, it seems that this paper describes something that has not been published before. For this one, my apologies, as I forgot the secrecy of the industry, and kudos for actually publishing this rather than keeping it secret.</p>
<p>So now, the community knows that, unverified bytecode can lead on some cards to allowing an attacker to run attacker-provided code in a chosen context. This is about as bad as it gets, and now, additional attacks will fall in my &#8220;tricks&#8221; category, in which an attacker/evaluator uses a new illegal bytecode combination because the previously known ones don&#8217;t work on a card. I hope that we won&#8217;t see more scientific papers about such tricks (see Jean-Louis Lanet&#8217;s second comment about this).</p>
<h4>Misleading, or missing its target.</h4>
<p>Of course, since the off-card verifier catches all of these logical attacks, they are not supposed to occur in real life, where bytecode verifiers are systematically used.</p>
<p>Let&#8217;s make a parallel between two typical components, RSA and a virtual machine. RSA is a crypto algorithm, a function <em>RSA(K,M)</em> that takes as input a key <em>K</em> and a message <em>M</em>, and produces a result. Similarly, a virtual machine is a function <em>VM(P,I)</em>, where <em>P</em> is a program (in bytecode) and <em>I</em> some input data, and produces a result. The RSA and VM functions share something important: the key <em>K</em> and the program <em>P</em> need to obey some properties. If the don&#8217;t, the algorithms don&#8217;t work. </p>
<p>If the RSA prime factors are not prime numbers, or if the program provided to the VM is not valid, their results may not be satisfactory: although they are functionally correct, they will not have the expected security properties. In order to avoid bad keys and bad programs, we use appropriate algorithms to perform primality checks, and to verify bytecode. Just as it is important to ensure that an attacker cannot tamper with the key generation scheme, it is important to ensure that bytecode is verified before to be executed. But is it sufficient?</p>
<p>Well, that may be sufficient if you run your VM or your RSA on a device that is physically protected from attackers. But on a smart card, it isn&#8217;t sufficient, at least for RSA. There have been many attacks published on smart card implementations of RSA, using fault induction, power analysis, and more. The VM is just as sensitive to these attacks; in particular, combined attacks can be used to dynamically create illegal code on a card, as mentioned in the paper.</p>
<p>If we continue the analogy, RSA is still used on cards, even though attacks exist. During security evaluations, the robustness of the implementation is verified by a lab, which ensures that well-known attacks don&#8217;t work. Naturally, the same thing must be done with the VM: a high-security implementation must include significant countermeasures against attacks on VM, such as combined attacks. The implementers have the choice of the countermeasures; they can include additional checks in the virtual machine, attempt to detect the faults, or both, or anything else, as long as it works.</p>
<p>According to my discussion with Thales, this is more or less the point that the paper tries to make, in particular in its last part. However, the paper insists on the malicious application rather than on the attacks, especially in its last sentence:</p>
<blockquote><p>
Finally, this paper shows that during open platform evaluations, it is necessary to take into account malicious applications, and make detailed analysis of each requirement included in the platform guidance.
</p></blockquote>
<p>I definitely agree on the platform guidance aspect. Requiring bytecode verification is not sufficient, as the management of the verification context is also important to avoid logical attacks. However, during evaluations, malicious applications are not the real issue, attacks on the virtual machine are. In that context, malicious applications are for now tied to combined attacks, where a fault triggers the logical attack. What the community often fails to understand is that, on a smart card, a virtual machine is a component like any other: it can be subject to physical attacks. And that&#8217;s the reason why specific countermeasures are required.</p>
<h4>So what?</h4>
<p>In Cardis, the proceedings are collected after the conference, so authors have an opportunity to revise their paper before publication. After our exchanges, I hope that some revisions will be made before publication, in particular on the title and on the last part (making a stronger point about evaluation requirements). And so, I replaced my flame with this. </p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2013/11/21/the-off-card-byte-code-verifier-is-fine-thank-you/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Chip to Cloud, day 2: Automated analysis of Java Card applets</title>
		<link>https://javacard.vetilles.com/2012/09/20/chip-to-cloud-day-2-automated-analysis-of-java-card-applets/</link>
		<comments>https://javacard.vetilles.com/2012/09/20/chip-to-cloud-day-2-automated-analysis-of-java-card-applets/#comments</comments>
		<pubDate>Thu, 20 Sep 2012 13:31:17 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Java Card]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/2012/09/20/chip-to-cloud-day-2-automated-analysis-of-java-card-applets/</guid>
		<description><![CDATA[This is a presentation by Jean-Baptiste Machemie, from the University of Limoges and a new project called Arya Security. The topic is automated analysis of Java Card applets, which is one of my favorite topics, and I am very happy to see interest from academia, as well as the emergence of companies who distribute such [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>This is a presentation by Jean-Baptiste Machemie, from the University of Limoges and a new project called <a href="http://www.arya-security.com/en/home.php" class="liexternal">Arya Security</a>. The topic is automated analysis of Java Card applets, which is one of my favorite topics, and I am very happy to see interest from academia, as well as the emergence of companies who distribute such tools.</p>
<p>The first question is to understand why automated analysis is required for NFC. One of the issues of NFC is the scalability of security evalution processes. There are good schemes forf so-called sensitive applets, which are relate to payment, identity, or other schemes that have strong certification requirements, usually requiring a full evaluation, incouding attacks.</p>
<p>The other applications, so called non-sensitive, are provided by security companies who do not require security certification. Some analysis is required, at least to make sure that they don&#8217;t interfere with the sensitive applications. Today, this analysis is performed manually by laboratories, which is error-prone, effort intensive, and not scalable.</p>
<p>Static analysis is a technology that allows us to completely automate this security analysis. This is done directly on the binary CAP file, without running the application, but simply by analyzing how the code could behave. It is possible to verify plenty of rules, including those defined by AFSCM or by GlobalPlatform. Luckily for Arya Security, these rules have been defined by people who were actually thinking about static analysis, and who made sure that the rules would be easy enough to analyze.</p>
<p>I strongly believe in static analysis, and I have written and talked about it multiple times. I am quite happy that some people get in this market and propose a tool for Java Card. I haven&#8217;t directly tried their tool, but I hope that its algorithms are good enough to avoid lost of false positives, and that they will be adopted.</p>
<p>The main barrier for them is actually NFC adoption. However, if it works, I am quite convinced that static analysis is the only way to go, because any non-automated techniques are not going to be scalable enough. Another company whose fate is linked to the success of NFC (in card emulation mode).</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2012/09/20/chip-to-cloud-day-2-automated-analysis-of-java-card-applets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The misuse of bytecode verification</title>
		<link>https://javacard.vetilles.com/2011/10/19/the-misuse-of-bytecode-verification/</link>
		<comments>https://javacard.vetilles.com/2011/10/19/the-misuse-of-bytecode-verification/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 08:42:21 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Discussions]]></category>
		<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virtual machine]]></category>
		<category><![CDATA[bytecode]]></category>
		<category><![CDATA[GlobalPlatform]]></category>
		<category><![CDATA[static analysis]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=759</guid>
		<description><![CDATA[Bytecode verification has been an interesting debate since the very beginning of Java Card. Back then, in 1997, Java was very much about Java applets, and the bytecode verifier was the essential piece of software that allowed untrusted code to run in a browser efficiently (i.e., without doing expensive runtime checks, and without having to [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Bytecode verification has been an interesting debate since the very beginning of Java Card. Back then, in 1997, Java was very much about Java applets, and the bytecode verifier was the essential piece of software that allowed untrusted code to run in a browser efficiently (<em>i.e.</em>, without doing expensive runtime checks, and without having to setup a complex process of applet vetting). We inherited this view of bytecode verification in Java Card, and the verifier was integrated in the Java Card virtual machine.</p>
<p>Since then, there have been many debates about bytecode verification, and my own position has evolved over the years. Today, my opinion is a bit contrasted, some may even say contradictory. Nevertheless, here it is:</p>
<ul>
<li>Bytecode verification has limited use for Java Card runtime security.</li>
<li>Extended bytecode verification is a very good tool for application vetting.</li>
</ul>
<p>Let me give a few more details about these two opinions.</p>
<h4>Bytecode verification and runtime security</h4>
<p>The idea of runtime verification is that it is performed after getting the code, and right before to run it. The code that runs is therefore known correct, at least regarding bytecode execution (unrelated attacks remain possible, of course).</p>
<p>The first big issue with bytecode verification is that, in Java Card, with the split virtual machine model, verification is not performed on the card, but outside of the card, before/during/after converting the application into Java Card&#8217;s specific binary format (CAP file). Then, the application is sent to the card over some channel that may be attacked. Here, we rely on GlobalPlatform&#8217;s cryptography-based security to protect the integrity of the code. So, basically, we still need to establish trust, and we must say goodbye to the power of running untrusted code from arbitrary developers.</p>
<p>This is not a big issue in practice, because there is no business model that allows arbitrary code to be loaded on cards. However, this causes an organizational problem, as the verification process needs to be well organized. Researchers from Nijmegen and Limoges have shown that it is possible to fool the verification process with fake export files, and then load on a card verified code that will perform type confusion attacks.</p>
<p>Going beyond that, some people have designed applications that can be verified, but have been designed to be attacked through hardware attacks (fault induction, usually). Such attacks, usually known as hybrid attacks, completely fool the bytecode verification process.</p>
<p>Most security experts will then remind you at this point of the discussion that bytecode verification is only one part of the process, that GlobalPlatform is also important, that the origin of code is usually known, that this makes it very difficult to include attack code in an application, <em>etc</em>. By doing this, they are just about accepting the fact that bytecode verification is useless or at best  marginally useful: the real security of cards is in the trust between issuers and application providers, and some cryptographic process. Basically, this works because the ecosystems are small enough to be controlled (which is true for cards, and fine for me).</p>
<p>Finally, some vendors claim to have developed defensive virtual machines, which do not require a bytecode verifier, and perform enough runtime verifications to accept any bytecode, good or bad, without any risk. In that case, bytecode verification is really useless, and I believe that it makes things much simpler. Of course, such virtual machines are difficult to design and implement efficiently, but this is definitely possible, and I think that it has been done in the past (or at least that some people has come very close to it).</p>
<p>To conclude, I will get back many years ago. In 2000, Trusted Logic was very proud of its on-card bytecode verifier; the technology worked, but it has not been widely adopted. I believe that the first factor was performance, as verification made the loading and linking process much slower. I also believe that a second factor, less obvious, is that on-card bytecode verification makes the card&#8217;s security more brittle, by encouraging VM developers to rely too much on static verification rather than runtime checks (which also prevent other runtime attacks, for instance using fault induction). More than ten years later, most people admit that this was not the way to go, and I just go one step further by stating that bytecode verification is not that useful for runtime security.</p>
<h4>Bytecode verification and application vetting</h4>
<p>Bytecode verification simply consists of a very simple static analysis of the application code. Basically, this is is a program proof, but a very simple one, whose complexity can be controlled. The objective of such simple proofs is not to demonstrate that a program is correct with respect to its specification, but that this program obeys a predefined set of properties.</p>
<p>For Java bytecode verification, these properties are related to the proper ues of the bytecode instructions. However, the same algorithms can be extended in order to prove many more properties, covering many aspects of application security. Among the things that can be proven, we have the following:</p>
<ul>
<li>Method <em>M</em> is not called.</li>
<li>Method <em>M</em> is not called with arguments <em>A1</em>, &#8230;, <em>An</em>.</li>
<li>Method <em>M</em> is always called before/after method <em>N</em>.</li>
<li>Method <em>M</em> never throws a <code>NullPointerException</code> (or any other exception).</li>
<li>Command <em>INS</em> can only return status codes <em>SW1</em>, &#8230;, <em>SWn</em></li>
<li>Toolkit buffers are only used when they are available.</li>
<li>and many more.</li>
</ul>
<p>Of course, there is no magic. When extending static analysis to many properties, it becomes more and more difficult to avoid false positives, <em>i.e.</em> errors that are caused by weaknesses in the algorithms. Put simply, an application is rejected although it is in fact correct.</p>
<p>Apart from working on the algorithms to make them better, there are two ways to deal with this issue:</p>
<ul>
<li>Providing the verification tool to developers, together with explanations about the rules to follow. Usually, it is rather simple for developers to ensure that their application can be verified, provided that they can use the tool throughout the development process.</li>
<li>Use the tool in a vetting process as a guide for evaluators, who then perform additional verifications. In that case, broken rules are considered as warnings, and then verified by the evaluators. Simple applications can usually be verified easily, and more complex verification requires a few checks, simplified by the fact that the most boring tasks are performed automatically.</li>
</ul>
<p>I believe in both approaches, but the second one has been proven efficient by my then colleagues of Trusted Labs. By using such a static analysis tool, they are able to optimize the vetting process of Java Card applications (and MIDlets, but this is another story) significantly, by allowing them to focus on the the most important parts of the applications.</p>
<p>In addition, this approach allows us to include many more security rules. For instance, hybrid applications must include code that can be modified into attack code through a simple attack. It is possible to build a library of patterns of such code sequences, and to check for them statically. Then, evaluators can be warned of the possible presence of an hybrid attack and check for it. This can be promising, because such checks (very boring to do, but very unlikely to lead to anything) are usually poorly performed by humans.</p>
<p>Finally, extended bytecode verification, or static analysis, has been proven to be a very efficient optimization tool. All optimizing compilers include a static analysis phase to perform their most complex optimizations. Java Card can take great advantage of this, because of the isolation between applications, and also because of the closed world hypothesis that is sometimes possible, when cards are closed (no additional applications can be downloaded).</p>
<p>So, bytecode verification has many uses in Java Card, but runtime security just isn&#8217;t the most compelling.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2011/10/19/the-misuse-of-bytecode-verification/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>About e-Smart: Java Card attacks</title>
		<link>https://javacard.vetilles.com/2010/09/28/about-e-smart-java-card-attacks/</link>
		<comments>https://javacard.vetilles.com/2010/09/28/about-e-smart-java-card-attacks/#comments</comments>
		<pubDate>Tue, 28 Sep 2010 20:09:36 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Java Card Bandol]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Java Card]]></category>
		<category><![CDATA[logical attack]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=637</guid>
		<description><![CDATA[I was not at e-Smart this year, but here are some early reports from colleagues who attended the sessions. Over the coming days, I will comment on a few selected presentations. First, one of my favorite topics, which was covered Friday morning: attacks on the Java Card platform. There were two presentations this morning on [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I was not at e-Smart this year, but here are some early reports from colleagues who attended the sessions. Over the coming days, I will comment on a few selected presentations. First, one of my favorite topics, which was covered Friday morning: attacks on the Java Card platform. There were two presentations this morning on this topic, both of them challenging the often accepted simplistic view on bytecode verification.</p>
<p>The first presentation was given by Guillaume Barbu, from Oberthur, about combined attacks on Java Card 3 Connected. Combined attacks are interesting in principle, because they suppose that the attackers are intelligent enough to avoid bytecode verification, while still having the possibility to perform attacks.</p>
<p>A very short reminder on what this is about: in a combined attack, a legal Java Card application is designed to include code that is vulnerable by design to well-known hardware attacks. When the hardware attacks are applied, the legal application becomes a malicious application and performs an attack on the hosting card.</p>
<p>Nothing new here. Guillaume made a first presentation about this last year, and we made presentation about the same topic at Cardis in April. The novelty comes from the exploitation that Guillaume makes of combined attacks. Since he is targeting Java Card 3 Connected, his target is the pool of interned strings. Since strings are everywhere in JC3 Connected, and since they are often used to make security decisions, this attack could be very powerful. For instance, the parameters of permissions are strings, and playing with these strings could greatly extend the permissions granted to an application. These attacks are interesting, but, from the feedback I got, the countermeasures proposed by Guillaume are a bit weak. Well, this reminds us that Java Card 3 Connected remains an implementation challenge.</p>
<p>The other presentation was given by Emilie Faugeron, from Thales ITSEF. Thales has found a bug in a bytecode verifier, and discusses the consequences of such a bug. This story has been unfolding for a while, as the bug has been known from the card security community for a while. I am glad that it finally becomes public, which allows us to comment on it.</p>
<p>When there is a bug in the verifier, it means that a potential attacker could load a malicious applet on a card without being detected by the verifier. The consequences are basically the same as for combined attacks, with the advantage that there is no hardware attack to perform after the loading. </p>
<p>The question is here to know what we should do about it. Thales proposes to evaluate the bytecode verifiers (on-card and off-card) during a Common Criteria process. This sounds obvious at first, but there are significant differences between a bytecode verifier and a Java Card Virtual Machine:</p>
<ul>
<li>First, a bytecode verifier is a highly standardized piece of software. On other platforms, VM vendors are not allowed to modify the verifier&#8217;s reference implementation. The specification of a verifier is always the same, and it changes very rarely.</li>
<li>In Java Card, there is an exception with on-card verifiers. Because of the high level of optimization required, a few differences may be expected. For instance, Trusted Logic&#8217;s verifier requires an initial normalization phase before to load the application; however, the combination of normalizer and verifier implements exactly the same specification as other verifiers.</li>
<li>There are very few implementations of verifiers that are publicly used. The verifiers are always the same, and I would assume that Oracle&#8217;s verifier is the most commonly used. In that context, building a viable certification environment is hard.</li>
<li>There already exists significant test suites for Java Card bytecode verifiers. Trusted Logic has one, of course, to test its own verifier. Oracle has a very significant one, which it uses to test its verifiers. And obviously, Thales has one now. And I assume that other actors have some.</li>
<li>Testing a bytecode verifier is a hard task. A bytecode verifier is a static code analysis tool, and these tools are well-known to be very difficult to test, because of the level of abstraction required.</li>
</ul>
<p>So, what can we do? One option is to follow Thales&#8217; advice. This sounds tempting for me; I have strong ties with Trusted Labs, which could perform such evaluations, we have access to a test suite, and we have been developing and testing static analysis tools for about ten years. If I am wrong about the potential business, this is likely to happen.</p>
<p>The alternative way is to remind ourselves that a bytecode verifier should follow a reference design, preferably provided b yOracle. This is what happens on all other platforms, and there is no reason to keep a Java Card exception. For such pieces of sofftware, which evolve very slowly, nothing beats public scrutiny. There are many researchers (for instance, wy friends from Limoges and Nijmegen) who would love to take a look at a bytecode verifiers and its tests.</p>
<p>I don&#8217;t have a plan for this, but it really looks like, in this matter, collaboration between all actors sounds much better than competition between evaluation laboratories. We&#8217;ll see what happens.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2010/09/28/about-e-smart-java-card-attacks/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Live from Cardis2010: Combined attacks on Java Card</title>
		<link>https://javacard.vetilles.com/2010/04/15/live-from-cardis2010-combined-attacks-on-java-card/</link>
		<comments>https://javacard.vetilles.com/2010/04/15/live-from-cardis2010-combined-attacks-on-java-card/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 13:54:42 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card 2.x]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Java Card]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=569</guid>
		<description><![CDATA[I just made my second presentation at Cardis2010, about combined attacks on Java Card (joint work with Anthony Ferrari, now in charge of these things at Trusetd Labs). Sorry, no &#8220;public&#8221; slides this time, this is related to security evaluation. Interestingly, the current presenter is Guillaume Barbu, from Oberthur, who is presenting an interesting attack [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I just made my second presentation at Cardis2010, about combined attacks on Java Card (joint work with Anthony Ferrari, now in charge of these things at Trusetd Labs). Sorry, no &#8220;public&#8221; slides this time, this is related to security evaluation.</p>
<p>Interestingly, the current presenter is Guillaume Barbu, from Oberthur, who is presenting an interesting attack based on the same principle: we load a perfectly legal application on the card, and &#8220;magically&#8221; make it illegal by using a physical attack. My technique is to replace an instruction with a <code>nop</code>, and his technique is to block the throwing of an exception (execution continues even though it should have failed).</p>
<p>This doesn&#8217;t sound very interesting, and not a real novelty. After all, we were already able to get type confusion with simple logical attacks. The main difference is here that the applications we use are actually legal, and that their behavior is modified dynamically (one of my colleagues calls them mutant applications, which makes this really scary). In the microcosm of evaluation labs, this is a game changer, because the main argument used against logical attacks until now was &#8220;Bytecode verification is mandatory, so your attacks won&#8217;t work&#8221;. With mutant applications, this argument doesn&#8217;t hold anymore.</p>
<p>But does it really change things when we get out of the evaluation lab? Not really. Writing an attack application may be easy, but exploiting it remains very hard. Smart cards are highly controlled environments, and traceability remains the norm. Our attacker A must be an insider in a company that actually develops an applications. This attacker A then needs to plant a Trojan horse in one of his company&#8217;s applications, and have it loaded on a number of platforms. So far, so good.</p>
<p>The problems come by when the attack is actually exploited: with the kind of traceability we have on smart cards, as soon as the attack will be triggered, it will be noticed, and labs will trace the attack back to that application. If you combine that with the fact that this attack required physical access to the smart card that is being attacked, its practical impact becomes quite limited. It is mostly useful if you have a brittle security system, in which disclosing a key breaks the entire system. But in that case, the problem is not really in the Java Card implementation, but in the system itself. Even without this attack, this key would have been compromised.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2010/04/15/live-from-cardis2010-combined-attacks-on-java-card/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Live from #esmart: Fault attacks on Java Card 3.0</title>
		<link>https://javacard.vetilles.com/2009/09/25/live-from-esmart-fault-attacks-on-java-card-30/</link>
		<comments>https://javacard.vetilles.com/2009/09/25/live-from-esmart-fault-attacks-on-java-card-30/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 09:45:47 +0000</pubDate>
		<dc:creator><![CDATA[Eric Vétillard]]></dc:creator>
				<category><![CDATA[Java Card Bandol]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[logical attack]]></category>

		<guid isPermaLink="false">http://javacard.vetilles.com/?p=471</guid>
		<description><![CDATA[That talk, from Guillaume Barbu, an Oberthur and Telecom ParisTech Ph.D. student, really talks to me, by bringing together two of my favorite discussion topics. The main task is about combined attacks, which sounds really good. A Java Card 3.0 card has plenty of countemreasures against logical attacks Context isolation. Objects from an application can&#8217;t [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>That talk, from Guillaume Barbu, an Oberthur and Telecom ParisTech Ph.D. student, really talks to me, by bringing together two of my favorite discussion topics. The main task is about combined attacks, which sounds really good.</p>
<p>A Java Card 3.0 card has plenty of countemreasures against logical attacks</p>
<ul>
<li>Context isolation. Objects from an application can&#8217;t be accessed from another application. This &#8220;firewall&#8221; si specific to Java Card.</li>
<li>Code isolation. Code from an application cannot be accessed from other applications, making it difficult to indirectly access assets. This is the clas loader mechanism, inherited from Java.</li>
<li>Bytecode verifier. Will reject all kinds of malicious applets, so logical attacks based on &#8220;bad&#8221; code can&#8217;t work any more.</li>
</ul>
<p>A combined attack consists in loading an application that is well-formed, and will nevertheless attempt to act illegally, for instance by accessing another application&#8217;s data. Under normal conditions, the firewall will make this impossible. But if we add a fault attack at the right time, we can allow the illegal access.<br />
<span id="more-471"></span></p>
<p>The example given by the student consists in illegally accessing a method from another application. The class loader hierarchy normally makes this invisible. The idea behind the attack is to use a class with exactly the same definition on the attacker&#8217;s side.</p>
<p>Of course, if you attempt to cast a remote object into the attacker&#8217;s class, the different class loaders will lead to an exception. By putting a fault on the <code>checkcast</code> instruction, we can actually perform this cast and invoke the targeted method.</p>
<p>Of course, this is only the first step. The next step is to use another perturbation to defeat the firewall itself. Oberthur plans on using multithreading to do so (by abusing the context switches), but this is work in progress. There are other ways to achieve the same thing, but the multithreading idea is quite neat.</p>
<p>Their first attack (on <code>checkcast</code>) allows all previously published logical attacks based on type confusion to be made again.</p>
<p>The proposed countermeasure (redundancy) is not really good, as the virtual machine is being attacked here, and adding redundancy at that level could have a significant effect on the overall performance of the cards.</p>
<p>Logical attacks and combined attacks have been available for a while in evaluation labs. It is very nice, from an evaluator&#8217;s point of view, to see that this kind of work is now being published. This could mean that the level of paranoia is lowering in the smart card industry. The fact that a card vendor is publishing this makes it even stronger.</p>
<p>Now, the challenge is on the manufacturers, especially since the attacks described in the presentation also work perfectly on Java Card 2 cards. We now are in a state where there is a published vulnerability, which needs to be industrialized, and then exploited. Luckily, this will require significant efforts of reverse engineering, which will be made more difficult by what remains of the industry&#8217;s paranoia.</p>
<p>Also, let&#8217;s see what the academics working on attacks will make with that. There are still plenty of ideas and details of these attacks that remain confined in laboratories.</p>
]]></content:encoded>
			<wfw:commentRss>https://javacard.vetilles.com/2009/09/25/live-from-esmart-fault-attacks-on-java-card-30/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
