<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tales from the Crypto : Programmer Hubris</title><link>http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx</link><description>Tags: Programmer Hubris</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>White House moves to Open Source</title><link>http://msmvps.com/blogs/alunj/archive/2009/10/26/1735518.aspx</link><pubDate>Tue, 27 Oct 2009 04:15:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1735518</guid><dc:creator>Alun Jones</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1735518</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1735518</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2009/10/26/1735518.aspx#comments</comments><description>&lt;h2&gt;Subtitle: Media posts uninformed rubbish as commentary&lt;/h2&gt;  &lt;p&gt;From the MSNBC story “&lt;a title="http://www.msnbc.msn.com/id/33463174/ns/technology_and_science-internet/" href="http://www.msnbc.msn.com/id/33463174"&gt;White House opens Web site coding to public&lt;/a&gt;”:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;quot;Security is fundamentally built into the development process because the community is made up of people from all across the world, and they look at the source code from the very start of the process until it&amp;#39;s deployed and after,&amp;quot; said Terri Molini of Open Source for America, an interest group that has pushed for more such programs.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Expecting Open Source to be more secure because the general public contributes to and reviews it is like expecting a televised football match to be safer, because the folks at home are engaged in crowd control and looking for pickpockets.&lt;/p&gt;  &lt;p&gt;While you might luck out in finding a few talented, devoted, and dare I say it, obsessed individuals who will call the police every time they see an infraction on screen, most of the people tuning in are going to be watching the game; and those that are trying to help are often clueless about how the security in the grounds works, and you’ll get many calls from people who see the security guards searching bags on entry as pickpockets.&lt;/p&gt;  &lt;h3&gt;&lt;/h3&gt;  &lt;h2&gt;Lots more to pick on&lt;/h2&gt;  &lt;p&gt;There’s lots more to pick on in the article – for instance, the inability to determine the difference between a content management system and the web site it serves (akin to not knowing the difference between a story and the typewriter on which it was written), which itself significantly reduces the need for this one Open Source product to be secure.&lt;/p&gt;  &lt;p&gt;The news article barely hints at some of the true advantages of Open Source – that others can drop additional components in at their pleasure, and that you can pick up whichever of those components you need. [Of course, the same is true of closed source products with good published interface specifications, so perhaps this is only an advantage in the extreme case that the provided interfaces are incomplete.]&lt;/p&gt;  &lt;h2&gt;Is Open Source more or less secure?&lt;/h2&gt;  &lt;p&gt;There are plenty of reasons to believe that Open Source offers security advantages – it’s possible, for instance, to do your own deep security investigations and fix problems when you become aware of them. Of course, that’s rather like saying an advantage of buying an old car is that you get to do your own services – great if you’re a mechanic, not so good if you have to check the owner’s manual to remember which end to put petrol into.&lt;/p&gt;  &lt;p&gt;Software is more secure because it is written by good, dedicated, experienced programmers, reviewed by other good, dedicated, experienced programmers, analysed by tools and experienced programmers looking for security flaws, and tested pretty much to destruction.&lt;/p&gt;  &lt;p&gt;Don’t forget, as well, that there is little perceivable difference between secure software, lucky software, and uninteresting software. All will appear to be unhacked – until luck runs out, or the software becomes interesting to an attacker.&lt;/p&gt;  &lt;p&gt;I don’t claim to be able to determine that all Open Source is more or less secure than all Closed Source.&lt;/p&gt;  &lt;p&gt;Just that the “more eyeballs” line doesn’t remotely provide anything close to an explanation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1735518" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category></item><item><title>SAL-like code annotations for Java</title><link>http://msmvps.com/blogs/alunj/archive/2009/10/20/1733853.aspx</link><pubDate>Wed, 21 Oct 2009 03:44:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1733853</guid><dc:creator>Alun Jones</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1733853</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1733853</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2009/10/20/1733853.aspx#comments</comments><description>&lt;p&gt;&lt;a title="http://types.cs.washington.edu/jsr308/" href="http://types.cs.washington.edu/jsr308/"&gt;http://types.cs.washington.edu/jsr308/&lt;/a&gt; seems to be talking about a set of type annotations for Java that are similar to those provided in Microsoft Visual C++ by &lt;a href="http://msdn.microsoft.com/en-us/library/ms235402(VS.80).aspx"&gt;SAL, the Standard Annotation Language&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;One thing that the Java annotations have going for them over the SAL is that these annotations are going to be a part of the Java 7 standard, so it’s something that will come with the language no matter who implements it, whereas the C++ SAL extensions are specific to Microsoft. Of course, when I say “no matter who implements it”, I’m not aware of any significant currently supported implementations of Java outside of Sun, so it’s possible that such a statement is necessarily limited.&lt;/p&gt;  &lt;p&gt;[Note that the SAL extensions can be included in C++ code that is compiled with other compilers, you just won’t see any benefit from them when using other compilers.]&lt;/p&gt;  &lt;h3&gt;What do annotations do?&lt;/h3&gt;  &lt;p&gt;As explained in the blog post that Michael Howard put out when SAL was first made available, these code annotations add something to object and function prototypes. What they add is the ability to turn run-time issues into compile-time errors.&lt;/p&gt;  &lt;p&gt;So, for instance, a null pointer dereference, that would be an instant denial of service on your application, is trapped at compile time, because you declared in your function or class prototypes that you expect the pointer not to be null.&lt;/p&gt;  &lt;p&gt;Adding these annotations to your code can certainly be a time-consuming task, since you have to revisit old code and add them in by had, recapturing assumptions that you had originally made about objects you reference. That in itself can be a learning experience, of course, and because you will capture a number of outstanding reliability, quality and security bugs, it’s far from being an empty investment.&lt;/p&gt;  &lt;h3&gt;What do the Java annotations capture?&lt;/h3&gt;  &lt;p&gt;The first checker that the Java annotations implement is the &lt;strong&gt;Nullness&lt;/strong&gt; checker. This allows you to declare whether you are expecting a reference or value to be null or not. This generally avoids you seeing exceptions through dereferencing null.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Interning&lt;/strong&gt; checker prevents you from seeing poor results when comparing two objects (such as two instances of “Integer(2)”) using “==” or “!=”. Without the Interning checker, using “==” to compare two Integer variables each containing an instance of Integer(2) will produce the result ‘false’. This can cause logical processing errors, which the Interning checker will address.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Mutability&lt;/strong&gt; (IGJ or Javari) checker allows you to specify that an object reference should not be used to modify the contents of that object.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Lock&lt;/strong&gt; checker prevents locking errors by allowing you to declare that objects can only be accessed when guarded by a lock, or to declare that a function can only be called when holding a particular lock.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Tainted&lt;/strong&gt; checker allows you to mark an object as coming from an untrusted source (think “user”). Marking some functions as expecting Untainted data will prevent them from being fed Tainted data, and will ensure that other developers accessing such a function will call checking routines to convert the data from Tainted to Untainted before passing it to your functions.&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Linear&lt;/strong&gt; checker prevents your code from holding more than one reference to objects marked as Linear. Since Java, like C#, likes to copy references to objects, rather than the objects themselves, this checker can prevent you from finding unexpected side-effects from objects being modified through aliases you weren’t expecting.&lt;/p&gt;  &lt;p&gt;Further checkers appear to allow you to write your own checkers, but I haven’t got the Java programming chops to really play with these.&lt;/p&gt;  &lt;h3&gt;Should I include these annotations in my Java projects?&lt;/h3&gt;  &lt;p&gt;Definitely. Or something like them. Using annotations to define to the compiler some of the expectations you make of your code (a hyped-up interface contract, if you like) allows the compiler to check more deeply into whether those assumptions can hold true throughout your code.&lt;/p&gt;  &lt;p&gt;My own experience of SAL-annotated code is that it has allowed me to discover some relatively subtle bugs in my programs. Or bugs that weren’t quite so subtle, but just weren’t jumping out at me.&lt;/p&gt;  &lt;p&gt;A quick look at these Java annotations suggests that they will do the same for Java projects. Frankly, the more help you can get from these static analysis tools, the better. Analysis tools don’t catch all problems, and they aren’t a substitute for good programming, but they do provide a second check on your own assumptions that can be very useful.&lt;/p&gt;  &lt;p&gt;Previous articles on SAL:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msmvps.com/blogs/alunj/archive/2006/05/20/96212.aspx"&gt;SAL - pipped at the post by Michael Howard&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msmvps.com/blogs/alunj/archive/2006/05/21/96422.aspx"&gt;Okay, scratch what I said about SAL&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://msmvps.com/blogs/alunj/archive/2006/05/26/97185.aspx"&gt;Forget that I asked you to ignore what I said.&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1733853" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category></item><item><title>Sometimes It Seems Like Unix(*) Needs to Learn from Windows</title><link>http://msmvps.com/blogs/alunj/archive/2009/09/26/1727475.aspx</link><pubDate>Sun, 27 Sep 2009 03:22:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1727475</guid><dc:creator>Alun Jones</dc:creator><slash:comments>17</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1727475</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1727475</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2009/09/26/1727475.aspx#comments</comments><description>&lt;p&gt;(*) By &amp;ldquo;Unix&amp;rdquo;, I mean Linux, Unix, AIX, OS/X, and similar flavours.&lt;/p&gt;
&lt;p&gt;Way back when, about twenty or so years ago, I was a Unix admin, and a Unix developer. I had to be both, because I was the only person in the company who could spell Unix.&lt;/p&gt;
&lt;p&gt;My favourite game was to go along to presentations for Microsoft Windows &amp;lsquo;new features&amp;rsquo; and say &amp;ldquo;Oh, but hasn&amp;rsquo;t Unix had that for the last twenty years?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;Sure enough, there were countless things that Windows users and developers were just discovering (TCP/IP, shared libraries, multiple sessions on the same computer) that had been in Unix for some time. Linux was yet to make a mention, but as I&amp;rsquo;ve moved firmly into the Windows world, and left Unix behind, I&amp;rsquo;ve pretty much assumed that technologically speaking, if Windows has it, Unix and the like must also have the same functionality.&lt;/p&gt;
&lt;p&gt;As I re-engage with Unix and Linux developers and IT professionals in recent months, though, I can see that there are some areas &amp;ndash; particularly in security - where Windows is far ahead of the *x operating systems. Here&amp;rsquo;s a few:&lt;/p&gt;
&lt;dl&gt;&lt;dt&gt;Where&amp;rsquo;s my EFS?&lt;/dt&gt;&lt;dd&gt;EFS, the Encrypting File System, is one of Windows&amp;rsquo; best-kept secrets. It&amp;rsquo;s not really a secret, of course, but it acts like one &amp;ndash; there are so few people willing to use it, and mostly because they&amp;rsquo;re scared of or don&amp;rsquo;t understand it.&lt;/dd&gt;&lt;dd&gt;EFS allows users (under administrative control and with appropriate recovery measures in place) to choose files to encrypt, and to declare which other users can access the encrypted files.&lt;/dd&gt;&lt;dd&gt;EFS-encrypted files are encrypted on disk, and the keys cannot be broken simply by mounting an offline attack, because the key for each file is encrypted with users&amp;rsquo; public keys, and the private keys are held securely in the users&amp;rsquo; certificate store.&lt;/dd&gt;&lt;dd&gt;What does *x have in response? Whole disk encryption by third-party products (OK, Windows has Bitlocker and any number of third-party products). EFS protects individual files, and is far more fine-grained than the &amp;lsquo;all or nothing&amp;rsquo; access of WDE (or FDE, Full Disk Encryption, if you prefer).&lt;/dd&gt;&lt;dt&gt;Single Certificate Store&lt;/dt&gt;&lt;dd&gt;This isn&amp;rsquo;t really a &amp;ldquo;single&amp;rdquo; store so much as a predictable location for the certificate store. If you want to read a user&amp;rsquo;s certificates and keys, you know where to find them (although you generally only have access if you &lt;span style="text-decoration:underline;"&gt;are&lt;/span&gt; the user in question. Private keys from the certificate store are protected using the DPAPI, appropriately protecting them (apart from some key recovery scenarios, you have to log in using the password associated with the keys).&lt;/dd&gt;&lt;dd&gt;Similarly, certificates and keys belonging to the system and its service accounts are also in predictable locations.&lt;/dd&gt;&lt;dd&gt;This makes life easy for tools that need to scan for certificates due to expire.&lt;/dd&gt;&lt;dd&gt;Where are certificates and keys stored in *x? All over the place. Generally in &amp;ldquo;PEM&amp;rdquo; files, usually (but not always) in the same directory in which the application that installs them is.&lt;/dd&gt;&lt;dd&gt;How are these private keys protected in *x? There&amp;rsquo;s sometimes a password to open up the private key from the PEM file, and usually the PEM file has a restrictive access mask on it. [Read further for more problems with this]&lt;/dd&gt;&lt;dt&gt;Single SSL Library&lt;/dt&gt;&lt;dd&gt;It&amp;rsquo;s not uncommon to see several instances of OpenSSL installed on any particular system, whether it&amp;rsquo;s *x or Windows, if the system runs applications that use OpenSSL.&lt;/dd&gt;&lt;dd&gt;Windows developers, of course, can simply use the SSL API built in to Windows (CryptoAPI, CAPI and SChannel), and not have to worry about shipping an SSL library with their application, or keeping up with new versions as they come out, or tracking down customers and notifying them of updates to address security flaws (such as the Debian Linux key generation flaw I posted about a while ago).&lt;/dd&gt;&lt;dt&gt;Single SSL Configuration&lt;/dt&gt;&lt;dd&gt;If I want to disable SSL v2, or ciphers with fewer than 128 bits, on Windows I can change a few registry settings and know that I&amp;rsquo;ve fixed every application that uses SChannel. I can even do that remotely, with remote registry editing from a script or group policy tattooing the registry.&lt;/dd&gt;&lt;dd&gt;To do the same for OpenSSL, it seems that I have to find every application that uses OpenSSL and change the configuration files there.&amp;nbsp; &lt;/dd&gt;&lt;dt&gt;Data Protection API and configuration file protection&lt;/dt&gt;&lt;dd&gt;This is the one that really started me on this article.&lt;/dd&gt;&lt;dd&gt;How do you store a password in a configuration file?&lt;/dd&gt;&lt;dd&gt;Yes, the &amp;lsquo;right&amp;rsquo; security answer is &amp;ldquo;you don&amp;rsquo;t&amp;rdquo;, but that&amp;rsquo;s naive. The fact is that there are many instances wherein you have to store a password &amp;ndash; to access and authenticate to a remote application, or (if you&amp;rsquo;re using OpenSSL) to open a password-protected PEM or PFX file in order to read out the private key.&lt;/dd&gt;&lt;dd&gt;On Windows, the Patterns and Practices team have documented how to do this &amp;ndash; basically, you use the DPAPI to encrypt the password into the config file, and again to decrypt it back out &amp;ndash; and your DPAPI keys are encrypted by your master key, which is derived from your password. The end result is that you can&amp;rsquo;t get those DPAPI keys without the password.&lt;/dd&gt;&lt;dd&gt;What do the *x platforms have?&lt;/dd&gt;&lt;dd&gt;&amp;rdquo;Put the password in plain text, and protect it with a restrictive access mask&amp;rdquo;, is what I&amp;rsquo;m told. And in a search, I couldn&amp;rsquo;t find anything better being recommended. OK, one person recommended encoding the password with base64, but that&amp;rsquo;s hardly a security measure.&lt;/dd&gt;&lt;dd&gt;Jesper brought up the excellent question of &amp;ldquo;how is it different?&amp;rdquo; &amp;ndash; in the *x system, the password is marked as only being accessible to the correct user. I was about to answer him when Steve F spoke up for me, and noted that in the DPAPI case, you have to read the file, and then an API has to be called to decrypt the password; in the *x case, you simply have to read the file. There are many many more exploits that allow the reading of a file under privileged rights than there are exploits that allow the execution of code.&lt;/dd&gt;&lt;dt&gt;Patch Management and Group Policy&lt;/dt&gt;&lt;dd&gt;Microsoft has done a really good job of implementing enterprise-level management features into their operating systems, from Group Policy and WMI to WSUS and other update management tools.&lt;/dd&gt;&lt;dd&gt;The *x systems I&amp;rsquo;ve seen seem to be built from the perspective that each system has its own attendant administrator, who is only too happy to manually deploy patches or tweak settings in line with some policy on a scrap of paper or post-it.&lt;/dd&gt;&lt;/dl&gt;
&lt;p&gt;Maybe I&amp;rsquo;m missing some huge advances, and maybe some of these issues are resolved with a third-party tool &amp;ndash; but then, maybe that&amp;rsquo;s part of the problem too. All of the above are a part of the operating system in Windows, and can be relied on to exist by developers, and their use by applications can be expected by IT professionals.&lt;/p&gt;
&lt;p&gt;[Disclaimer: Yes, I know there are still areas where Microsoft needs to learn from Unix and Linux, and perhaps it&amp;rsquo;d be good if you&amp;rsquo;d educate me on those, too. This isn&amp;rsquo;t a &amp;ldquo;Windows is better than *X&amp;rdquo; debate, it&amp;rsquo;s a &amp;ldquo;hey, even if you think *X is better than Windows, here are some areas *X needs improving in&amp;rdquo;.]&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; There have been some excellent comments posted overnight in response to this article, and as I had hoped, I am mostly still &amp;#39;in the dark&amp;#39; about what Linux and Unix-like systems offers. I&amp;#39;ll be looking at these as I have time, and responding when I can. For now, just let me say that I am impressed to see so much technical content in the responses, and so little of the &amp;quot;fanboy&amp;quot; behaviour that often characterises these discussions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1727475" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/What+my+wife+knows/default.aspx">What my wife knows</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/EFS/default.aspx">EFS</category></item><item><title>The CWE Top 25 Programming Mistakes</title><link>http://msmvps.com/blogs/alunj/archive/2009/01/22/1663860.aspx</link><pubDate>Thu, 22 Jan 2009 12:39:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1663860</guid><dc:creator>Alun Jones</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1663860</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1663860</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2009/01/22/1663860.aspx#comments</comments><description>&lt;p&gt;I’ve read some debate about the &lt;a href="http://cwe.mitre.org/top25/"&gt;top 25 programming mistakes&lt;/a&gt; as documented by the &lt;a href="http://cwe.mitre.org"&gt;CWE&lt;/a&gt; (Common Weakness Enumeration) project, in collaboration with the SANS Institute and the MITRE . That the list isn’t complete, that there are some items that aren’t in the list, but should be, or vice-versa.&lt;/p&gt;  &lt;p&gt;I think we should look at the CWE top-25 as something like the &lt;a href="http://www.pcisecuritystandards.org"&gt;PCI Data Security Standard&lt;/a&gt; – it’s not the be-all and end-all of security, it’s not universally applicable, it’s not even a “gold standard”. It’s just the very bare minimum that you should be paying attention to, if you’ve got nowhere else to start in securing your application.&lt;/p&gt;  &lt;p&gt;As noted by the &lt;a href="http://www.sans.org/top25errors/"&gt;SANS Institute&lt;/a&gt;, the top 25 list will allow schools and colleges to more confidently teach secure development as a part of their classes.&lt;/p&gt;  &lt;p&gt;I personally would like to see a more rigorous taxonomy, although in this field, it’s really hard to do that, because in large part it’s a field that feeds off publicity – and you just can’t get publicity when you use phrases like “rigorous taxonomy”. Here’s my take on the top 25 mistakes, in the order presented:&lt;/p&gt;  &lt;h5&gt;Insecure Interaction Between Components&lt;/h5&gt;  &lt;p&gt;“These weaknesses are related to insecure ways in which data is sent and received between separate components, modules, programs, processes, threads, or systems.” &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-20"&gt;CWE-20&lt;/a&gt;: Improper Input Validation &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;What’s proper input validation? Consider the thought that there is no input, no output, only throughput. A string is received at the browser, and turned into a byte encoding; this byte encoding is sent to the web server, and possibly re-encoded, before being held in storage, or passed to a processing unit. For every input, there is an output, even if it’s only to local in-memory storage.&lt;/li&gt;      &lt;li&gt;Validating the input portion falls broadly into two categories – validating for length, and validating for content. Validating for length seems simple – is it longer than the output medium is expecting? You should, however, check your assumptions about an encoding – sometimes encodings will add, and sometimes they will remove, counts of the members of the sequence – and sometimes they may do both.&lt;/li&gt;      &lt;li&gt;Validating for content can similarly be broken into two groups – validating for correctness against the encoding expected, and then validating for content as to “business logic” (have you supplied a telephone number with a square-root sign or an apostrophe in it, say). Decide whether to strip invalid codes, or simply to reject the entire transaction. Usually, it is best (safest) to reject the entire transaction.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-116"&gt;CWE-116&lt;/a&gt;: Improper Encoding or Escaping of Output &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The other part of “throughput validation” – and while we constantly tell programmers that they should refuse to trust input, that should not be held as an excuse to produce untrustworthy output. There are many times when your code is trusted to produce good quality output. Some examples:&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;When you write a web application visited by a user, that user trusts you not to forward other people’s code on to them. Just your own, and that of your business partners. [See Cross-Site Scripting, below]&lt;/li&gt;        &lt;li&gt;When your application is used internally [See SQL Injection, below]&lt;/li&gt;     &lt;/ul&gt;      &lt;li&gt;Be conservative in what you send – make sure it rigorously follows whatever protocol or design-time contract has been agreed to. And above all, when sending data that isn’t code, make sure to encode it so that it can’t be read as code!&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-89"&gt;CWE-89&lt;/a&gt;: Failure to Preserve SQL Query Structure (aka &amp;#39;SQL Injection&amp;#39;) &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;SQL Injection is a throughput validation issue. In its essence, it involves an attacker who feeds SQL command codes into an interface, and that interface passes them on to a SQL database server.&lt;/li&gt;      &lt;li&gt;This is almost an inexcusable error, as it is relatively easy to fix. The fix is usually hampered somewhat in that the SQL database server is required to trust the web server interface code, but that means only that the web server interface code must either encode, or remove, elements of the data that is being passed in the SQL command sequence being sent to the server. The most reliable way to do this is to use parameterised queries or stored procedures. Avoid building SQL commands through concatenation at almost any cost.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-79"&gt;CWE-79&lt;/a&gt;: Failure to Preserve Web Page Structure (aka &amp;#39;Cross-site Scripting&amp;#39;) &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;I hate the term “cross-site scripting”. It’s far easier to understand if you just call it “HTML injection”. Like SQL injection, it’s about an attacker injecting HTML code into a web page (or other HTML page) by including it as data, in such a way that it is provided to the user as code.&lt;/li&gt;      &lt;li&gt;Again, a throughput content validation issue, anything that came in as data and needs to go out as a part of an HTML page should be HTML encoded, ideally so that only the alphanumerics are unencoded.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-78"&gt;CWE-78&lt;/a&gt;: Failure to Preserve OS Command Structure (aka &amp;#39;OS Command Injection&amp;#39;) &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Like SQL injection, this is about generating code and including data. Don’t use your data as part of the generation of code.&lt;/li&gt;      &lt;li&gt;There are many ways to fix this kind of an issue – my favourite is to save the data to a file, and make the code read the file. Don’t derive the name or location of the file from the user-supplied data.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-319"&gt;CWE-319&lt;/a&gt;: Cleartext Transmission of Sensitive Information &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;What’s sensitive information? You decide, based on an analysis of the data you hold, and a reading of appropriate laws and contractual regulations. For example, with PCI DSS, sensitive information would include the credit card number, magnetic track data, and personal information included with that data. Depending on your state, personal contact information is generally sensitive, and you may also decide that certain business information is also sensitive.&lt;/li&gt;      &lt;li&gt;Seriously, SSL and IPsec are not significant performance drains – if your system is already so overburdened that it cannot handle the overhead of encrypting sensitive data, you are ALREADY too slow, and only providence has saved you from problems.&lt;/li&gt;      &lt;li&gt;Especially where the data is not your own, make an informed decision as to whether you will be communicating in clear text.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-352"&gt;CWE-352&lt;/a&gt;: Cross-Site Request Forgery (CSRF) &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Another confusing term, CSRF refers to the ability of one web page to send you HTML code that your browser will execute against another web page. This really is cross-site, and forges requests that look to come from the user, but really come from a web page being viewed in the user’s browser.&lt;/li&gt;      &lt;li&gt;The fix for this is that every time you display a form (or even a solitary button, if that button’s effects should be unforgeable), you should include a hidden value that contains a random number. Then, when the “submit” (or equivalent) button is pressed, this hidden value will be sent back with the other contents of the form. Your server must, of course, validate this number is correct, and must not allow the number to be long-lived, or be used a second time. A simple fix, but one that you have to apply to each form.&lt;/li&gt;      &lt;li&gt;This really falls under a category of guaranteeing that you are talking to the user (or the user’s trusted agent), and not someone pretending to be the user. Related to non-repudiation.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-362"&gt;CWE-362&lt;/a&gt;: Race Condition &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Race conditions refer to any situation in which the execution of two parallel threads or processes behaves differently when the order of execution is altered. If I tell my wife and son to go get a bowl and some flour, and to pour the flour into the bowl, there’s going to be a mess if my wife doesn’t get the bowl as quickly as my son gets the flour. Similarly, programs are full of occasions where a precedence is expected or assumed by the designer or programmer, but where that precedence is not guaranteed by the system.&lt;/li&gt;      &lt;li&gt;There are books written on the topic of thread synchronisation and resource locking, so I won’t attempt to address fixing this class of issues.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-209"&gt;CWE-209&lt;/a&gt;: Error Message Information Leak &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Be helpful, but not too helpful. Give the user enough information to fix his side of the error, but not so much that he has the ability to learn sensitive information from the error message.&lt;/li&gt;      &lt;li&gt;“Incorrect user name or password” is so much better than “Incorrect password for that user name”.&lt;/li&gt;      &lt;li&gt;“Internal error, please call technical support, or wait a few minutes and try again” is better than “Buffer length exceeded at line 543 in file c:\dev\web\creditapp\cardcruncher.c”&lt;/li&gt;      &lt;li&gt;Internal information like that should be logged in a file that is accessible to you when fixing your system, but not accessible to the general end users.&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;h5&gt;Risky Resource Management&lt;/h5&gt;  &lt;p&gt;“The weaknesses in this category are related to ways in which software does not properly manage the creation, usage, transfer, or destruction of important system resources.” &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-119"&gt;CWE-119&lt;/a&gt;: Failure to Constrain Operations within the Bounds of a Memory Buffer&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The old “buffer overflow” – a throughput length validation issue.&amp;#160; Any time you take data from one source and place it into another destination, you have to reliably predict whether the destination is large enough to hold it, and you also have to decide what you will do if it is not.&lt;/li&gt;      &lt;li&gt;Don’t rely solely on .NET or Java “protecting you from buffer overruns” – when you try and access an element outside of a buffer’s limits, they will simply throw an exception – crashing your program dead in its tracks. This in itself could cause half-complete files or other communications, which could feed into and damage other processes. [And simply catching all exceptions and continuing blindly is something I’ve &lt;a title="Don&amp;#39;t Catch Exceptions" href="http://msmvps.com/blogs/alunj/archive/2007/04/02/don-t-catch-exceptions.aspx"&gt;complained about before&lt;/a&gt;]&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-642"&gt;CWE-642&lt;/a&gt;: External Control of Critical State Data &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;By “Critical State Data”, this refers to information about where in the processing your user is. The obvious example of bad external control of critical state data is sending the price to the user, and then reading it back from the user. It obviously isn’t too hard from an attacker to simply modify the value before sending it to the server.&lt;/li&gt;      &lt;li&gt;Other examples of poorly chosen state being passed includes the use of customer ID numbers in URLs, in such a way that it is obvious how to select a different customer’s number.&lt;/li&gt;      &lt;li&gt;State data such as this should generally be held at the server, and a ‘reference’ value exchanged to allow the server to regain state when a user responds. If this value is populated among users sufficiently sparsely, it’s close to impossible for an attacker to steal someone else’s state.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-73"&gt;CWE-73&lt;/a&gt;: External Control of File Name or Path &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This is related to forced-browsing, path-traversal, and other attacks. The idea is that any time you have external paths (such as URLs) with a direct 1:1 relationship to internal paths (directories and paths), it is usually possible to pass path control from the external representation into the internal representation.&lt;/li&gt;      &lt;li&gt;Make sure that all files requested can only come from a known set of files; disable path representations (such as “..”, for ‘parent directory’) that your code doesn’t actually make use of.&lt;/li&gt;      &lt;li&gt;Instead of trying to parse the strings yourself to guess what file name the operating system will use, always use the operating system to tell you what file name it’s going to access. Where possible, open the file and then query the handle to see what file it really represents.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-426"&gt;CWE-426&lt;/a&gt;: Untrusted Search Path &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Windows’ LoadLibrary is the classic example of this flaw in design – although the implicit inclusion of the current directory in Windows’ execution PATH searched is another.&lt;/li&gt;      &lt;li&gt;When writing programs, you can only trust the code that you load or call if you can verify where you are loading or calling it from.&lt;/li&gt;      &lt;li&gt;A favourite trick at college was to place ‘.’ at the front of your path, add a malicious shell file called ‘rm’, and invite a system administrator to show you how to kill a print job. The “lprm” command he’d run would call “rm”, and would run the local version, rather than the real command. Bingo, instant credentials!&lt;/li&gt;      &lt;li&gt;Don’t search for code that you trust – know where it is, and if it isn’t there, fail.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-94"&gt;CWE-94&lt;/a&gt;: Failure to Control Generation of Code (aka &amp;#39;Code Injection&amp;#39;) &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;I find it hard to imagine the situation that makes it safe to generate code in any way based off user input.&lt;/li&gt;      &lt;li&gt;Perhaps you could argue that this is what you do when you generate HTML that contains, as part of its display, user input. OK then, the answer here is to properly encode that which you embed, so that the code processor cannot become confused as to what is code and what is data.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-494"&gt;CWE-494&lt;/a&gt;: Download of Code Without Integrity Check &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Either review the code that you download, or insist that it is digitally signed by a party with whom you have contracted for that purpose. Otherwise you don’t know what you are downloading or what you are executing.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-404"&gt;CWE-404&lt;/a&gt;: Improper Resource Shutdown or Release &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This covers a large range of issues:&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;Don’t “double-free” resources. Make sure you meticulously enforce one free / delete for every allocation you make. Otherwise, you wind up releasing a resource that you wanted to hang onto, or you may crash your program.&lt;/li&gt;        &lt;li&gt;If the memory you’re about to release (or file you’re about to close) contained sensitive information, make sure it is wiped before release. Verify in the release build that the optimiser hasn’t optimised away this wiping!&lt;/li&gt;        &lt;li&gt;Make sure you release resources when they are no longer in use, so that there are no memory leaks or other resource overuse problems that will lead to your application becoming bloated and fragile.&lt;/li&gt;     &lt;/ul&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-665"&gt;CWE-665&lt;/a&gt;: Improper Initialization &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Lazy languages like Javascript, where a mistype becomes an instant variable assignment, should be avoided.&lt;/li&gt;      &lt;li&gt;Define all variables’ types – no “IMPLICIT INTEGER*4 (I-N)” (Am I showing my age?)&lt;/li&gt;      &lt;li&gt;Put something into your variables, so that you know what’s there. Don’t rely on the compiler unless the compiler is documented to guarantee initialisation.&lt;/li&gt;      &lt;li&gt;By “variable”, I mean anything that might act like a variable – stretches of memory, file contents, etc.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-682"&gt;CWE-682&lt;/a&gt;: Incorrect Calculation &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Again, a multitude of sins:&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;“should have used sin, but we actually used cos”&lt;/li&gt;        &lt;li&gt;divide by zero – or some similar operation – that causes the program to halt&lt;/li&gt;        &lt;li&gt;length validation / numeric overflow – in a single byte, 128 + 128 = 0&lt;/li&gt;     &lt;/ul&gt;      &lt;li&gt;As you can see, a denial of service can definitely occur, as can remote execution (usually a result of calculating too short a buffer, as a result of numeric overflow, and then overflowing the buffer itself)&lt;/li&gt;      &lt;li&gt;Don’t underestimate the possible results of just plain getting the answer wrong – cryptographic implementations have been brought to their knees (and resulted in approving untrustworthy access) because they couldn’t add up properly.&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;h5&gt;Porous Defenses&lt;/h5&gt;  &lt;p&gt;“The weaknesses in this category are related to defensive techniques that are often misused, abused, or just plain ignored.” &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-285"&gt;CWE-285&lt;/a&gt;: Improper Access Control (Authorization) &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This one pretty much speaks for itself. There’s public parts of your application, and there’s non-public parts. Make sure that you have to provide authentication before crossing that boundary, and make sure that the user account verified in authentication is the one that’s used for authorisation to access resources.&lt;/li&gt;      &lt;li&gt;Carry user authentication information around carefully, without letting it be exposed to other forms of attack, but also to make sure that the information is available the next time you need to authorise access to resources.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-327"&gt;CWE-327&lt;/a&gt;: Use of a Broken or Risky Cryptographic Algorithm &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Translation – get a crypto expert to manage your crypto. [Note – this is why I recommend using CryptoAPI rather than OpenSSL, because you have to be your own expert to use OpenSSL.]&lt;/li&gt;      &lt;li&gt;New algorithms arise, and old ones become obsolete. In the case of cryptographic algorithms, obsolete means “no longer effectively cryptographic”. In other words, if you use an old algorithm, or a broken algorithm, or don’t use an existing algorithm the right way, your data isn’t as protected as you thought it was.&lt;/li&gt;      &lt;li&gt;Where possible, use a cryptographic framework such as SSL, where the choice of cryptographic algorithms available can be adjusted over time to deal with changing realities.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-259"&gt;CWE-259&lt;/a&gt;: Hard-Coded Password &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;If there’s a hard-coded password, it will be discovered. And when discovered, it will be disseminated, and then you have to figure out how to get the message out to all of your users that they can now be owned because of your application. Not an easy conversation to have, at a guess.&lt;/li&gt;      &lt;li&gt;This is a “just don’t do it” recommendation, not a “do it this way” or “do it that way”.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-732"&gt;CWE-732&lt;/a&gt;: Insecure Permission Assignment for Critical Resource &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;If a low-privilege user can lock, or corrupt, a resource that is required for high-importance transactions, you’ve created an easy denial-of-service.&lt;/li&gt;      &lt;li&gt;If a low-privilege user can modify something that is used as a basis for trust assignments, there’s an elevation of privilege attack.&lt;/li&gt;      &lt;li&gt;And if a low-privilege user can write to your code base, you’re owned.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-330"&gt;CWE-330&lt;/a&gt;: Use of Insufficiently Random Values &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Give me a random number. 7. Give me another random number. 7. And another? 7.&lt;/li&gt;      &lt;li&gt;How do you tell if a number is random enough? You hire a mathematician to do a statistical analysis to see if the next number is predictable if you know any or all of the previous numbers.&lt;/li&gt;      &lt;li&gt;This mostly ties into CWE-327, don’t do your own crypto if you’re not a crypto expert (and by the way, you’re not a crypto expert). However, if you’re hosting a poker web site, it’s pretty important to be able to shuffle cards in an unpredictable manner!&lt;/li&gt;      &lt;li&gt;Remember that the recent &lt;a href="http://msmvps.com/blogs/alunj/archive/2008/07/24/1642098.aspx"&gt;Kaminsky DNS attack&lt;/a&gt;, as well as the &lt;a href="http://msmvps.com/blogs/alunj/archive/2009/01/01/1658309.aspx"&gt;MD5 collision issues&lt;/a&gt;, could have been avoided entirely by the use of unpredictable numbers.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-250"&gt;CWE-250&lt;/a&gt;: Execution with Unnecessary Privileges &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Define “unnecessary”? No, define “necessary”. That which is required to do the job. Start your development and testing process as a restricted user. When you run into a function that fails because of lack of privileges, ask yourself “is this because I need this privilege, or can I continue without?”&lt;/li&gt;      &lt;li&gt;Too many applications have been written that ask for “All” access to a file, when they only need “Read”.&lt;/li&gt;      &lt;li&gt;Too many applications demand administrator access when they don’t really need it. I’m talking to you, &lt;a href="http://msmvps.com/blogs/alunj/archive/2008/08/25/1645798.aspx"&gt;Sansa Media Converter&lt;/a&gt;.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;&lt;a href="http://cwe.mitre.org/#CWE-602"&gt;CWE-602&lt;/a&gt;: Client-Side Enforcement of Server-Side Security &lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;I’ve seen this one hundreds of times. “We prompt the user for their birth date, and we reject invalid day numbers”; “Where do you reject those?”; “In the user interface so it’s nice and quick”. Great, so I can go in and make a copy of your web page, delete the checks, and input any number I like. Don’t consider it impossible that an attacker has written his own copy of the web browser, or can interfere with the information passing through the network.&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;h3&gt;What’s missing?&lt;/h3&gt;  &lt;p&gt;Glaringly absent, as usual, is any mention of logging or auditing.&lt;/p&gt;  &lt;p&gt;Protections &lt;u&gt;will&lt;/u&gt; fail, always, or they will be evaded. When this happens, it’s vital to have some idea of what might have happened – that’s impossible if you’re not logging information, if your logs are wiped over, or if you simply can’t trust the information in your logs.&lt;/p&gt;  &lt;p&gt;Maybe I say this because &lt;a href="http://msmvps.com/blogs/alunj/archive/2008/10/14/1650874.aspx"&gt;my own “2ndAuth” tool&lt;/a&gt; is designed to add useful auditing around shared accounts that are traditionally untraceable – or maybe it’s the other way around, that I wrote 2ndAuth, because I couldn’t deal with the fact that shared accounts are essentially unaudited without it?&lt;/p&gt;  &lt;p&gt;Of course, that leads to other subtleties – the logs should not provide interesting information to an attacker, for instance, and you can achieve this either by secreting them away (which makes them less handy), or by limiting the information in the logs (which makes them less useful).&lt;/p&gt;  &lt;p&gt;Another missing issue is that of writing software to serve the user (all users) – and not to frustrate the attacker. [Some software reverses the two, frustrating the user and serving the attacker.] We developers are all trained to write code that does stuff – we don’t tend to get a lot of instruction on how to write code that doesn’t do stuff.&lt;/p&gt;  &lt;p&gt;Another mistake, though it isn’t a coding mistake as such, is the absence of code review. You really can’t find all issues with code review alone, or with code analysis tools alone, or with testing alone, or with penetration testing alone, etc. You have to do as many of them as you can afford, and if you can’t afford enough to protect your application, perhaps there are other applications you’d be better off producing.&lt;/p&gt;  &lt;p&gt;Other mistakes that I’d like to face head-on? Trusting the ‘silver bullet’ promises of languages and frameworks that protect you; releasing prototypes as production, or using prototype languages (hello, Perl, PHP!) to develop production software; feature creep; design by coding (the design is whatever you can get the code to do); undocumented deployment; fear/lack of dead code removal (“someone &lt;u&gt;might&lt;/u&gt; be using that”); deploy first, secure later; lack of security training.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1663860" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Why+is+PKI+so+hard_3F00_/default.aspx">Why is PKI so hard?</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Alun_2700_s+code/default.aspx">Alun's code</category></item><item><title>“Fully Stealthed” means fully spoofable</title><link>http://msmvps.com/blogs/alunj/archive/2009/01/20/1663882.aspx</link><pubDate>Wed, 21 Jan 2009 00:50:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1663882</guid><dc:creator>Alun Jones</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1663882</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1663882</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2009/01/20/1663882.aspx#comments</comments><description>&lt;p&gt;&lt;img title="Black Hole - you see it, because it isn&amp;#39;t there!" style="display:inline;margin-left:0px;margin-right:0px;" alt="Black Hole - you see it, because it isn&amp;#39;t there!" src="http://www.ifa.hawaii.edu/~barnes/ast110_06/bhaq/Black_Hole_Milkyway.jpg" align="right" /&gt;Every so often, someone on one of the security mailing lists to which I subscribe will post a frothing rant from someone who has discovered their own personal “magic bullet” which solves all their security woes. This time, it’s a guy who was convinced that Microsoft’s recent out-of-band Internet Explorer patch &lt;a href="http://www.microsoft.com/technet/security/bulletin/ms08-078.mspx"&gt;MS08-078&lt;/a&gt; is actually a conspiracy by Microsoft (and the government, of course) to invade your computer.&lt;/p&gt;  &lt;p&gt;Okay, now aside from the point that, technically, Microsoft “pwns” your computer if you run their OS, and they don’t need to install patches to continue to do so; aside from the Ballmer defence (“If we were actually evil, don’t you think we’d be doing a better job at it?”; aside from that and many other considerations, what evidence did this guy have that the patch is a conspiracy?&lt;/p&gt;  &lt;p&gt;Gibson Research’s &lt;a href="https://www.grc.com/x/ne.dll?bh0bkyd2"&gt;ShieldsUp&lt;/a&gt; site reported that his system was “Fully Stealthed”.&lt;/p&gt;  &lt;p&gt;[For those of you non-geeks reading the blog, that means that his firewall was closed up so tight that his system was not responding to any attempt to connect.]&lt;/p&gt;  &lt;p&gt;Many other people have made, or will make, the obvious note that the patch is for a browser client bug, whereas the firewall ignoring all incoming requests only protects against server-related bugs, so I’ll leave it to those people to discuss that.&lt;/p&gt;  &lt;p&gt;My concern is that Gibson is &lt;u&gt;still&lt;/u&gt; pitching the idea that “Fully Stealthed” is a good idea.&lt;/p&gt;  &lt;p&gt;TCP/IP, the network protocol on which much of the Internet is currently based, is designed around certain error reporting mechanisms that keep the system able to route around trouble.&lt;/p&gt;  &lt;p&gt;One of these mechanisms is the TCP RST (reset) flag. The reset flag a great tool, as it says in a single bit “I received this packet, but I can completely guarantee that it’s not meant for me”. Another similar mechanism is the “ICMP Host Unreachable” response, which says “You appear to be trying to send a packet through me to another machine, but although I’m not a bad place to send that packet through, I can’t seem to reach that machine just now”.&lt;/p&gt;  &lt;p&gt;When you’re “Fully Stealthed” (or completely non-responsive, if you prefer), it’s like you’re a black hole, and neither the TCP RST flag nor the ICMP Host Unreachable errors are returned from your system.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;That’s great, right, because it means that your attackers can’t tell you’re there? It’s like you’re a black hole, no one can see you, right?&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;That sounds good in theory, except that even black holes can be seen, because they don’t act like the empty space that might otherwise be there.&lt;/p&gt;  &lt;p&gt;Similarly, a “Fully Stealthed” machine gives away its presence by occupying an IP address that will not respond at all when you try to contact it. Very much like a black hole, it’s clear that it’s there, because if there was nothing there, the upstream routers would be passing back ICMP Unreachable messages.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;OK, so maybe they know that I’ve got a machine here, at this IP address, but it’s safe, because it’s Fully Stealthed – Stealth just sounds so cool, especially since it’s a verbed noun! It’s alright that I look like a hole to the rest of the Internet, because nobody can do anything to me!&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Wrong again.&lt;/p&gt;  &lt;p&gt;The attacker can pretend to &lt;u&gt;be&lt;/u&gt; you, because there’s nothing you’re going to say about it.&lt;/p&gt;  &lt;p&gt;Let me qualify that – of course, the attacker can’t use your password if he doesn’t know it, nor can he use your private keys. But he can use another thing that some sites use as part of the proof that you are who you claim to be.&lt;/p&gt;  &lt;p&gt;He can use your IP address.&lt;/p&gt;  &lt;p&gt;A few things prevent this normally:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The attacker never gets to see responses to his traffic – but for the most part, he may be able to guess these, and perhaps he &lt;em&gt;can&lt;/em&gt; see those responses, if he’s sniffing your line, for example. &lt;/li&gt;    &lt;li&gt;You get to see the responses to the attacker – this allows your computer to say “I received this packet, but I can completely guarantee that it’s not meant for me” – in other words, to send a RST back. &lt;/li&gt;    &lt;li&gt;If the attacker can’t see his responses, he needs to guess the random sequence number that is supplied in the SYN-ACK packet. Again, this isn’t a problem for the attacker if he’s sniffing your line, but it’s also not a problem for the attacker if he can guess the sequence number somewhat reliably. This happens every now and again, as network stack developers fail to predict ways in which their own randomness can be predicted. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;So, number 1 and 3 aren’t always a barrier – number 2 is definitely a barrier if the attacker needs to maintain the connection for more than a few fractions of a second, as the RST from the spoofed IP address will cause the server to drop the connection and ignore what the attacker is trying to do.&lt;/p&gt;  &lt;p&gt;So, this is a valuable protection that a “fully-stealthed” firewall is going to throw away for you – the ability to spot when someone is spoofing your IP address, and to respond back to say “uh, that isn’t me – stop talking to him”.&lt;/p&gt;  &lt;p&gt;A firewall should behave as if the machine is present but disinterested, and should actively refuse misguided connection attempts and responses, not merely ignore them. There’s a big difference between the two behaviours. Don’t use the sensationalist terminology of a poor substitute for an expert as a replacement for understanding of your risks and threats.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1663882" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Bad+names/default.aspx">Bad names</category></item><item><title>Running out of disk space? How’s your logs?</title><link>http://msmvps.com/blogs/alunj/archive/2008/12/25/1657730.aspx</link><pubDate>Thu, 25 Dec 2008 21:52:25 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1657730</guid><dc:creator>Alun Jones</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1657730</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1657730</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/12/25/1657730.aspx#comments</comments><description>&lt;p&gt; I ran out of disk space today.&lt;/p&gt;  &lt;p&gt;This is not entirely a new issue for me, because I like to listen to &lt;a href="http://www.bbc.co.uk/iplayer/radio"&gt;BBC Radio&lt;/a&gt; from back home, and my only way to do that is to download the shows overnight so I can listen to them the next day. [I’m not allowed that sort of bandwidth at work]&lt;/p&gt;  &lt;p&gt;I start troubleshooting this in the obvious way – where are my largest individual files, and are they useful? Windows Vista’s Search is great for this – you can ask for files over a certain number of bytes:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.RunningoutofdiskspaceHowsyourlogs_5F00_E9F8/Image_2D00_0244_5F00_2.png"&gt;&lt;img title="Image-0244" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="604" alt="Image-0244" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.RunningoutofdiskspaceHowsyourlogs_5F00_E9F8/Image_2D00_0244_5F00_thumb.png" width="804" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Whoa, over a gigabyte in that mysterious file called “setupapi.app.log”? Ah, but it’s in that C:\Windows\inf directory that I really shouldn’t mess with, so I’d better check to see that it’s alright to get rid of the file. Let’s see what the Microsoft Support Knowledge Base has to offer on the subject of huge files created by the Setup API.&lt;/p&gt;  &lt;p&gt;&lt;a title="http://support.microsoft.com/default.aspx/kb/958909" href="http://support.microsoft.com/default.aspx/kb/958909"&gt;http://support.microsoft.com/default.aspx/kb/958909&lt;/a&gt; - “It may take a long time to log on to a Windows Vista-based computer that has antivirus software installed” – well, I haven’t really noticed that logons are that slow, and I don’t actually have antivirus software installed. But visiting the article, I see that this is only the first half of the title. The full title is:&lt;/p&gt;  &lt;h3&gt;It may take a long time to log on to a Windows Vista-based computer that has antivirus software installed, and you may notice that the file size of the Setupapi.app.log file is very large&lt;/h3&gt;  &lt;p&gt;So, to use a medical metaphor here, the large setupapi.app.log is the internal haemorrhaging caused by some injury or illness, and the slow logon (or in my case, the inability to use my disk space) is the externally visible symptom – the loss of consciousness, the fainting fit, the going-into-shock. Now that we’ve got the diagnosis, let’s see if the KB article has anything useful to say.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“This problem occurs because the verbose logging policy for the Setupapi.app.log file in Windows Vista is set to the most verbose setting (0x20000FFFF).&lt;/p&gt;    &lt;p&gt;“…&lt;/p&gt;    &lt;p&gt;“To work around this problem, remove or adjust the value of the following registry entry:     &lt;br /&gt;&lt;b&gt;HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\LogLevel&lt;/b&gt;”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Hmm… my value is set to 0x20000000. What value should it be?&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“Type 0x00000020 in the &lt;strong&gt;Value data&lt;/strong&gt; box.”&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;OK, that’s a little pedantic – instead, how about you click the “Hexadecimal” radio button, and enter “20”:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.RunningoutofdiskspaceHowsyourlogs_5F00_E9F8/Image_2D00_0245_5F00_2.png"&gt;&lt;img title="Image-0245" style="border-right:0px;border-top:0px;display:inline;border-left:0px;border-bottom:0px;" height="207" alt="Image-0245" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.RunningoutofdiskspaceHowsyourlogs_5F00_E9F8/Image_2D00_0245_5F00_thumb.png" width="349" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There is a hotfix mentioned in the article, but I rarely like to apply hotfixes to my machine if I am sure that the workaround will suffice. I may revisit the hotfix if I can’t see this work to reduce my log file size.&lt;/p&gt;  &lt;p&gt;So, how did this happen? How did the setting get put to such a bizarre value?&lt;/p&gt;  &lt;p&gt;Quite frankly, I don’t know – and as long as the problem goes away, I’ll just put it down to one of the many programs that I’ve installed or uninstalled. Judging from the fact that this log seems to have been in detail mode ever since November 2007, it’s likely that this setting was chosen (either by me or Microsoft) to gauge how successful the new install of Vista was going.&lt;/p&gt;  &lt;p&gt;I now have a gigabyte of my file-space left, and I can go and download “&lt;a href="http://www.bbc.co.uk/iplayer/episode/b007jqsz/Crisp_and_Even_Brightly/"&gt;Crisp and Even, Brightly&lt;/a&gt;”, one of my favourite Christmas shows from Radio 4. I only wish I could get the TV, because there are some excellent BBC shows that never make it across to this side of the Atlantic – and I just can’t wait for Doctor Who Season 4 – the next Doctor (or is he?), Cybermen, and a Victorian Christmas.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1657730" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Windows+Vista/default.aspx">Windows Vista</category></item><item><title>HTML Help in MFC</title><link>http://msmvps.com/blogs/alunj/archive/2008/10/12/1650663.aspx</link><pubDate>Mon, 13 Oct 2008 04:36:11 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650663</guid><dc:creator>Alun Jones</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1650663</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1650663</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/10/12/1650663.aspx#comments</comments><description>&lt;p&gt;I recently got around to converting an old MFC project from WinHelp format to HTML Help. Mostly this was to satisfy customers who are using Windows Vista or Windows Server 2008, but who don’t want to install WinHlp32 from Microsoft. (If you do want to install WinHlp32, you can find it for &lt;a href="http://www.microsoft.com/downloads/info.aspx?u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d6ebcfad9-d3f5-4365-8070-334cd175d4bb"&gt;Windows Vista&lt;/a&gt; or &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0468fefd-b54f-4c57-8340-c6dd2ec20c0a"&gt;Windows Server 2008&lt;/a&gt; at Microsoft’s download site.]&lt;/p&gt;  &lt;p&gt;Here’s a quick round trip of how I did it:&lt;/p&gt;  &lt;p&gt;1. Convert the help file – yeah, this is the hard part, but there are plenty of tools, including Microsoft’s HTML Help Editor, that will do the job for you. Editing the help file in HTML format can be a little bit of a challenge, too, but many times your favourite HTML editor can be made to do the job for you.&lt;/p&gt;  &lt;p&gt;2. Call EnableHtmlHelp() from the CWinApp-derived class’ constructor.&lt;/p&gt;  &lt;p&gt;3. Remove the line ON_COMMAND(ID_HELP_USING, CWinApp::OnHelpUsing), if you have it - there is no HELP_HELPONHELP topic in HTML.&lt;/p&gt;  &lt;p&gt;4. Add the following function:&lt;/p&gt;  &lt;p&gt;void CWftpdApp::HelpKeyWord(LPCSTR sKeyword)    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; HH_AKLINK akLink;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; switch (GetHelpMode())     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; case afxHTMLHelp:     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.cbStruct = sizeof(HH_AKLINK);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.fReserved=FALSE;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.fIndexOnFail=TRUE;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.pszKeywords=sKeyword;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.pszMsgText=(CString)&amp;quot;Failed to find information in the help file on &amp;quot; + sKeyword;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.pszMsgTitle=&amp;quot;HTML Help Error&amp;quot;;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; akLink.pszWindow=NULL;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AfxGetApp()-&amp;gt;HtmlHelp((DWORD_PTR)&amp;amp;akLink,HH_KEYWORD_LOOKUP);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; case afxWinHelp:     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AfxGetApp()-&amp;gt;WinHelp((long)(char *)sKeyword,HELP_KEY);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; break;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;} &lt;/p&gt;  &lt;p&gt;5. Change your keyword help calls to call this new function:&lt;/p&gt;  &lt;p&gt;((CWftpdApp *)AfxGetApp()-&amp;gt;WinHelp((long)(char *)&amp;quot;Registering&amp;quot;);&lt;/p&gt;  &lt;p&gt;Becomes:&lt;/p&gt;  &lt;p&gt;HelpKeyWord(&amp;quot;Registering&amp;quot;,HELP_KEY); &lt;/p&gt;  &lt;p&gt;6. If you want to trace calls to the WinHelp function to watch what contexts are being created, trap WinHelpInternal: &lt;/p&gt;  &lt;p&gt;void CWftpdApp::WinHelpInternal(DWORD_PTR dwData, UINT nCmd)    &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; TRACE(&amp;quot;Executing WinHelp with Cmd=%d, dwData=%d (%x)\r\n&amp;quot;,nCmd,dwData,dwData);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; CWinApp::WinHelpInternal(dwData,nCmd);     &lt;br /&gt;} &lt;/p&gt;  &lt;p&gt;This trace comes in really, really (and I mean REALLY) handy when you are trying to debug “Failed to load help” errors. It will tell you what numeric ID is being used, and you can compare that to your ALIAS file.&lt;/p&gt;  &lt;p&gt;7. If your code gives a dialog box that reads:&lt;/p&gt;  &lt;p&gt;---------------------------    &lt;br /&gt;HTML Help Author Message     &lt;br /&gt;---------------------------     &lt;br /&gt;HH_HELP_CONTEXT called without a [MAP] section.     &lt;br /&gt;---------------------------     &lt;br /&gt;OK&amp;#160;&amp;#160; &lt;br /&gt;--------------------------- &lt;/p&gt;  &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.ContextSensitiveHelpinMFC_5F00_F17F/image_5F00_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="156" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.ContextSensitiveHelpinMFC_5F00_F17F/image_5F00_thumb.png" width="347" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What it means is that the HTML Help API could not find the [MAP] &lt;u&gt;or&lt;/u&gt; the [ALIAS] section - without an [ALIAS] section, but with a [MAP] section, this message still will appear.&lt;/p&gt;  &lt;p&gt;8. Don’t edit the ALIAS or MAP sections of your help file in HTML Help Editor – Microsoft has a long-standing bug here that makes it crash (losing much of your unsaved work, of course) unpredictably when editing these sections. Edit the HHP file by hand to work on these sections.&lt;/p&gt;  &lt;p&gt;9. Most of your MAP section entries are automatically generated by the compiler, as .HM files, which hold macros appropriate for the specific control in the right dialog. Simply include the right HM file, and all you will need to do is create the right ALIAS mappings.&lt;/p&gt;  &lt;p&gt;10. The MFC calls to HtmlHelp discard error returns from the function, so there’s really no good troubleshooting to go on when debugging access to help file entries.&lt;/p&gt;  &lt;p&gt;Let me know if any of these helpful hints prove to be of use to you, or if you need any further clarification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650663" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Windows+Vista/default.aspx">Windows Vista</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Alun_2700_s+code/default.aspx">Alun's code</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>My MP3 player demands to administer my system</title><link>http://msmvps.com/blogs/alunj/archive/2008/08/25/1645798.aspx</link><pubDate>Tue, 26 Aug 2008 06:22:35 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645798</guid><dc:creator>Alun Jones</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1645798</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1645798</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/08/25/1645798.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.MyMP3playerdemandstoadministermysystem_5F00_A099/Sansa_5F00_ewatchandpen_5F00_COLOR_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:0px 25px 10px 0px;border-right-width:0px;" height="244" alt="Sansa_ewatchandpen_COLOR" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/alunj.MyMP3playerdemandstoadministermysystem_5F00_A099/Sansa_5F00_ewatchandpen_5F00_COLOR_5F00_thumb.jpg" width="244" align="left" border="0" /&gt;&lt;/a&gt; Thanks to the excellent &lt;a href="http://www.woot.com"&gt;http://www.woot.com&lt;/a&gt;, I upgraded to a new MP3 player - this one, the &lt;a href="http://www.sandisk.com/sansa/#/product-6/"&gt;Sansa e250&lt;/a&gt; from &lt;a href="http://sandisk.com"&gt;SanDisk&lt;/a&gt;, has a little screen and shows video at an almost completely unacceptably small resolution. But I don&amp;#39;t mind that, I didn&amp;#39;t really buy it for the video. I don&amp;#39;t mind the big fat &amp;quot;REFURB&amp;quot; label stuck on the back, nor do I really mind all that much that it&amp;#39;s already lost a screw from the back.&lt;/p&gt; &lt;p&gt;What I do mind is that the developers of the software accompanying this player haven&amp;#39;t figured out that I might want to use it as a consumer device, rather than an Information Technology Administration Tool. Quite honestly, I can&amp;#39;t see how a media player - even if you count its ability to do video the size of my thumb - can be used to administer my system, but clearly that&amp;#39;s the intent of the designers, because the software all insists on running as administrator.&lt;/p&gt; &lt;p&gt;The software at fault is at least the following:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Sansa Dispatcher - runs at logon, insists on running as administrator, therefore gets blocked on my Vista system. I&amp;#39;m still not quite sure what it&amp;#39;s supposed to do, because I can use the Sansa acceptably well without this tool running, and when I do run it unblocked as admin, it does nothing more useful than causing my laptop to repeatedly crash with a blue-screen of death. Not very impressive.  &lt;li&gt;Sansa Media Converter - allegedly this is required to put photos and videos onto the device - this, too, requires that I run it as an administrator (why? all it&amp;#39;s supposed to do is convert movies and graphics from one format to another, and then copy them to the USB drive that the Sansa pretends to be when plugged in)  &lt;li&gt;As if that wasn&amp;#39;t infuriating enough, the Sansa Media Converter requires Apple QuickTime, my old nemesis. Yes, that means I&amp;#39;m back on the &lt;a href="http://msmvps.com/blogs/alunj/archive/2008/05/09/1618641.aspx"&gt;Apple Update&lt;/a&gt; thrill-ride to distraction.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;It almost makes me want to wipe the firmware in the device and replace it with the Open Source software &amp;quot;&lt;a href="http://www.rockbox.org/"&gt;Rock Box&lt;/a&gt;&amp;quot;. Maybe then I can use ordinary tools to move my media onto the device, as an ordinary user.&lt;/p&gt; &lt;p&gt;We developers clearly have a loooong way to go before we grasp this concept that &amp;quot;administrator means the guy who makes changes to the configuration of the operating system&amp;quot;, and &amp;quot;standard user means the guy who spends his life actually using the operating system&amp;quot;.&lt;/p&gt; &lt;p&gt;I would love to be able to sort this out with technical support, but they insist on not talking to me in email, but requiring me to log on to a third party &amp;quot;eBox&amp;quot; from &amp;quot;customernation.com&amp;quot; - which sends out exhortations to visit your eBox as soon as Sansa&amp;#39;s support has put a message in it. These invites come with your user name and password - over unencrypted email. Nice.&lt;/p&gt; &lt;p&gt;I&amp;#39;d tell you what&amp;#39;s in my eBox, and what Sansa&amp;#39;s support said, but I haven&amp;#39;t been able to keep a connection up long enough for the painfully slow customernation.com web site to actually display anything. This is not a pleasant customer experience.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645798" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Windows+Vista/default.aspx">Windows Vista</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/What+my+wife+knows/default.aspx">What my wife knows</category></item><item><title>Searching for Weak Debian / Ubuntu SSL Certificates</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/22/1626252.aspx</link><pubDate>Fri, 23 May 2008 03:02:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1626252</guid><dc:creator>Alun Jones</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1626252</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1626252</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/05/22/1626252.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://msmvps.com/blogs/alunj/WindowsLiveWriter/ContributingtotheDebianmess_F477/Tuxkeys_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="200" alt="Tuxkeys" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/ContributingtotheDebianmess_F477/Tuxkeys_thumb.png" width="200" align="left" border="0" /&gt;&lt;/a&gt; I&amp;#39;ve seen a number of people promote packages that have shipped for Debian and Ubuntu, which allow users to scan their collected keys - OpenSSH or OpenSSL or OpenVPN, to discover whether they&amp;#39;re too weak to be of any functional use. [See my earlier story on &lt;a title="Debian and the OpenSSL PRNG" href="http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx"&gt;Debian and the OpenSSL PRNG&lt;/a&gt;]&lt;/p&gt; &lt;p&gt;These tools all have one problem.&lt;/p&gt; &lt;p&gt;They run on the Linux systems in question, and they scan the certificates in place.&lt;/p&gt; &lt;p&gt;Given that the keys in question could be as old as 2 years, it seems likely that many of them have migrated off the Linux platforms on which they have started, and onto web sites outside of the Linux platform.&lt;/p&gt; &lt;p&gt;Or, there may simply be a requirement for a Windows-centric security team to be able to scan existing sites for those Linux systems that have been running for a couple of years without receiving maintenance (don&amp;#39;t nod like that&amp;#39;s a &lt;u&gt;good&lt;/u&gt; thing).&lt;/p&gt; &lt;p&gt;So, I&amp;#39;ve updated my SSLScan program. I&amp;#39;m attaching a copy of the tool to this blog post, (along with a copy of the &lt;a title="Ubuntu blacklists are correct for Debian, too!" href="https://launchpad.net/ubuntu/+source/openssl-blacklist/"&gt;Ubuntu OpenSSL blacklists&lt;/a&gt; for 1024-bit and 2048-bit keys if I can get approval), though of course I would suggest keeping up with your own copies of these blacklists. It took a little research to find out how to calculate the quantity being used for the fingerprint by Debian, but I figure that it&amp;#39;s best to go with the most authoritative source to begin with.&lt;/p&gt; &lt;p&gt;Please let me know if there are other, non-authoritative blacklists that you&amp;#39;d like to see the code work with - for now, the tool will simply search for &amp;quot;blacklist.RSA-1024&amp;quot; and &amp;quot;blacklist.RSA-2048&amp;quot; in the current directory to build a list of weak key fingerprints.&lt;/p&gt; &lt;p&gt;I&amp;#39;ve found a number of surprising certificates that haven&amp;#39;t been reissued yet, and I&amp;#39;ll let you know about them after the site owners have been informed.&lt;/p&gt; &lt;p&gt;[Sadly, I didn&amp;#39;t find &lt;a href="https://whitehouse.gov/"&gt;https://whitehouse.gov&lt;/a&gt; before it was changed - its certificate is shared with, of all places, &lt;a href="https://www.gov.cn/"&gt;https://www.gov.cn&lt;/a&gt; - yes, the White House, home of the President of America, is hosted from the same server as the Chinese government. The certificate was changed yesterday, 2008/5/21. https://www.cacert.org&amp;#39;s certificate was issued two days ago, 2008/5/20 - coincidence?]&lt;/p&gt; &lt;p&gt;My examples are from the web, but the tool will work on any TCP service that responds immediately with an attempt to set up an SSL connection - so LDAP over SSL will work, but FTP over SSL will not. It won&amp;#39;t work with SSH, because that apparently uses a different key format.&lt;/p&gt; &lt;p&gt;Simply run SSLScan, and enter the name of a web site you&amp;#39;d like to test, such as &lt;u&gt;www.example.com&lt;/u&gt;- don&amp;#39;t enter &amp;quot;http://&amp;quot; at the beginning, but remember that you can test a host at a non-standard port (which you will need to do for LDAP over SSL!) by including the port in the usual manner, such as &lt;u&gt;www.example.com:636&lt;/u&gt;.&lt;/p&gt; &lt;p&gt;If you&amp;#39;re scanning a larger number of sites, simply put the list of addresses into a fie, and supply the file&amp;#39;s name as the argument to SSLScan.&lt;/p&gt; &lt;p&gt;Let me know if you think of any useful additions to the tool.&lt;/p&gt; &lt;p&gt;Here is some slightly modified output from a sample run of the tool (the names have been changed to protect the innocent):&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/alunj/WindowsLiveWriter/ContributingtotheDebianmess_F477/Image-0195_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="461" alt="Image-0195" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/ContributingtotheDebianmess_F477/Image-0195_thumb.png" width="642" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The text to look for here is &amp;quot;&amp;gt;&amp;gt;&amp;gt;This Key Is A Weak Debian Key&amp;lt;&amp;lt;&amp;lt;&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1626252" width="1" height="1"&gt;</description><enclosure url="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.01.62.62.52/SSLScan.zip" length="8542" type="application/x-zip-compressed" /><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Why+is+PKI+so+hard_3F00_/default.aspx">Why is PKI so hard?</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Alun_2700_s+code/default.aspx">Alun's code</category></item><item><title>Debian and the OpenSSL PRNG</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx</link><pubDate>Fri, 16 May 2008 00:55:01 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1623193</guid><dc:creator>Alun Jones</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1623193</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1623193</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/05/15/1623193.aspx#comments</comments><description>&lt;p&gt;[PRNG is an abbreviation for &amp;quot;Pseudo-Random Number Generator&amp;quot;, a &lt;strike&gt;key&lt;/strike&gt; core component of the key-generation in any cryptographic library.]&lt;/p&gt; &lt;p&gt;&lt;img alt="Warning: Choking Hazard" src="http://www.casino-shop.co.uk/300/dic/113.jpg" align="right" border="0" /&gt;A few people have already commented on the issue itself - Debian issued, in 2006, a version of their Linux build that contained a modified version of OpenSSL. The modification has been found to drastically reduce the randomness of the keys generated by OpenSSL on Debian Linux and any Linux derived from that build (such as Ubuntu, Edubuntu, Xubuntu, and any number of other buntus). Instead of being able to generate 1024-bit RSA keys that have a 1-in-2^1024 chance of being the same, the Debian build generated 1024-bit RSA keys that have a 1-in-2^15 chance of being the same (that&amp;#39;s 1 in 32,768).&lt;/p&gt; &lt;p&gt;Needless to say, that makes life really easy on a hacker who wants to pretend to be a server or a user who is identifed as the owner of one of these keys.&lt;/p&gt; &lt;p&gt;The fun comes when you go to &lt;a href="http://metasploit.com/users/hdm/tools/debian-openssl/"&gt;http://metasploit.com/users/hdm/tools/debian-openssl/&lt;/a&gt; and see what the change actually was that caused this. Debian fetched the source for OpenSSL, and found that Purify flagged a line as accessing uninitialised memory in the random number generator’s pre-seeding code.  &lt;h3&gt;So. They. Removed. The. Line. &lt;/h3&gt; &lt;p&gt;I thought I’d state that slowly for dramatic effect.  &lt;p&gt;If they’d bothered researching Purify and OpenSSL, they’d have found this:  &lt;p&gt;&lt;a href="http://rt.openssl.org/Ticket/Display.html?id=521&amp;amp;user=guest&amp;amp;pass=guest"&gt;http://rt.openssl.org/Ticket/Display.html?id=521&amp;amp;user=guest&amp;amp;pass=guest&lt;/a&gt;  &lt;p&gt;Which states (in 2003, three years before Debian applied teh suck patch) “No, it&amp;#39;s fine - the problem is Purify and Valgrind assume all use of uninitialised data is inherently bad, whereas a PRNG implementation has nothing but positive (or more correctly, non-negative) things to say about the idea.”  &lt;p&gt;So, Debian removed a source of random information used to generate the key. Silly Debian. &lt;p&gt;But there&amp;#39;s a further wrinkle to this.  &lt;p&gt;If I understand &lt;a href="http://metasploit.com/users/hdm/tools/debian-openssl/"&gt;HD Moore&amp;#39;s assertions&lt;/a&gt; correctly, this means that the sole sources of entropy (essentially, &amp;quot;randomness&amp;quot;) for the random numbers used to generate keys in Debian are:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;The Process ID (from 1 to 32,767)&lt;/li&gt; &lt;li&gt;The contents of an uninitialised area in the process&amp;#39; memory&lt;/li&gt; &lt;li&gt;uh... that&amp;#39;s it.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;[Okay, so that&amp;#39;s not strictly true in all cases - there are other ways to initialise randomness, but these two are the fallback position - the minimum entropy that can be used to create a key. In the absence of a random number source, these are the two things that will be used to create randomness.]&lt;/p&gt; &lt;p&gt;If you compile C++ code using Microsoft&amp;#39;s Visual C++ compiler in DEBUG mode, or with the /GZ, /RTC1, or /RTCs flags, you are asking the compiler to automatically initialise all uninitialised memory to 0xcc. I&amp;#39;m sure there&amp;#39;s some similar behaviour on Linux compilers, because this aids with debugging accidental uses of uninitialised memory.&lt;/p&gt; &lt;p&gt;But what if you don&amp;#39;t set those flags? &lt;h3&gt;What does &amp;quot;uninitialised memory&amp;quot; contain?&lt;/h3&gt; &lt;p&gt;It would be bad if &amp;quot;uninitialised memory&amp;quot; contained memory from other processes - previous processes that had owned memory but were now defunct - because that would potentially mean that your new process had access to secrets that it shouldn&amp;#39;t. &lt;p&gt;So, &amp;quot;uninitialised memory&amp;quot; has to be initialised to something, at least the first time it is accessed. &lt;p&gt;Is it really going to be initialised to random values? That would be such a huge waste of processor time - and anyway, we&amp;#39;re looking at this from the point of view of a cryptographic process, which needs to have strongly random numbers. &lt;p&gt;No, random would be bad. Perhaps in some situations, the memory will be filled with copies of &amp;#39;public&amp;#39; data - environment variables, say. But most likely, because it&amp;#39;s a fast easy thing to do, uninitialised memory will be filled with zeroes. &lt;p&gt;Of course, after a few functions are called, and returned from, and after a few variables are created and go out of scope, the stack will contain values indicative of the course that the program has taken so far - it may look randomish, but it will probably vary very little, if any, from one execution of the program to another. &lt;p&gt;In the absence of a random number seed file, or a random number generator providing /dev/urand or /dev/random, then, an OpenSSL key is going to have a 1 in 32,768 chance of being the same as a key created on a similar build of OpenSSL - higher, if you consider that most PIDs fall in a smaller range. &lt;p&gt;So, here&amp;#39;s some lessons to learn about compiling other people&amp;#39;s cryptographic code: &lt;ol&gt; &lt;li&gt;Don’t ever compile cryptographic code in release mode, because you will optimize away lines that clear secrets from memory. &lt;/li&gt; &lt;li&gt;Don’t ever compile cryptographic code in debug mode, because you will initialize memory that is expected to be uninitialised and random. &lt;/li&gt; &lt;li&gt;Don&amp;#39;t ever modify cryptographic code, even if it throws up warnings. You don&amp;#39;t understand what you&amp;#39;re doing.&lt;/li&gt; &lt;li&gt;Don’t ever compile cryptographic code, because you don’t know what you are doing. &lt;/li&gt;&lt;/ol&gt; &lt;h3&gt;Why I use CryptoAPI&lt;/h3&gt; &lt;p&gt;This is one reason why I prefer to use Microsoft&amp;#39;s CryptoAPI, rather than libraries such as OpenSSL. There are others: &lt;ol&gt; &lt;li&gt;It&amp;#39;s not my fault if something goes wrong with the crypto.&lt;/li&gt; &lt;li&gt;The users will apply patches to the crypto, and I don&amp;#39;t have to go persuading my users to apply the patches.&lt;/li&gt; &lt;li&gt;There&amp;#39;s a central place where administrators will expect to find crypto keys, and it&amp;#39;s well-protected.&lt;/li&gt; &lt;li&gt;The documentation for CryptoAPI is far better than the documentation for OpenSSL, which is at best confusing, and at worst, non-existent.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;In fairness, there are reasons not to use CryptoAPI:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;New algorithms are made available for new versions of Windows, and not backported readily to older versions. With a library you ship, you get to decide which version customers can run - unless someone else comes and installs another version.&lt;/li&gt; &lt;li&gt;Microsoft&amp;#39;s documentation is better, but it&amp;#39;s still not perfect. Once in a while, it&amp;#39;s not even correct. At least if you have the source code, and are insanely motivated, you can find out what the truth of a matter is.&lt;/li&gt;&lt;/ol&gt; &lt;h3&gt;We&amp;#39;ll still be learning lessons for a while...&lt;/h3&gt; &lt;p&gt;The lessons to learn from this episode are almost certainly not yet over. I expect someone to find in the next few weeks that OpenSSL with no extra source of entropy on some operating system or family of systems generates easily guessed keys, even using the &amp;quot;uninitialised memory&amp;quot; as entropy. I wait with &amp;#39;bated breath.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1623193" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Why+is+PKI+so+hard_3F00_/default.aspx">Why is PKI so hard?</category></item><item><title>Apple Changes Update Policies - Still No Biscuit</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/09/1618641.aspx</link><pubDate>Sat, 10 May 2008 04:32:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1618641</guid><dc:creator>Alun Jones</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1618641</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1618641</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/05/09/1618641.aspx#comments</comments><description>&lt;p&gt;As I have mentioned in other posts (&lt;a href="http://msmvps.com/blogs/alunj/archive/2008/03/21/1549816.aspx"&gt;Retro-bundling - another suck of the Apple&lt;/a&gt;, &lt;a href="http://msmvps.com/blogs/alunj/archive/2008/01/19/1471264.aspx"&gt;MacBook Air debuts; iTunes Pesters Me Again&lt;/a&gt;, &lt;a href="http://msmvps.com/blogs/alunj/archive/2007/12/17/1402585.aspx"&gt;Removing Apple Mobile Device Support&lt;/a&gt;, &lt;a href="http://msmvps.com/blogs/alunj/archive/2007/11/27/1363844.aspx"&gt;I didn&amp;#39;t want iTunes - now I&amp;#39;ve got iPod, too?&lt;/a&gt;, etc, etc), this has long since stopped being an issue for me, because I&amp;#39;ve removed all the Apple software from my machine as a bit of a protest against Apple&amp;#39;s inability or unwillingness to provide me the means to manage my own systems.&lt;/p&gt; &lt;p&gt;Now, I understand that Apple has finally heard some of the complaints from various blogs around the world, and has done something about it.&lt;/p&gt; &lt;p&gt;They have separated the updates from the new software. The new dialog looks like this:&lt;/p&gt; &lt;p&gt;&lt;img alt="" hspace="4" src="http://www.blogsmithmedia.com/www.tuaw.com/media/2008/04/vmware-fusionscreensnapz001.png" border="1" /&gt;&lt;/p&gt; &lt;p&gt;But it still marks the new software by default to be installed.&lt;/p&gt; &lt;p&gt;This is the behaviour that is wrong - okay, so it&amp;#39;s now clear as to the difference between an update and a new software, but the key again is that Apple is marking new software for installation from an update tool.&lt;/p&gt; &lt;p&gt;An update tool should be a piece of software that most users say &amp;quot;yes, do whatever&amp;quot;, and that doesn&amp;#39;t then cause significant additions to the software. By automatically checking new software, Apple is eroding the trust that users will have in the update tool.&lt;/p&gt; &lt;p&gt;Again, I don&amp;#39;t mind that they&amp;#39;re encouraging users to install Safari - I don&amp;#39;t even mind them spending time persuading their existing install base to use it. What I&amp;#39;m perplexed at is that Apple feels that they have to slide it in under the door, rather than sell it to users on its own merits.&lt;/p&gt; &lt;p&gt;And, yes, I&amp;#39;m quite well aware that you could also say the same of any browser that ships with an operating system - except, really, you&amp;#39;ve got to have a browser shipping in your operating system these days. Yeah, the guys who ship the operating system have an advantage - and they worked hard to build that advantage in the first place. They have a certain momentum behind anything they offer, and even if the system is as open and transparent to all application vendors as it is to the OS vendor, the default installed applications will generally have a larger market share than the &amp;#39;after-market&amp;#39; tools, just because of users&amp;#39; inertia.&lt;/p&gt; &lt;p&gt;[Note that the paragraph above applies to Apple / Mac / Safari, just as well as it does to Microsoft / Windows / Internet Explorer]&lt;/p&gt; &lt;p&gt;However, I don&amp;#39;t think that users&amp;#39; inertia is a cause for sleight-of-hand tactics like retro-bundling.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1618641" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category></item><item><title>Think like a bad guy? It's a start.</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/06/1615699.aspx</link><pubDate>Wed, 07 May 2008 00:33:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1615699</guid><dc:creator>Alun Jones</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1615699</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1615699</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/05/06/1615699.aspx#comments</comments><description>&lt;p&gt;Cool new site (and &lt;a href="http://securedeveloper.com/blog"&gt;blog&lt;/a&gt;) from Microsoft - &lt;a href="http://securedeveloper.com"&gt;http://securedeveloper.com&lt;/a&gt; - and it has a tag line I&amp;#39;ve heard many times before:&lt;/p&gt; &lt;p&gt;&lt;a href="http://securedeveloper.com/"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="246" alt="image" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/ThinklikeabadguyItsastart_13306/image_3.png" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Like that old maxim that &amp;quot;you need to stop fighting fires long enough to tell the architects to stop building things out of wood&amp;quot;, thinking like a bad guy is just the first step to developer security.&lt;/p&gt; &lt;p&gt;It&amp;#39;s a necessary step, but it&amp;#39;s not the final goal.&lt;/p&gt; &lt;p&gt;It&amp;#39;s a start - in fact, it&amp;#39;s a great start, and I think every developer needs to go through that phase. Many have yet to do so - particularly, it seems, those fresh out of college or programming school.&lt;/p&gt; &lt;p&gt;But I think it&amp;#39;s really a catch-phrase for the beginning of becoming a secure developer. It&amp;#39;s what you have to tell yourself when you&amp;#39;re used to writing code for the sole purpose of implementing features, so that you can get over that mind-set and into the sort of thinking that accepts that your code can be attacked.&lt;/p&gt; &lt;p&gt;But the bad guy has it easy.&lt;/p&gt; &lt;p&gt;He only has to find one way in. He can afford to become an expert on one part of your software, and zero in on it.&lt;/p&gt; &lt;p&gt;Thinking like a bad guy will widen your awareness to the point that you know that incursions can and will happen, and you&amp;#39;ll occasionally take better care in your coding. That&amp;#39;s a good thing.&lt;/p&gt; &lt;p&gt;But what if you start thinking like someone building a defensive structure?&lt;/p&gt; &lt;p&gt;The defence builder has to find (and limit) all the ways in, and just in case he missed one, he has to find all the ways you can get further in once you&amp;#39;re in - he has to become an expert on all parts of the software, as well as something of an expert on the external dependencies - libraries, network equipment, database components, etc.&lt;/p&gt; &lt;p&gt;[After all, we&amp;#39;ve seen this past week how many sites can get exploited through SQL Injection attacks - and the primary cause for those seems to be web developers who don&amp;#39;t know SQL, yet who send SQL statements to be executed at the database.]&lt;/p&gt; &lt;p&gt;You could start thinking like a defender - what alarms should signal the presence, or possibility, of an intruder? What information could an active defender use to verify the intent of a potential intruder? How could you slow down a possible attacker to the point where it&amp;#39;s feasible for a human responder to outpace a mechanical attacker?&lt;/p&gt; &lt;p&gt;Maybe you could start thinking like an investigator - once you believe someone has got in, what clues would you like to be left, showing you where the holes were? How can you tell what defences have been useful and what defences were useless? Where was the attacker actively assisted or resisted by your system and software?&lt;/p&gt; &lt;p&gt;Perhaps you could even think like a defence component builder - how can you ensure that you learn lessons from tried and true defences in order to build those lessons in to the next system, or to teach the next set of builders?&lt;/p&gt; &lt;p&gt;Think like the architect of a mediaeval castle - we&amp;#39;ve gotten used to the idea that mediaeval castles were places of defence, that they sought to be impenetrable bastions behind which the local king, thane, lord or whatever could take refuge and survive. Yet they were also places of business, places of government, places with a function. We need to design programs like mediaeval castles - capable of functioning for business as well as for defence.&lt;/p&gt; &lt;p&gt;SecureDeveloper.com hasn&amp;#39;t really gone beyond the first stage of its launch yet, so it will be a while before these advanced topics will be discussed - and I am eager to see that happen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1615699" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category></item><item><title>Can You Write Good Code for an OS you Despise?</title><link>http://msmvps.com/blogs/alunj/archive/2008/05/03/1612047.aspx</link><pubDate>Sat, 03 May 2008 23:57:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1612047</guid><dc:creator>Alun Jones</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1612047</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1612047</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/05/03/1612047.aspx#comments</comments><description>&lt;p&gt;No, this isn&amp;#39;t another of my anti-Mac frothing rants.&lt;/p&gt; &lt;p&gt;This is one of my &amp;quot;here&amp;#39;s what I hate about many of the open-source projects I deal with&amp;quot; rants.&lt;/p&gt; &lt;p&gt;I&amp;#39;m trying to find an SFTP client for Windows that works the way I want it to.&lt;/p&gt; &lt;p&gt;All I seem to be able to find are SFTP clients for Unix shoe-horned in to Windows.&lt;/p&gt; &lt;p&gt;[Perhaps the Unix guys feel the same way about playing Halo under Wine.]&lt;/p&gt; &lt;p&gt;What do I mean?&lt;/p&gt; &lt;p&gt;Here&amp;#39;s an example - Windows has a certificate store. It&amp;#39;s well-protected, in that there haven&amp;#39;t been any disclosures of significant vulnerabilities that allow you to read certificates without first having got the credentials that would allow you to do so.&lt;/p&gt; &lt;p&gt;So, I want an SFTP client that lets me store my private keys in the Windows certificate store. Or at least, that uses DPAPI to protect its data.&lt;/p&gt; &lt;p&gt;Can&amp;#39;t find one.&lt;/p&gt; &lt;p&gt;Can&amp;#39;t find ONE. And I&amp;#39;m known for being good at finding stuff.&lt;/p&gt; &lt;p&gt;PuTTY is recommended to me. It, too, requires that the private key be stored in a file, not in the certificate store. Its alternative is to use its own certificate store, called Pageant (it&amp;#39;s an authorization &amp;quot;Age-Ant&amp;quot; for &lt;strong&gt;P&lt;/strong&gt;uTTY, get it?) Maybe I could do something with that - write a variant of Pageant that directly accesses certificates stored in the certificate store.&lt;/p&gt; &lt;p&gt;But no, there&amp;#39;s no protocol definition or API, or service contract that I can see in the documentation, that would allow me to rejigger this. I could edit the source code, but that&amp;#39;s an awful lot of effort compared to building a clean implementation of only those parts of the API that I&amp;#39;d need.&lt;/p&gt; &lt;p&gt;What I do find in the documentation for Pageant are comments such as these:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Windows unfortunately provides no way to protect pieces of memory from being written to the system &lt;a name="i17"&gt;&lt;/a&gt;swap file. So if Pageant is holding your private keys for a long period of time, it&amp;#39;s possible that decrypted private key data may be written to the system swap file, and an attacker who gained access to your hard disk later on might be able to recover that data. (However, if you stored an unencrypted key in a disk file they would &lt;em&gt;certainly&lt;/em&gt; be able to recover it.)  &lt;li&gt;Although, like most modern operating systems, Windows prevents programs from accidentally accessing one another&amp;#39;s memory space, it does allow programs to access one another&amp;#39;s memory space deliberately, for special purposes such as debugging. This means that if you allow a virus, trojan, or other malicious program on to your Windows system while Pageant is running, it could access the memory of the Pageant process, extract your decrypted authentication keys, and send them back to its master.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I&amp;#39;ll address the second comment first - it&amp;#39;s a strange way of noting that Windows, like other modern operating systems, assumes that every process run by the user has the same access as the user. Typically, this is addressed by simply minimising the amount of time that a secret is held in memory in its decrypted form, and using something like DPAPI to store the secret encrypted.&lt;/p&gt; &lt;p&gt;The first comment, though, indicates a lack of experience with programming for Windows, and an inability to search. Five minutes at &lt;a href="http://msdn.microsoft.com"&gt;http://msdn.microsoft.com&lt;/a&gt; gets you a reference to VirtualLock, which allows you to lock 4kB at a time into physical memory, aka non-paged pool. Of course, there are other options - encrypting the Pagefile using EFS also helps protect against this kind of attack, and the aforementioned trick of holding the secret decrypted in memory for as short a time as possible also reduces the risk of having it exposed.&lt;/p&gt; &lt;p&gt;Now I&amp;#39;m really stretching to assert that this single author despises Windows and that&amp;#39;s why he&amp;#39;s completely unaware of some of its obvious security features and common modes of use. But it does seem to be a trend prevalent in some of the more religious of open source developers - &amp;quot;Windows sucks because it can&amp;#39;t do X, Y and Z&amp;quot; - without actually learning for certain whether that&amp;#39;s true. Often, X and Y can be done, and Z is only necessary on other operating systems due to quirks of their design.&lt;/p&gt; &lt;p&gt;Back when I first started writing Windows server software, the same religious folks would tell me &amp;quot;don&amp;#39;t bother writing servers for Windows - it&amp;#39;s not stable enough&amp;quot;. True enough, Windows 3.1 wasn&amp;#39;t exactly blessed with great uptime. But instead of saying &amp;quot;you can&amp;#39;t build a server on Windows&amp;quot;, I realised that there was a coming market in Windows NT, which was supposed to be server class. So I wrote for Windows NT, I assumed it was capable of server functionality, and any time I felt like I&amp;#39;d hit a &amp;quot;Windows can&amp;#39;t do this&amp;quot;, I bugged Microsoft until they fixed it.&lt;/p&gt; &lt;p&gt;Had I simply walked away and gone to a different platform, I&amp;#39;d be in a different place - but my point is that if you believe that your target OS is incapable, you will find it to be so. If you believe it should be capable, you will find it to be so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1612047" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Why+is+PKI+so+hard_3F00_/default.aspx">Why is PKI so hard?</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category></item><item><title>Retro-bundling - another suck of the Apple</title><link>http://msmvps.com/blogs/alunj/archive/2008/03/21/1549816.aspx</link><pubDate>Sat, 22 Mar 2008 04:15:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1549816</guid><dc:creator>Alun Jones</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1549816</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1549816</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/03/21/1549816.aspx#comments</comments><description>&lt;p&gt;I thought I was done blogging about Apple Software Update, having removed QuickTime from my system completely, and sworn never to install it again or watch another QT or MOV file.&lt;/p&gt; &lt;p&gt;But nooo, someone had to spoil it by &lt;a title="Jesper appeals to the EU - tongue firmly in cheek" href="http://msinfluentials.com/blogs/jesper/archive/2008/03/21/help-us-nellie-please-help-us.aspx"&gt;telling me what Apple Software Update did next&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If you&amp;#39;re unfortunate enough to have QuickTime installed with Apple Software Update, you&amp;#39;ll already have seen it.&lt;/p&gt; &lt;p&gt;&lt;img src="http://msinfluentials.com/blogs/jesper/ApplePushingSafariIllegally.jpg" alt="" /&gt;&lt;/p&gt; &lt;p&gt;Not only is Apple going to offer you iTunes and QuickTime as an &amp;quot;update&amp;quot; (despite you not actually having iTunes installed in the first place), they&amp;#39;re also going to offer you Safari, the feature-light Apple web browser, as an &amp;quot;update&amp;quot; (again, even though you haven&amp;#39;t installed it). And they&amp;#39;re going to check the box, so if you think you&amp;#39;re just updating components you fetched for yourself, you&amp;#39;ll accidentally install this one, too. And they&amp;#39;re going to ask you every boot until you disable the check - and then they&amp;#39;ll just re-enable the prompt next time they have a patched version to release.&lt;/p&gt; &lt;p&gt;What next, &amp;quot;we suggest you update to Bootcamp and Mac OS X, please wait while we install, and don&amp;#39;t mind the reboots&amp;quot;?&lt;/p&gt; &lt;p&gt;Seriously, Apple, this just makes you look seriously unethical. You can&amp;#39;t get people to install Safari legitimately, by enticing them to voluntarily download and install it, so you have to sneak it in by implying it&amp;#39;s an update to QuickTime. What does that say about Safari? You can&amp;#39;t even give it away? You have to foist it on the unwilling?&lt;/p&gt; &lt;p&gt;Grow up.&lt;/p&gt; &lt;p&gt;I suggest we call this behaviour &lt;strong&gt;&lt;em&gt;Retro-Bundling&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Bundling&lt;/strong&gt;, of course, is when you buy a piece of software, or download it for free, and along with it comes Firefox or the Google Toolbar. Irritating, especially if you don&amp;#39;t want them, because half of your time in getting the software down was taken up in downloading something that you&amp;#39;re going to say &amp;quot;no&amp;quot; to. But at least you only have to say no that one time - or when you download the next version.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Retro-Bundling&lt;/strong&gt;, then, would be when, after you already have the software of your choice installed, its manufacturer decides that they&amp;#39;d like to have bundled something else onto your system, so they try to slip it in the back door without you noticing.&lt;/p&gt; &lt;p&gt;I am glad to say, to judge from &lt;a title="Someone whose blog I never visited before." href="http://john.jubjubs.net/2008/03/21/apple-software-update/"&gt;comments at other blogs&lt;/a&gt;, that I&amp;#39;m not the only one that thinks this is utterly reprehensible behaviour. Perhaps this is the way things are done in the Apple world - you just sit happily back as your vendor dumps more and more product into your lap.&lt;/p&gt; &lt;p&gt;Consider this - how would you have reacted, if next time Office for Mac was checking for updates, it came back and offered to update Word, Excel Internet Explorer and Silverlight? Even though you didn&amp;#39;t have those last two on your system. Oh, and they were selected automatically, and the default button press would install them all.&lt;/p&gt; &lt;p&gt;&lt;em&gt;Update: Someone mentioned to me that Microsoft does indeed offer Silverlight on Windows Update to Windows users even if you don&amp;#39;t have Silverlight installed already. That sucks, too. It&amp;#39;s not quite as heavy an application as Safari and iTunes, but it&amp;#39;s still wrong to offer &amp;quot;updates&amp;quot; that consist of an application you don&amp;#39;t have. Actions like this will cause people to stop accepting updates as a regular part of their computing schedule - and that can&amp;#39;t help the health of their computers.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1549816" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/What+my+wife+knows/default.aspx">What my wife knows</category></item><item><title>CS-RCS Pro on Vista</title><link>http://msmvps.com/blogs/alunj/archive/2008/02/26/1525222.aspx</link><pubDate>Tue, 26 Feb 2008 19:55:06 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1525222</guid><dc:creator>Alun Jones</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1525222</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1525222</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/02/26/1525222.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;ve been trying back and forth to get &lt;a href="http://www.componentsoftware.com"&gt;CS-RCS Pro&lt;/a&gt;, a version control suite, to work on Windows Vista.&lt;/p&gt; &lt;p&gt;I like CS-RCS Pro for a number of reasons:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Files stored in CS-RCS Pro are kept in a simple format, open and well-documented. As a result, if I ever have to move away from CS-RCS Pro (say, for instance, if they go out of business, or stop supporting it), I stand a good chance of reconstructing my versioning information completely in whatever product I move to, if only by re-creating files at each epoch and then checking them in to the new tool.  &lt;li&gt;CS-RCS Pro integrates with Visual Studio. I can check files in and out while I&amp;#39;m editing them.  &lt;li&gt;CS-RCS Pro integrates with Explorer, as a Shell Extension, so that you can right-click on source files, and check them in from there.  &lt;li&gt;Of course, most important is that for single users, it&amp;#39;s free.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;But that last point is the cause of a big problem.&lt;/p&gt; &lt;p&gt;Here&amp;#39;s the sequence I have to deal with:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;I have the single-user version of CS-RCS Pro.  &lt;li&gt;I use best practices for development of secure applications, particularly as regards running my software &lt;u&gt;and&lt;/u&gt; my development tools as a restricted user unless it is strictly necessary to become an admin to test admin-level features, or to install / uninstall software or services, or to debug code that is running a different user context from my own.  &lt;li&gt;CS-RCS Pro insists that the user who installs it is also the user who runs it.  &lt;li&gt;CS-RCS Pro must be installed by an administrator.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;I had originally intended to follow the appropriate installation practice for an enterprise application - that it should be installed by a recognised administrator, and then any post-install setup to customise for the end-user would be carried out by that end-user for themselves.&lt;/p&gt; &lt;p&gt;This didn&amp;#39;t work, as CS-RCS Pro configured the version control tree to be used by the administrative user, making it impossible for my restricted user to access the files.&lt;/p&gt; &lt;p&gt;I tried simply editing the ownerships and ACLs - that didn&amp;#39;t work - and then to additionally edit the configuration files, where it mentioned the name of my administrative user. That worked for a short while, but I noticed that every time I used MSTSC - Remote Console - also known as the Terminal Services Client - to access the system, the shell extension that CS-RCS Pro installs took up 100% CPU, and required that I restart Explorer. There are still a few applications that don&amp;#39;t work well when you kill Explorer from underneath them, and so this was somewhat of an untenable position.&lt;/p&gt; &lt;p&gt;Besides, this was an awful lot of effort to go through in order to get version control going.&lt;/p&gt; &lt;p&gt;Finally, it hit me how I should do this properly. It&amp;#39;s not clean and it&amp;#39;s not clever, and ComponentSoftware, the folks behind CS-RCS Pro, should consider how to change their installer to avoid this issue.&lt;/p&gt; &lt;p&gt;The simple five-step process is as follows - let&amp;#39;s say Wayne, an administrator, wants to install the software for Sharon, a restricted user:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Wayne adds Sharon to the Local Administrators group on the machine to which Wayne will be installing CS-RCS Pro.  &lt;li&gt;Wayne logs on as Sharon (*)  &lt;li&gt;Wayne installs the application.  &lt;li&gt;Wayne logs off Sharon&amp;#39;s account.  &lt;li&gt;Wayne removes Sharon from the Local Administrators group.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;(*) Note that asterisk - that&amp;#39;s the troubling part. Actually, step 1 is troubling too, but only because Sharon may have other processes trying to log in with elevated rights, should they ever be granted.&lt;/p&gt; &lt;p&gt;Step 2 requires either that Wayne allows his user, restricted though she is meant to be, to log on as an administrator - what if she quickly runs some tool that you don&amp;#39;t want her to run?&lt;/p&gt; &lt;p&gt;Okay, so you drag her away from the console immediately after she types her password - but what if she&amp;#39;s got startup items to add an administrative user on her behalf, or simply to stay in memory (as a service, say) and run with those enhanced privileges, to allow exploit later?&lt;/p&gt; &lt;p&gt;Alright, so what&amp;#39;s the safest way? The only good way I can think of is this:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Wayne resets Sharon&amp;#39;s password.  &lt;li&gt;Wayne adds Sharon&amp;#39;s account to Local Administrators. Note that Sharon can&amp;#39;t log on at this point.  &lt;li&gt;From a command prompt in Wayne&amp;#39;s restricted user account, Wayne uses the &lt;em&gt;runas&lt;/em&gt; command to execute the installation script in Sharon&amp;#39;s new administrative context. Runas reduces, and possibly eliminates, the chance that this administrative context will have the ability to run Sharon&amp;#39;s own code (unless the installation script does so).  &lt;li&gt;Wayne removes Sharon from the Local Administrators account.  &lt;li&gt;Wayne sets Sharon&amp;#39;s account to force a password change after the next logon.  &lt;li&gt;Wayne tells Sharon her new password.  &lt;li&gt;If this is not a domain environment, Sharon must change her password back to what it used to be, so that it is possible for her to access her protected data.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Some of you are probably reading this and wondering why I bother - after all, in many environments, developers insist on running as administrator all the time, because their development tools don&amp;#39;t support anything else.&lt;/p&gt; &lt;p&gt;Well, it&amp;#39;s time your developers - and their tools - grew up. Yes, I can quote, just as any other developer can, a number of cases where administrative access is required - although many developers actually get this wrong. You can run Visual Studio 2005 as a non-administrator. You can debug your own code running in your own logon session as a non-administrator.&lt;/p&gt; &lt;p&gt;Developers are very often the only people to run some sections of the code that they build, until it reaches the hands of the users. As such, developers need to spend as much time as possible, when they run their code, working in the same kind of user context as their users will have.&lt;/p&gt; &lt;p&gt;In general, developers should follow the same principle as other administrators - their day-to-day tasks (e-mail, web browsing, and yes, development) should be done in restricted user accounts; administrative user accounts should be available, but their use should be restricted to those operations which absolutely require administrative access, and those operations should be reviewed often enough to ensure that they need administrative access. Tools and environments grow and change, and a tool which yesterday required administrative access may run tomorrow without. LogonUser, for instance, used to require complete system access - today it can be called by any user.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1525222" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Windows+Vista/default.aspx">Windows Vista</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/UAC/default.aspx">UAC</category></item><item><title>MacBook Air debuts; iTunes Pesters Me Again</title><link>http://msmvps.com/blogs/alunj/archive/2008/01/19/1471264.aspx</link><pubDate>Sun, 20 Jan 2008 02:09:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1471264</guid><dc:creator>Alun Jones</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1471264</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1471264</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2008/01/19/1471264.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;The big news from Apple this week was that they have a flatter laptop than anyone else (except Intel, who have a &amp;quot;Lorado&amp;quot; concept model that is much cooler, is demonstrated with Vista, and comes with an optional sleeve that has a Sideshow display). Conveniently for those road warriors that take to the air, the MacBook Air resolves the issue of how to carry your spare battery and comply with recent FAA rules - by having no user-replaceable battery. Special.&lt;/p&gt; &lt;p&gt;It also boosts the market for DVD decoders and CD rippers, by not having an on-board optical drive (there have been thinner laptops that had an optical drive). Good luck playing any game that requires you to &amp;quot;insert the original disk&amp;quot;.&lt;/p&gt; &lt;p&gt;Okay, enough bashing of the MacBook Air - it looks small, light and may be very useful for people who value that above all else.&lt;/p&gt; &lt;p&gt;As for my usual monthly complaint with Apple, I thought I had it beaten last month, after a visitor commented that I could simply tell Apple Software Update to &amp;quot;Ignore Selected Updates&amp;quot;, to make sure that when a new version of QuickTime comes out, I&amp;#39;m not bugged to install &amp;quot;iTunes + QuickTime&amp;quot; as well as Quicklime itself.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/alunj/WindowsLiveWriter/MacBookAirdebutsiTunesPestersMeAgain_6EC3/Image-0061_2.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="564" alt="Image-0061" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/MacBookAirdebutsiTunesPestersMeAgain_6EC3/Image-0061_thumb.png" width="440" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Oh dear, no such luck.&lt;/p&gt; &lt;p&gt;Apparently, what I told Apple Software Update to ignore was not so much &amp;quot;iTunes + QuickTime&amp;quot;, but &amp;quot;iTunes + QuickTime 7.5&amp;quot;.&lt;/p&gt; &lt;p&gt;I feel like the character in Monty Python who is repeatedly offered dishes containing various items - and Spam. &amp;quot;But I don&amp;#39;t like Spam!&amp;quot;&lt;/p&gt; &lt;p&gt;Rather than enticing me, seducing me, or deceiving me, into running iTunes, all that this behaviour has done is to make me abandon all hope, and simply dump QuickTimes and Apple Software Update as simply a bad job.&lt;/p&gt; &lt;p&gt;Next time there&amp;#39;s a movie file in QuickTime that I want to watch, I&amp;#39;ll contact whoever hosts it and let them know that I just can&amp;#39;t accept Apple&amp;#39;s absurd patching methodology, and that if they want me to view their content, they&amp;#39;ll just have to convert it to something more standard, like MPEG, that has viewers made by someone - pretty much anyone - other than Apple.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1471264" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category></item><item><title>Removing Apple Mobile Device Support</title><link>http://msmvps.com/blogs/alunj/archive/2007/12/17/1402585.aspx</link><pubDate>Tue, 18 Dec 2007 01:38:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1402585</guid><dc:creator>Alun Jones</dc:creator><slash:comments>88</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1402585</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1402585</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2007/12/17/1402585.aspx#comments</comments><description>&lt;p&gt;As mentioned before, I&amp;#39;m not a fan of &lt;a href="http://www.apple.com"&gt;Appple&lt;/a&gt;&amp;#39;s, particularly because they tend to impose crap on me that I&amp;#39;m not interested in having.&lt;/p&gt; &lt;p&gt;I&amp;#39;ve been trying to figure out how to remove &lt;a href="http://www.apple.com/support/itunes"&gt;iTunes&lt;/a&gt;, iPod and Aple Mobile Device Support on and off now for the past month, since it was accidentally installed while trying to update to the latest safe version of &lt;a href="http://www.apple.com/quicktime"&gt;QuickTime&lt;/a&gt; (which has since been patched again, and is therefore no longer the safe version of &lt;a href="http://www.apple.com/quicktime"&gt;QuickTime&lt;/a&gt; - another reason why I wanted to revert to my original state before this month&amp;#39;s update). I am, of course, using Windows Vista, so there&amp;#39;s a good chance that &lt;a href="http://www.apple.com"&gt;Apple&lt;/a&gt;&amp;#39;s technology hasn&amp;#39;t caught up with Vista.&lt;/p&gt; &lt;p&gt;iTunes and the iPod service seemed to go easily enough - Control Panel -&amp;gt; Programs and Features -&amp;gt; Select iTunes, and then press Uninstall.&lt;/p&gt; &lt;p&gt;I&amp;#39;m left, though, with the &amp;quot;Apple Mobile Device Support&amp;quot;, which is particularly insulting because I don&amp;#39;t have any Apple Mobile Devices, so there&amp;#39;s no reason why it should have ever installed in the first place.&lt;/p&gt; &lt;p&gt;Every time I tried to Uninstall, it would prompt me for elevation, and then apparently uninstall, although there&amp;#39;s no final dialog to say &amp;quot;Uninstalled - OK&amp;quot;.&lt;/p&gt; &lt;p&gt;But the icon and program name are still there in &amp;quot;Programs and Features&amp;quot;, and the service itself is still present.&lt;/p&gt; &lt;p&gt;I eventually spend a while watching the uninstall procedure, boring as it is to watch a progress bar that reads &amp;quot;11 seconds remaining&amp;quot; then &amp;quot;14 seconds remaining&amp;quot;, etc, as progress bars tend to do.&lt;/p&gt; &lt;p&gt;But then the progress bar does something magical - it goes backwards, and when it reaches zero, the uninstall program just quits.&lt;/p&gt; &lt;p&gt;Surprisingly enough, this is &lt;u&gt;good&lt;/u&gt; news. It means that rather than the uninstall procedure hitting a random crash and bombing out, it detected an error.&lt;/p&gt; &lt;p&gt;Running EventVwr, I see:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Windows Installer removed the product. Product Name: Apple Mobile Device Support. Product Version: 1.1.2.23. Product Language: 1033. Removal success or error status: 1603.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Well, no, Windows Installer didn&amp;#39;t remove the product. To find out what error 1603 means, we can quickly run &amp;quot;net helpmsg 1603&amp;quot;, to find that it means:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;C:\Program Files&amp;gt;net helpmsg 1603  &lt;p&gt;Fatal error during installation.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Great. That, we already knew. So, it&amp;#39;s a generic failure message.&lt;/p&gt; &lt;p&gt;Searching around, I find first, that error 1603 occurs in so many other applications, and with so many causes, that it&amp;#39;s not going to help me much.&lt;/p&gt; &lt;p&gt;Apple&amp;#39;s support is no help - searching for &amp;quot;uninstall apple mobile device support&amp;quot; gives nothing helpful:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/alunj/WindowsLiveWriter/RemovingAppleMobileDeviceSupport_A004/image_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="195" alt="image" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/RemovingAppleMobileDeviceSupport_A004/image_thumb.png" width="335" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;which is surprising since there is this page:&lt;/p&gt; &lt;p&gt;&lt;a title="Removing iTunes, QuickTime, and other software components for Windows XP" href="http://docs.info.apple.com/article.html?artnum=93698"&gt;Removing iTunes, QuickTime, and other software components for Windows XP&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="Removing iTunes, QuickTime, and other software components for Windows Vista" href="http://docs.info.apple.com/article.html?artnum=305409"&gt;Removing iTunes, QuickTime, and other software components for Windows Vista&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I&amp;#39;m not sure I trust anything that tells me &amp;quot;run the uninstall program, and then go ahead and delete some of the directories it left around, but be careful not to delete other directories it left&amp;quot; - I&amp;#39;m paraphrasing here.&lt;/p&gt; &lt;p&gt;I&amp;#39;ll save Windows Installer logging for later, because quite by chance, I found out how to remove Apple Mobile Device Support from Windows Vista.&lt;/p&gt; &lt;p&gt;Instead of clicking &amp;quot;Uninstall&amp;quot;, click &amp;quot;Change&amp;quot;. You&amp;#39;re given the option to &amp;quot;Repair&amp;quot; or &amp;quot;Remove&amp;quot;.&lt;/p&gt; &lt;p&gt;Click &amp;quot;Remove&amp;quot;.&lt;/p&gt; &lt;p&gt;As counter-intuitive as it sounds, this appears to take you through a completely different uninstall procedure, which actually results in the removal of the Apple Mobile Device Support.&lt;/p&gt; &lt;p&gt;After all of this, of course, Apple&amp;#39;s Software Update once again pops up and begs me to update to QuickTime and iTunes + QuickTime.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/alunj/WindowsLiveWriter/RemovingAppleMobileDeviceSupport_A004/image_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="564" alt="image" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/RemovingAppleMobileDeviceSupport_A004/image_thumb_1.png" width="440" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;And when iTunes + QuickTime is apparently a couple of versions ahead of QuickTime, and is selected by default, how many users are going to find themselves deceived into installing an unwanted iTunes?&lt;/p&gt; &lt;p&gt;Come on, Apple, an update takes existing software and advances it. Adding extra, unwanted, software isn&amp;#39;t part of the update. Stop offering iTunes + QuickTime as an &amp;quot;update&amp;quot; to QuickTime. Even if you think iTunes is a good thing, it&amp;#39;s not an &amp;quot;update&amp;quot;, it&amp;#39;s an &amp;quot;upgrade&amp;quot;, and should not be selected by default, nor should it be described as an update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1402585" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/What+my+wife+knows/default.aspx">What my wife knows</category></item><item><title>Microsoft Support Switches to Live Search</title><link>http://msmvps.com/blogs/alunj/archive/2007/12/15/1399191.aspx</link><pubDate>Sat, 15 Dec 2007 20:25:18 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1399191</guid><dc:creator>Alun Jones</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1399191</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1399191</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2007/12/15/1399191.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://support.microsoft.com/search/?adv=1"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="435" alt="Worst. Search. Ever." src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/httpsupport.micr.comSwitchestoLiveSearch_A956/image_5.png" width="826" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;In the spirit of the famous review of Spinal Tap&amp;#39;s album &amp;quot;Shark Sandwich&amp;quot;, I was tempted to post a two-word review,the first word of which is &amp;quot;Advanced&amp;quot;.&lt;/p&gt; &lt;p&gt;My three-word review, then - &amp;quot;Worst. Search. Ever&amp;quot;.&lt;/p&gt; &lt;p&gt;But, just in case you didn&amp;#39;t get the hint, here is the explanation:&lt;/p&gt; &lt;p&gt;How on earth is this an &amp;quot;Advanced Search&amp;quot;? Because I can tell it I want to limit my search to the KB, all of Microsoft, or all of the Internet? If those are the only options I care to use, I can go to Google.&lt;/p&gt; &lt;p&gt;I come to the support page - particularly the Advanced Search - so that I can select what product I&amp;#39;m looking for an answer on, and then type my search query. Sometimes, when I&amp;#39;m searching for an article I know I&amp;#39;ve seen before, I&amp;#39;ll search just in the title. Here&amp;#39;s how the site looked in June 2007, according to the Wayback Machine:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/blogs/alunj/WindowsLiveWriter/httpsupport.micr.comSwitchestoLiveSearch_A956/image_4.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="574" alt="Wayback - way better" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/httpsupport.micr.comSwitchestoLiveSearch_A956/image_thumb_1.png" width="1026" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Microsoft, I know you want us all to use &lt;a href="http://search.live.com"&gt;http://search.live.com&lt;/a&gt;, which seems to be a good search engine (though harder to type than google.com), but by associating the name with a substandard search on your support web site, I think you will have achieved the opposite effect.&lt;/p&gt; &lt;p&gt;I&amp;#39;d rather associate search.live.com with the fantastic &lt;a href="http://maps.live.com"&gt;http://maps.live.com&lt;/a&gt; - with 3d that really is 3d - or with Windows Live Writer, which provides me with an excellent blogging environment - or with Windows Live Messenger, which is useful if you can ignore the adverts.&lt;/p&gt; &lt;p&gt;In fact, there are many features of search.live.com to love - the image search, which presents an infinitely-scrollable plane of picture results, or the video search, with previews of the videos.&lt;/p&gt; &lt;p&gt;But don&amp;#39;t turn the utility of a support-friendly search into the futility of a flat search. When it comes down to it, and perhaps being a little hostile, I can Google Microsoft&amp;#39;s Knowledge Base just as easily from Google as I can from &lt;a href="http://support.microsoft.com"&gt;http://support.microsoft.com&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;A specialised search location requires the use of specialised knowledge to make the search more ... special. If you use a special tool or special interface to do that, you aren&amp;#39;t implying that your general search tool is bad.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1399191" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Miscellany+-+not+security/default.aspx">Miscellany - not security</category></item><item><title>I didn't want iTunes - now I've got iPod, too?</title><link>http://msmvps.com/blogs/alunj/archive/2007/11/27/1363844.aspx</link><pubDate>Wed, 28 Nov 2007 02:41:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1363844</guid><dc:creator>Alun Jones</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1363844</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1363844</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2007/11/27/1363844.aspx#comments</comments><description>&lt;p&gt;So, in my last post &amp;quot;&lt;a href="http://msmvps.com/blogs/alunj/archive/2007/11/27/1363705.aspx"&gt;Can the EU get me QuickTime N?&lt;/a&gt;&amp;quot;, I noted that my installation of QuickTime (because I had &lt;u&gt;a&lt;/u&gt; .MOV file I want to see) led to Apple Software Update offering me &amp;quot;iTunes + QuickTime 7.5&amp;quot;, despite my removing iTunes every time I find it creeping its way onto my computer.&lt;/p&gt; &lt;p&gt;Now I find that along with that iTunes update, came something that most definitely was &lt;u&gt;not&lt;/u&gt; advertised:&lt;/p&gt; &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="267" alt="Image-0052" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/IdidntwantiTunesnowIvegotiPodtoo_10365/Image-0052_3.png" width="848" border="0" /&gt; &lt;/p&gt; &lt;p&gt;My first thought is that if they are going to dump an iPod Service on me, the least they can do is give me a free iPod to use it with.&lt;/p&gt; &lt;p&gt;My second thought is ... that &lt;em&gt;really&lt;/em&gt; crosses the line.&lt;/p&gt; &lt;p&gt;At least with my inadvertent installation of iTunes, some careful reading, and not guessing, would have prevented me from installing it.&lt;/p&gt; &lt;p&gt;But at no point did I ever agree to installing an iPod Service. I don&amp;#39;t have an iPod, so I don&amp;#39;t need an iPod Service.&lt;/p&gt; &lt;p&gt;Oh, excuse me, &lt;em&gt;two&lt;/em&gt; services - there&amp;#39;s also an &amp;quot;Apple Mobile Device&amp;quot; service. And &lt;em&gt;that&lt;/em&gt; service requires TCP to be present before it starts. The iPod service requires RPC to be present before it&amp;#39;ll start. So, both of them engage in some form of network communication.&lt;/p&gt; &lt;p&gt;Maybe we should take a look at Microsoft&amp;#39;s Windows Defender, and its &lt;a title="How Windows Defender identifies spyware: Five evaluation criteria" href="http://www.microsoft.com/athome/security/spyware/software/msft/analysis.mspx#EED"&gt;standards for what constitutes spyware&lt;/a&gt;.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;Deceptive behaviors.&lt;/b&gt; Runs processes or programs on the user&amp;#39;s computer without notifying the user and getting the user&amp;#39;s consent. Prevents users from controlling the actions taken by the program while it runs on the computer. Prevents users from uninstalling or removing the program.  &lt;li&gt;&lt;b&gt;Privacy.&lt;/b&gt; Collects, uses, or communicates the user&amp;#39;s personal information and behaviors (such as Web browsing habits) without explicit consent.  &lt;li&gt;&lt;b&gt;Security.&lt;/b&gt; Attempts to circumvent or disable the security features on the user’s computer, or otherwise compromises the computer&amp;#39;s security.  &lt;li&gt;&lt;b&gt;Performance.&lt;/b&gt; Undermines performance, reliability, and quality of the user&amp;#39;s computing experience with slow computer speed, reduced productivity, or corruption of the operating system.  &lt;li&gt;&lt;b&gt;Industry and consumer opinion.&lt;/b&gt; Considers the input from software industry and individual users as a key factor to help identify new behaviors and programs that might present risks to the user&amp;#39;s computing experience.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you want, read the page linked to, it&amp;#39;s got more detail on what criteria Microsoft looks for in identifying spyware - I think you&amp;#39;ll find that an objective reading matches the iPod Service&amp;#39;s behaviour up with several of the more detailed criteria.&lt;/p&gt; &lt;p&gt;For this blog, though, lets take the overview headings one by one:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Deceptive behaviours.&lt;/strong&gt; Yes. Absolutely, it&amp;#39;s running a process right now that it didn&amp;#39;t tell me was going to be added. I had no reason to expect that there&amp;#39;s going to be an iPod Service installed.  &lt;li&gt;&lt;strong&gt;Privacy.&lt;/strong&gt; No idea - I&amp;#39;m not leaving it there long enough to collect, use, or communicate anything back to Apple.  &lt;li&gt;&lt;strong&gt;Security.&lt;/strong&gt; Yes - adding a service running as LocalSystem adds to an attack surface that I try to keep low. Besides, &amp;quot;LocalSystem&amp;quot;? Why? Windows Mobile uses Local Service, far less powerful an account.  &lt;li&gt;&lt;strong&gt;Performance.&lt;/strong&gt; One more service that&amp;#39;s running permanently, that I&amp;#39;ll never use - yes, that&amp;#39;s going to affect performance, and reliability.  &lt;li&gt;&lt;strong&gt;Industry and consumer opinion.&lt;/strong&gt; Well, this consumer says yes, it&amp;#39;s a bad thing. Maybe not because Apple is trying to write spyware on purpose, but because they ought to know better than to write spyware by accident.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Of course, Microsoft is hardly likely to use this as a reason for Windows Defender to stamp out the iPod Service - they&amp;#39;re too afraid of being sued for the federal crime of &amp;#39;messing with Apple&amp;#39;.&lt;/p&gt; &lt;p&gt;And I certainly haven&amp;#39;t found any reason to believe that Apple&amp;#39;s iPod Service is calling home or acting like spyware - so just let&amp;#39;s use a term from &lt;a title="Sandi Hardmeier - Spyware Sucks" href="http://msmvps.com/blogs/spywaresucks/"&gt;Sandi&lt;/a&gt;&amp;#39;s vocabulary, &amp;quot;foistware&amp;quot;. [But that may be just because I haven&amp;#39;t really tried looking.]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1363844" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/What+my+wife+knows/default.aspx">What my wife knows</category></item><item><title>Can the EU get me QuickTime N?</title><link>http://msmvps.com/blogs/alunj/archive/2007/11/27/1363705.aspx</link><pubDate>Wed, 28 Nov 2007 01:52:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1363705</guid><dc:creator>Alun Jones</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/rsscomments.aspx?PostID=1363705</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/alunj/commentapi.aspx?PostID=1363705</wfw:comment><comments>http://msmvps.com/blogs/alunj/archive/2007/11/27/1363705.aspx#comments</comments><description>&lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="150" alt="no_itunes" src="http://msmvps.com/blogs/alunj/WindowsLiveWriter/CantheEUgetmeQuicktimeN_EEC8/no_itunes_3.png" width="180" align="right" border="0" /&gt; So, a long time ago, in a continent not so far away, the &lt;a title="Description of Windows XP Home Edition N and Windows XP Professional N" href="http://support.microsoft.com/kb/886540"&gt;European Union required Microsoft to ship a version of Windows without Media Player&lt;/a&gt;, called Windows XP N.&lt;/p&gt; &lt;p&gt;Now, here&amp;#39;s a follow-up to my previous articles:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msmvps.com/blogs/alunj/archive/2005/12/22/79670.aspx"&gt;Programmer Hubris Part 1 - He&amp;#39;s Just Not That Into You&lt;/a&gt;  &lt;li&gt;&lt;a href="http://msmvps.com/blogs/alunj/archive/2006/01/11/80787.aspx"&gt;Programmer Hubris Part 2: I&amp;#39;ll get you, and your little dog, too.&lt;/a&gt;  &lt;li&gt;&lt;a href="http://msmvps.com/blogs/alunj/archive/2007/05/14/i-m-still-not-that-into-apple.aspx"&gt;I&amp;#39;m still not that into Apple&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Once again, I find Apple&amp;#39;s Software Updater offering me &amp;quot;iTunes + QuickTime 7.5&amp;quot;, in response to a security flaw in QuickTime.&lt;/p&gt; &lt;p&gt;&amp;quot;Strange,&amp;quot; I think, &amp;quot;I can only see QuickTime 7.3 for download at the Apple download site - not 7.5. Clearly, this is an urgent update that they haven&amp;#39;t had a chance to put up on the web site. I&amp;#39;d better install it quickly.&amp;quot;&lt;/p&gt; &lt;p&gt;Uh, no.&lt;/p&gt; &lt;p&gt;As you&amp;#39;ll tell from my previous columns, I don&amp;#39;t want iTunes.&lt;/p&gt; &lt;p&gt;Let me say that again, clearly:&lt;/p&gt; &lt;h2&gt;&lt;strong&gt;I don&amp;#39;t want iTunes.&lt;/strong&gt;&lt;/h2&gt; &lt;p&gt;Ever.&lt;/p&gt; &lt;p&gt;[Unless I change my mind, and if that ever happens, then I will hunt iTunes down for myself.]&lt;/p&gt; &lt;p&gt;So, Steve Jobs, or any Apple fans, how can I install QuickTime so that it&amp;#39;s devoid of iTunes, remains devoid of iTunes, doesn&amp;#39;t keep bugging me to install iTunes, never offers me an advert for iTunes, and doesn&amp;#39;t cause Apple Software Update to go searching for and offering iTunes?&lt;/p&gt; &lt;p&gt;...&lt;/p&gt; &lt;p&gt;FX: Crickets chirping.&lt;/p&gt; &lt;p&gt;I want QuickTime N - a version of QuickTime that I will have to assert strong personal preferences before it will re-associate itself in any way whatsoever with a program that I don&amp;#39;t want to put on my machine. [That&amp;#39;s iTunes, by the way.]&lt;/p&gt; &lt;p&gt;[Actually, I don&amp;#39;t want QuickTime at all - I want to play .MOV files very very rarely. There&amp;#39;s a big difference.]&lt;/p&gt; &lt;p&gt;And while we&amp;#39;re there, let&amp;#39;s have a registry setting from each of the companies involved that says &amp;quot;I don&amp;#39;t ever want to be asked to install the Google Toolbar, the Yahoo Toolbar, the Ask.Com Toolbar, unless I go out deliberately, and manually download and install the affected application &lt;u&gt;on its own in the absence of any other software&lt;/u&gt;.&amp;quot;&lt;/p&gt; &lt;p&gt;Please, all you installation programmers out there, stop bugging me.&lt;/p&gt; &lt;p&gt;Really, please stop it!&lt;/p&gt; &lt;p&gt;If I wanted your free software, I&amp;#39;d go get your free software. Feel free to tell me about it, but don&amp;#39;t offer it up as a default installation with something else.&lt;/p&gt; &lt;p&gt;And for those of you programmers who are looking to include some random piece of junk - sorry, some excellent tool that you adore beyond all else (and whose owners have paid you to carry it) - don&amp;#39;t make me think while I&amp;#39;m installing your program, if for no other reason than that every time you give me another reason to stop installing, you increase the chance that I&amp;#39;ll stop and go elsewhere.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1363705" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/alunj/archive/tags/General+Security/default.aspx">General Security</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/Programmer+Hubris/default.aspx">Programmer Hubris</category><category domain="http://msmvps.com/blogs/alunj/archive/tags/What+my+wife+knows/default.aspx">What my wife knows</category></item></channel></rss>