<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">The Security Development Lifecycle</title><subtitle type="html" /><id>http://blogs.msdn.com/sdl/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/sdl/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-04-23T13:27:00Z</updated><entry><title>Static Analysis Tools and the SDL (Part Two)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/07/06/static-analysis-tools-and-the-sdl-part-two.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/07/06/static-analysis-tools-and-the-sdl-part-two.aspx</id><published>2009-07-06T22:42:26Z</published><updated>2009-07-06T22:42:26Z</updated><content type="html">&lt;p&gt;Hi, Bryan here. Michael wrote last week on static analysis for native C/C++ code, and this week I’ll be following up by covering the tools we use for managed static analysis. The SDL requires teams writing managed code to use two static analysis tools: FxCop and CAT.NET. Both of these tools are freely available to the public, and both tools also integrate very nicely into Visual Studio. If you’re not already using these tools in your development process, I highly recommend downloading and evaluating them, but first let’s take a quick look at each of them.&lt;/p&gt;  &lt;h3&gt;FxCop&lt;/h3&gt;  &lt;p&gt;You may be more familiar with FxCop as the “Code Analysis” feature found in Visual Studio Team Developer (and Team Suite) 2005 and later. If you’re already using Visual Studio, it’s a no-brainer to enable FxCop code analysis: open your solution’s Properties window (or your web site’s Website menu item), navigate to the Code Analysis tab, and check the “Enable Code Analysis on Build” option. If you’re not using VS, you can download the latest version of the standalone FxCop tool (1.36) &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9AEAA970-F281-4FB0-ABA1-D59D7ED09772&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;FxCop comes preinstalled with many useful rules, including rules to help ensure performance (for example, “Do not cast unnecessarily”), globalization (“Do not hardcode locale specific strings”), and maintainability (“Variable names should not match field names”), but the SDL is mainly concerned with the security rules. The SDL requires teams to enable all of the FxCop security rules and fix any violations.&lt;/p&gt;  &lt;p&gt;Many of the security rules are focused on detecting misuses of .NET Code Access Security policy. Some examples:&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://msdn.microsoft.com/en-us/library/ms182303.aspx"&gt;Do not indirectly expose methods with link demands&lt;/a&gt;. LinkDemand checks only the immediate caller’s permissions, it does not perform a complete stack walk like Demand does. Calling a LinkDemand-protected method from an unprotected method essentially allows the caller to bypass the security check completely. In general, Demand is much safer than LinkDemand; any misuse of LinkDemand can create a potential vulnerability to &lt;a href="http://msdn.microsoft.com/en-us/library/3ky50t49.aspx"&gt;luring attacks&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://msdn.microsoft.com/en-us/library/ms182317.aspx"&gt;Secure serialization constructors&lt;/a&gt;. If you place security demands on a type’s regular constructors, you must also place them on its serialization constructors, or else the demands could be bypassed.&lt;/p&gt;  &lt;p&gt;· &lt;a href="http://msdn.microsoft.com/en-us/library/ms182297.aspx"&gt;APTCA methods should only call APTCA methods&lt;/a&gt;. Assemblies marked with the AllowPartiallyTrustedCallersAttribute (APTCA) that call into other assemblies not marked with APTCA can be used by attackers to perform luring attacks. The attacker (calling from partially-trusted code) could simply call the APTCA method that would then call the protected method on his behalf. (Note that the use of APTCA in itself is banned by the SDL; if it’s absolutely necessary then a manual review of all APTCA methods must be made to ensure no luring attacks are possible.)&lt;/p&gt;  &lt;h3&gt;CAT.NET&lt;/h3&gt;  &lt;p&gt;While the built-in FxCop security rules are generally focused more on testing whether you’ve used security features in the right way (although it’s easy to write your own FxCop rules to check for almost anything you want, which we’ll talk about later in this post), CAT.NET is focused more on testing whether you’ve written your other features securely. This is a subtle but important distinction and both types of tests are necessary to help ensure secure code. By default, CAT.NET tests for the following vulnerabilities:&lt;/p&gt;  &lt;p&gt;· Cross-Site Scripting&lt;/p&gt;  &lt;p&gt;· SQL Injection&lt;/p&gt;  &lt;p&gt;· File Canonicalization issues&lt;/p&gt;  &lt;p&gt;· XPath and LDAP Injection. These attacks work on exactly the same principle as SQL injection (user data is interpreted as code), but for XPath and LDAP queries instead of SQL queries.&lt;/p&gt;  &lt;p&gt;· Redirection to User-Controlled Site (aka &lt;a href="http://blogs.msdn.com/sdl/archive/2008/04/03/phishing-holes.aspx"&gt;Open-Redirect Phishing&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;· Process Command Injection. This is yet another attack that works on the data-interpreted-as-code principle. In this case, the user supplies improperly validated arguments to a command-line process, which can allow the user to execute arbitrary processes on the server.&lt;/p&gt;  &lt;p&gt;CAT.NET also differs from FxCop in the way it performs analysis. Both tools are static IL analysis tools, meaning that they analyze the compiled Common Intermediate Language (CIL) bytecode and not the raw C#/VB.NET/etc source itself. However, FxCop works on an introspection basis, iterating through each assembly type, member, resource, etc, while CAT.NET works by creating a directed call graph and looking for execution paths that represent potential vulnerabilities.&lt;/p&gt;  &lt;p&gt;For example, if you wanted a rule to make sure your code doesn’t use MD5 (because it’s been banned by the SDL), FxCop would be a natural choice: you could simply write one method that would iterate through the all of the members in the assembly looking for instantiations of MD5Cng or MD5CryptoServiceProvider classes. On the other hand, if you wanted a rule to make sure incoming querystring data is validated by a regular expression before being adding to session state, CAT.NET would be a better choice. You would create a new rule XML file, adding HttpRequest.QueryString.Item and HttpRequest.Params.Item as “source” elements, HttpContext.Session.Item as a “sink” element, and System.Text.RegularExpression.Regex as a “filter” element. CAT.NET would then analyze the potential execution paths of the application, flagging any data flows that originate with HttpRequest.QueryString or HttpRequest.Params and end at HttpContext.Session without first passing through RegularExpression.Regex.&lt;/p&gt;  &lt;p&gt;CAT.NET can run standalone or integrated into Visual Studio, but in either case you’ll need to download it from microsoft.com: you can find the 32-bit version of CAT.NET &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0178e2ef-9da8-445e-9348-c93f24cc9f9d&amp;amp;displaylang=en"&gt;here&lt;/a&gt; and the 64-bit version &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=e0052bba-2d50-4214-b65b-37e5ef44f146&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. Microsoft online services teams have been using CAT.NET internally for quite a while, and I was extremely pleased when the Microsoft IT Information Security Tools team (formerly the Connected Information Security Group) released it externally.&lt;/p&gt;  &lt;h3&gt;Code Contracts&lt;/h3&gt;  &lt;p&gt;Finally, as an interesting look at an upcoming technology, check out the DevLabs &lt;a href="http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx"&gt;Code Contracts&lt;/a&gt; project. Code Contracts let you annotate your code to express required pre- or post-conditions on methods, just like SAL for native code. For example, you could require incoming method parameter values to conform to a specified regular expression, or require outgoing return values to be non-null. You can use Code Contracts both as a static analysis tool, to test for possible contract violations, and as runtime checks to actually enforce the conditions set. Like both FxCop and CAT.NET, Code Contracts can be installed either standalone or integrated with Visual Studio.&lt;/p&gt;  &lt;h3&gt;The SDL Optimization Model and Static Analysis&lt;/h3&gt;  &lt;p&gt;If you’re following the &lt;a href="http://msdn.microsoft.com/en-us/security/dd221356.aspx"&gt;SDL Optimization model&lt;/a&gt;, use of static analysis tools is deemed a requirement for the ‘Advanced’ maturity level.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9820824" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>Static Analysis Tools and the SDL (Part One)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/06/29/static-analysis-tools-and-the-sdl-part-one.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/06/29/static-analysis-tools-and-the-sdl-part-one.aspx</id><published>2009-06-29T16:42:30Z</published><updated>2009-06-29T16:42:30Z</updated><content type="html">&lt;p&gt;Hi, Michael here. &lt;/p&gt;  &lt;p&gt;This is part one of a two part series of posts by myself and Bryan Sullivan; I will cover the static analysis tools we use at Microsoft (and make available publicly) for analyzing unmanaged (ie; Native) C and C++ code, and Bryan will cover managed code static analysis in a later post.&lt;/p&gt;  &lt;p&gt;I’m a huge fan of static analysis tools; actually, I’m a fan of &lt;i&gt;any&lt;/i&gt; tooling that beneficially automates any portion of the software development process. Software development is a complex business, and anything you can do to make the process more repeatable, predictable and reduces ‘friction’ is a big win in my book.&lt;/p&gt;  &lt;p&gt;There are many benefits to using static analysis tools. The most important reasons include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Static analysis tools can scale: they can review a great deal of code very quickly; this is something humans cannot do very well.&lt;/li&gt;    &lt;li&gt;Static analysis tools don’t get tired. A static analysis tool running for four straight hours at 2:00 in the morning is just as effective as if it runs during business hours. You can’t say the same thing about human reviewers!&lt;/li&gt;    &lt;li&gt;Static analysis tools help developers learn about security vulnerabilities. Over the years, I’ve met a small number of developers who had bugs flagged in their code by static analysis tools, and they never knew what the bugs were until the tool posted a sign saying, “Security bug, right here!”&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Before I dive into static analysis tools in detail, it’s worthwhile explaining what ‘static analysis’ is. Static analysis is a method of analyzing program code without actually running the code. Generally, the tool will build an internal model of the code and analyze potential program flow through the code making assumptions about the data. For example, the following code may or may not be a real vulnerability:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;char foo[4];     &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;foo[i] = 0;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;because it depends on the value of ‘i’; if ‘i’ is in the range 0..3 and can only ever be in the range 0..3 then there is no security vulnerability, so the static analysis tool has to determine if this condition is possible. Clearly, it’s simple to determine that the following code is safe, because the index is constrained right next to the code that writes to the array:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;char foo[4];     &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;if (i&amp;gt;=0 &amp;amp;&amp;amp; i&amp;lt;=3) foo[i] = 0;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;But things get more complex if the index is validated in remote parts of the code. It is this level of analysis that determines if a tool is noisy: a tool that flags too many issues (false positives) because it missed a validity check will rapidly annoy a developer.&lt;/p&gt;  &lt;p&gt;I want to point out that static analysis is not grep, static analysis tends to be more robust. That does not mean grep is not useful, for example, if you have a set of banned functionality such as banning MD4 and MD5 (as the SDL does, along with other crypto algorithms) then grep’ing for MD4 and MD5 is totally valid, probably low noise and requires next to zero engineering effort. &lt;/p&gt;  &lt;p&gt;I also want to point out that the SDL focuses on using static analysis tools to find security vulnerabilities. Under the SDL umbrella, we would not require development teams use static analysis tools that didn’t find security issues. A tool that does not find security bugs is not a useless tool; we just would not make it an SDL requirement.&lt;/p&gt;  &lt;p&gt;It’s important to point out that static analysis tools work in tandem with human code reviewing experts. Tools tend to find a lot of bugs quickly, but expert code reviewers are better at finding a smaller number of hard-to-find security bugs. I &lt;a href="http://www.computer.org/portal/site/security/menuitem.6f7b2414551cb84651286b108bcd45f3/index.jsp?&amp;amp;pName=security_level1_article&amp;amp;TheCat=1001&amp;amp;path=security/2006/v4n4&amp;amp;file=basic.xml&amp;amp;"&gt;wrote an article&lt;/a&gt; for IEEE Security &amp;amp; Privacy a few years back describing the methods I use to review code for security bugs.&lt;/p&gt;  &lt;p&gt;Static analysis tools have been used for many years at Microsoft. We started in earnest with a tool named PREfix when we acquired Intrinsa. PREfix is aimed at finding general code quality bugs in C and C++ and has proven very effective over the years. The main downside to PREfix is it is big, and generally is run centrally rather than each developers’ desktop. So PREfix begat PREfast, a smaller desktop version of PREfix. PREfast has the advantage of being relatively quick to run (it &lt;u&gt;only&lt;/u&gt; doubles compile times!) but it suffers from only being intra-procedural; in other words, its view of your code is very small, while PREfix is inter-procedural and can evaluate conditions in far-flung regions of your code. If you need to know why that’s important, refer to the example code above!&lt;/p&gt;  &lt;p&gt;PREfix and PREfast both support the Standard Annotation Language (SAL) which I have addressed a &lt;a href="http://blogs.msdn.com/sdl/archive/2009/06/11/a-declspec-sal-to-attribute-sal-rosetta-stone.aspx"&gt;couple of times in the past&lt;/a&gt;. SAL allows you to describe function contract semantics to help tools like PREfix and PREfast find more security bugs. SAL is used throughout Visual C++.&lt;/p&gt;  &lt;p&gt;PREfast is available in Visual C++ today as the /analyze option, it’s also freely available in the Windows Device Driver Kit (as prefast.exe) and Software Development Kit (as /analyze).&lt;/p&gt;  &lt;h3&gt;What You Should Do&lt;/h3&gt;  &lt;p&gt;If you write native C or C++ code, you should:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Compile at least once a day with /analyze&lt;/li&gt;    &lt;li&gt;Use SAL to annotate your function prototypes, this will help the static analysis functionality in the compiler find many more bugs.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The following warnings should be analyzed, as they are probably security issues:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa935142.aspx"&gt;6029&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/a5b9aa09(VS.80).aspx"&gt;6053&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/ms182080.aspx"&gt;6054&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/t9a67d2b.aspx"&gt;6057&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/2b5wde95.aspx"&gt;6059&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/wkw5tfd8.aspx"&gt;6063&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/b760t248.aspx"&gt;6067&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/ms182081.aspx"&gt;6200&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/11ckc29k.aspx"&gt;6201&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/6cb2bae4.aspx"&gt;6202&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/77w7wbyc.aspx"&gt;6203&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/7exfe3st.aspx"&gt;6204&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/e7ca7stt.aspx"&gt;6209&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/c5se1z6d.aspx"&gt;6248&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/4b4tecce.aspx"&gt;6277&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/x8726e9z.aspx"&gt;6298&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/aeh4k13s.aspx"&gt;6305&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/kkedhy7c.aspx"&gt;6308&lt;/a&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/ms182086.aspx"&gt;6383&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Finally, for extra credit, look for the following warnings that are generated by the compiler and not by the static analysis tools:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/axhfhh6x.aspx"&gt;4700&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/1wea5zwe.aspx"&gt;4701&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Both of these relate to uninitialized data and to enable these warnings either compile with warning level 4 (/W4), or if you’re not daring enough, use /W3 augmented with the following:&lt;/p&gt;  &lt;p&gt;/W3 /WX /we4701/we4700&lt;/p&gt;  &lt;h3&gt;The SDL Optimization Model and Static Analysis&lt;/h3&gt;  &lt;p&gt;If you’re following the &lt;a href="http://msdn.microsoft.com/en-us/security/dd221356.aspx"&gt;SDL Optimization model&lt;/a&gt;, use of static analysis tools is deemed a requirement for the ‘Advanced’ maturity level.&lt;/p&gt;  &lt;h3&gt;Summary &lt;/h3&gt;  &lt;p&gt;In summary, the SDL mandates static analysis tools for C and C++ code. If you are currently not using static analysis tools in your development environment, you should. If you’ve never run static analysis tools then the chances are good you’ll find some ‘interesting’ bugs!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9808730" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>Good thinking about threat models</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/06/26/good-thinking-about-threat-models.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/06/26/good-thinking-about-threat-models.aspx</id><published>2009-06-26T17:56:29Z</published><updated>2009-06-26T17:56:29Z</updated><content type="html">&lt;p&gt;We wanted to take a minute to point out &lt;a href="http://1raindrop.typepad.com/1_raindrop/2009/06/using-threat-models.html"&gt;this good post&lt;/a&gt; from Gunnar Peterson.&amp;#160; He’s right, and it’s worth repeating: we threat model not to find threats, but to find and implement countermeasures.&amp;#160; We’re glad to see people building on our work like this.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9805737" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>Microsoft &amp; Adobe: Protecting our customers together</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/06/17/microsoft-adobe-protecting-our-customers-together.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/06/17/microsoft-adobe-protecting-our-customers-together.aspx</id><published>2009-06-17T17:59:45Z</published><updated>2009-06-17T17:59:45Z</updated><content type="html">&lt;p&gt;Hey everyone, Jeremy Dallman here. Today I will be co-blogging with David Lenoe (Group Program Manager, Adobe Secure Software Engineering Team (ASSET)). Now, here’s the story behind the Microsoft and Adobe security pairing …&lt;/p&gt;  &lt;p&gt;A couple of years ago, Microsoft and Adobe made a decision to work together on security rather than address our similar security goals within the vacuum of each company. Our security teams have since been working closely together with the clear goal of protecting our mutual customers. This collaborative relationship enables faster implementations of security protection through the lifecycle processes both companies offer (Microsoft’s Security Development Lifecycle - SDL, Adobe’s Secure Product LifeCycle - SPLC), and allows us to share best practices learned over the years. In turn, each company learns about new ways to apply their respective lifecycle plan, thereby helping to provide our customers with a more secure computing environment. &lt;/p&gt;  &lt;p&gt;Through the last couple of years we have had conversations about defining and implementing security requirements, prioritizing security risk, threat modeling, the benefits of compiler/linker flag protections, fuzzing, and penetration testing. We’ve even shared data on security incidents and response.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Implement proactive engineering protections&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;With support from the security folks at Microsoft, ASSET helped the Adobe product teams set the security-related C++ compiler and linker flags such as &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc337897.aspx"&gt;/NXCOMPAT, /DYNAMICBASE (ASLR), /GS, and /SAFESEH&lt;/a&gt;. Working together, we were able to address compatibility issues and get these protections in place for both Adobe Flash Player and Adobe Reader. These protections have helped to mitigate entire classes of vulnerabilities in Microsoft products and will improve the security of Adobe products as well. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Encourage consistent security updating&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Most recently, we worked together to publish some 2008 attack data on vulnerabilities affecting Microsoft and Adobe products in the &lt;a href="http://www.microsoft.com/security/portal/sir.aspx"&gt;Microsoft Security Intelligence Report&lt;/a&gt;. Our goal was to emphasize to our mutual customers that installing security updates for Microsoft, Adobe and other third-party applications is very important. Having customers update promptly when Microsoft or Adobe addresses vulnerabilities is the best way to avoid the rapid spread of attacks.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Adopt security tools &lt;/b&gt;&lt;/p&gt;  &lt;p&gt;After the Microsoft Security Sciences team released &lt;a href="http://www.codeplex.com/msecdbg"&gt;!exploitable&lt;/a&gt; in March, some of Adobe’s security testing teams started using it on their own products along with WinDbg to analyze the results of fuzz testing. Microsoft and Adobe continue to work together to address questions and help improve the effectiveness of this tool.&lt;/p&gt;  &lt;p&gt;Some of Adobe’s development teams also use static analysis tools like /analyze and FxCop to identify potential security vulnerabilities in source code. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Share response information&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;By collaborating amongst the teams at Microsoft and Adobe, the &lt;a href="http://www.microsoft.com/security/msrc/default.aspx"&gt;Microsoft Security Response Center (MSRC)&lt;/a&gt;, Microsoft Vulnerability Research (&lt;a href="http://blogs.technet.com/ecostrat/archive/2008/08/07/threats-in-a-blender-and-other-raisons-d-tre.aspx"&gt;MSVR&lt;/a&gt;) program, the &lt;a href="http://blogs.technet.com/srd/default.aspx"&gt;Microsoft Security Research and Defense&lt;/a&gt; team, the &lt;a href="http://blogs.adobe.com/psirt/"&gt;Adobe Product Security Incident Response Team (PSIRT&lt;/a&gt;) and &lt;a href="http://blogs.adobe.com/asset/"&gt;Adobe Secure Software Engineering Team (ASSET)&lt;/a&gt;, respectively, we have also been able to identify security trends and more rapidly address vulnerabilities.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Continue working together&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;We consider the collaboration between Microsoft and Adobe to be a great success for both companies. We look forward to continuing to work together and discovering new and better ways that we can protect both Microsoft and Adobe customers in the future.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:cd8f1678-05f5-47f1-ab4e-784c7b02d232" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Microsoft" rel="tag"&gt;Microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Adobe" rel="tag"&gt;Adobe&lt;/a&gt;,&lt;a href="http://technorati.com/tags/security" rel="tag"&gt;security&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SDL" rel="tag"&gt;SDL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SPLC" rel="tag"&gt;SPLC&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9769949" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>A Declspec SAL to Attribute SAL Rosetta Stone</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/06/11/a-declspec-sal-to-attribute-sal-rosetta-stone.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/06/11/a-declspec-sal-to-attribute-sal-rosetta-stone.aspx</id><published>2009-06-11T17:19:33Z</published><updated>2009-06-11T17:19:33Z</updated><content type="html">&lt;p&gt;Hi, Michael here.&lt;/p&gt;  &lt;p&gt;A while back I &lt;a href="http://blogs.msdn.com/michael_howard/archive/2006/05/19/602077.aspx"&gt;wrote a blog&lt;/a&gt; post explaining the Standard Annotation Language (SAL) which is a technology we use to help static analysis tools find more bugs, including security vulnerabilities, in C and C++ code. If you look closely at VC++ 2005 and VC++ 2008, you’ll notice that almost all function prototypes are SAL annotated, which means you get the benefit of all the SAL work we did. But you might have also notice that the annotation style between the two compiler versions is different. &lt;/p&gt;  &lt;p&gt;For example, in Visual C++ 2005, realloc() is annotated like this:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre id="codeSnippet" class="csharpcode"&gt;__checkReturn __bcount_opt(_NewSize) &lt;br /&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; * __cdecl realloc(&lt;br /&gt;        __in_opt &lt;span class="kwrd"&gt;void&lt;/span&gt; * _Memory, &lt;br /&gt;        __in size_t _NewSize);&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;But in VC++ 2008, realloc() is annotated like this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre id="codeSnippet" class="csharpcode"&gt;_Check_return_ _Ret_opt_bytecap_(_NewSize) &lt;br /&gt;    &lt;span class="kwrd"&gt;void&lt;/span&gt; * __cdecl realloc(&lt;br /&gt;        _In_opt_ &lt;span class="kwrd"&gt;void&lt;/span&gt; * _Memory, &lt;br /&gt;        _In_ size_t _NewSize);&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;So what’s going on? In short, there is an updated flavor of SAL that offers greater flexibility and strictness. The older version is usually referred to as ‘declspec’ SAL, and the newer version is called ‘attribute’ SAL. They get their names from the structure of the underlying primitives and the following should make it clear: 
  &lt;table border="1" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="173"&gt;
          &lt;p&gt;&lt;strong&gt;SAL Macro&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="465"&gt;
          &lt;p&gt;&lt;strong&gt;SAL Primitives&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="173"&gt;
          &lt;p&gt;&lt;b&gt;Declspec SAL&lt;/b&gt;&lt;/p&gt;

          &lt;div id="codeSnippetWrapper"&gt;
            &lt;div id="codeSnippetWrapper"&gt;
              &lt;pre id="codeSnippet" class="csharpcode"&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; Foo( &lt;br /&gt;    __in_bcount(cb) BYTE* pBuf, &lt;br /&gt;    size_t cb );&lt;/pre&gt;

              &lt;br /&gt;&lt;/div&gt;

            &lt;br /&gt;&lt;/div&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="465"&gt;
          &lt;p&gt;void Foo( 
            &lt;br /&gt;__declspec(&amp;quot;SAL_pre&amp;quot;) 

            &lt;br /&gt;__declspec(&amp;quot;SAL_valid&amp;quot;) 

            &lt;br /&gt;__declspec(&amp;quot;SAL_pre&amp;quot;) 

            &lt;br /&gt;__declspec(&amp;quot;SAL_deref&amp;quot;) 

            &lt;br /&gt;__declspec(&amp;quot;SAL_readonly&amp;quot;) 

            &lt;br /&gt;__declspec(&amp;quot;SAL_pre&amp;quot;) 

            &lt;br /&gt;__declspec(&amp;quot;SAL_readableTo(byteCount(&amp;quot;&amp;quot;cb&amp;quot;&amp;quot;))&amp;quot;) BYTE* pBuf, size_t cb );&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="173"&gt;
          &lt;p&gt;&lt;b&gt;Attribute SAL&lt;/b&gt;&lt;/p&gt;

          &lt;div id="codeSnippetWrapper"&gt;
            &lt;pre id="codeSnippet" class="csharpcode"&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; Foo( &lt;br /&gt;    _In_bytecount_(cb) BYTE* pBuf, &lt;br /&gt;    size_t cb );&lt;/pre&gt;
          &lt;/div&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="465"&gt;
          &lt;p&gt;void Foo( 
            &lt;br /&gt;[SA_Pre&amp;#160; (Null=SA_No,ValidBytes=&amp;quot;cb&amp;quot;)] 

            &lt;br /&gt;[SA_Pre(Deref=1,Valid=SA_Yes)] 

            &lt;br /&gt;[SA_Pre(Deref=1,Access=SA_Read)] BYTE* pBuf, size_t cb );&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;Aren’t you happy we created macros for the low-level primitives!? You should never have to use the low-level primitives in your code: the table is to show you why the two SAL formats got their names. &lt;/p&gt;

&lt;p&gt;So why a new SAL syntax? I have good news and really good news. First, the good news: other than a simple macro syntax change, there is not a lot new to learn in part because the macros are similar (not identical, however) and the major difference, the low-level primitives, are abstracted away. &lt;/p&gt;

&lt;p&gt;Now for the really good news. Attribute SAL is much more rigorous than declspec SAL, which means analysis tools can find more bugs with lower false positives (‘noise’). For example, declspec SAL is often silent in the face of an incorrect annotation. &lt;/p&gt;

&lt;p&gt;The introduction of attribute SAL does not mean declspec SAL is dead, but it does mean that we will not be investing any more resources into declspec SAL, all our energy improving SAL and our analysis tools use of SAL will be in attribute SAL. At a pragmatic level, this means:&lt;/p&gt;

&lt;p&gt;· If you have already invested in using declspec SAL you should migrate over to attribute SAL as time allows, and use new attribute SAL for new functions. Both syntaxes can co-exist.&lt;/p&gt;

&lt;p&gt;· If you have never used SAL, you should use attribute SAL. As far as you’re concerned, declspec SAL never existed.&lt;/p&gt;

&lt;p&gt;One noticeable difference in macro names is the use of declspec SAL’s “count” and attribute SAL’s “cap” and “count.” The former is a buffer size in elements or bytes, but the latter two are the buffer’s writing capacity and the size of the buffer for reading, respectively.&lt;/p&gt;

&lt;p&gt;An important addition to attribute SAL is _Printf_format_string_ which can be used to find many printf-related format-matching ills.&lt;/p&gt;

&lt;p&gt;The following table shows some of the major differences: 
  &lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;&amp;#160;&lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;declspec SAL&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Attribute SAL&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Loose, allows macros in places they don’t make sense&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Strict, annotations can be only put on parameters and return values &lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Consistency checks&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Few, allows wrong macros&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Many, exhaustive set of warnings for wrong\inconsistent annotations &lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Wrong annotations&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Ignored&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Flagged&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Constant expressions buffer sizes&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Simple expressions only&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Fully supported including templates, but requires different macros. &lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Return values&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Loose syntax and consistency rules allow the use of ‘__out’ family&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Special set of macros for return values required&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;&lt;strong&gt;Naming consistency&lt;/strong&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Overloaded use of ‘count’ for writable and readable&amp;#160; extent. Hard to understand _full and _part postfixes&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="top" width="197"&gt;
          &lt;p&gt;Consistent use of ‘cap’ (capacity) for writable extent and ‘count’ for readable extent&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;p&gt;As noted in the table above, there is one minor drawback to using attribute SAL. If you use constant expressions as count or cap arguments, you must use a special set of macros, which is a little less elegant than declspec SAL:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Foo( _In_count_c_( 8 ) &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;* rgInt );&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;versus &lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Foo( __in_count( 8 ) &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;* rgInt );&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Note the _c_ portion of the attribute syntax, which is not needed when using declspec macros. With that said, attribute syntax supports accept any C++ conformant constant expression including enums and template arguments, but decspec SAL supports only simple expressions.&lt;/p&gt;

&lt;h4&gt;An Example&lt;/h4&gt;

&lt;p&gt;To put his altogether, let’s look at some simple code, and see how the VC++ 2008 /analyze static analysis performs when faced with the different SAL types. &lt;/p&gt;

&lt;p&gt;First, declspec SAL:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;struct&lt;/span&gt; SomeStruct {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; x;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;float&lt;/span&gt; f;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; FuncOne(__in_z_opt &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;* filename);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FuncTwo(&lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *pFormat, ...);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FuncThree( __in &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; SomeStruct* setup );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FuncFour(__in HWND h, __in &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *sz); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; TestWarnings() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; b;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     FuncOne(&amp;amp;b); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     FuncTwo(&lt;span style="color: #006080"&gt;&amp;quot;%d %p %d&amp;quot;&lt;/span&gt;, 10.0, &lt;span style="color: #006080"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;     FuncThree(0); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     SomeStruct blah;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;     FuncThree(&amp;amp;blah);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; buff[100];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     FuncFour(NULL,buff);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;&lt;/div&gt;

&lt;p&gt;When compiled with /W4 /analyze, the compiler gives us:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre id="codeSnippet" class="csharpcode"&gt;warning C6309: Argument '1' is null: this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; function &lt;br /&gt;specification of 'FuncThree'&lt;br /&gt;warning C6309: Argument '1' is null: this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; function &lt;br /&gt;specification of 'FuncFour'&lt;br /&gt;warning C6387: 'argument 1' might be '0': this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; the &lt;br /&gt;specification &lt;span class="kwrd"&gt;for&lt;/span&gt; the function 'FuncThree': Lines: 14, 15, 16, 17&lt;br /&gt;warning C6387: 'argument 1' might be '0': this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; the &lt;br /&gt;specification &lt;span class="kwrd"&gt;for&lt;/span&gt; the function 'FuncFour': Lines: 14, 15, 16, 17, 18, 19, 21, &lt;br /&gt;22&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Now, let’s take the same code, but decorate the function prototypes with attribute SAL rather than declspec SAL.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #cc6633"&gt;#include&lt;/span&gt; &lt;span style="color: #006080"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;struct&lt;/span&gt; SomeStruct {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; x;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;float&lt;/span&gt; f;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; FuncOne(_In_opt_z_ &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt;* filename);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FuncTwo(_Printf_format_string_ &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *pFormat, ...);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FuncThree(_In_ &lt;span style="color: #0000ff"&gt;const&lt;/span&gt; SomeStruct* setup );&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; FuncFour(_In_ HWND h, _In_ &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; *sz); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; TestWarnings() {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; b;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     FuncOne(&amp;amp;b); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     FuncTwo(&lt;span style="color: #006080"&gt;&amp;quot;%d %p %d&amp;quot;&lt;/span&gt;, 10.0, &lt;span style="color: #006080"&gt;&amp;quot;Hello&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;     FuncThree(0); &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     SomeStruct blah;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;     FuncThree(&amp;amp;blah);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;     &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;char&lt;/span&gt; buff[100];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;     FuncFour(NULL,buff);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre id="codeSnippet" class="csharpcode"&gt;warning C6273: Non-integer passed as parameter '2' when integer is required &lt;br /&gt;&lt;span class="kwrd"&gt;in&lt;/span&gt; call &lt;span class="kwrd"&gt;to&lt;/span&gt; 'FuncTwo': &lt;span class="kwrd"&gt;if&lt;/span&gt; a pointer value is being passed, %p should be used&lt;br /&gt;warning C6064: Missing integer argument &lt;span class="kwrd"&gt;to&lt;/span&gt; 'FuncTwo' that corresponds &lt;span class="kwrd"&gt;to&lt;/span&gt; &lt;br /&gt;conversion specifier '3'&lt;br /&gt;warning C6309: Argument '1' is null: this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; function &lt;br /&gt;specification of 'FuncThree'&lt;br /&gt;warning C6309: Argument '1' is null: this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; function &lt;br /&gt;specification of 'FuncFour'&lt;br /&gt;warning C6001: Using uninitialized memory 'b': Lines: 14, 15&lt;br /&gt;warning C6387: 'argument 1' might be '0': this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; the &lt;br /&gt;specification &lt;span class="kwrd"&gt;for&lt;/span&gt; the function 'FuncThree': Lines: 14, 15, 16, 17&lt;br /&gt;warning C6001: Using uninitialized memory 'blah': Lines: 14, 15, 16, 17, 18, &lt;br /&gt;19&lt;br /&gt;warning C6387: 'argument 1' might be '0': this does not adhere &lt;span class="kwrd"&gt;to&lt;/span&gt; the &lt;br /&gt;specification &lt;span class="kwrd"&gt;for&lt;/span&gt; the function 'FuncFour': Lines: 14, 15, 16, 17, 18, 19, 21, &lt;br /&gt;22&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;As you can see, using attribute SAL found many more code bugs, and all of them are real. I’ll let you sift through the list to see what attribute SAL found over and above declspec SAL! There are some duplicate bugs, however. &lt;/p&gt;

&lt;p&gt;If you want to learn more about SAL, I would recommend you simply open sal.h and read the comments and examples.&lt;/p&gt;

&lt;h4&gt;The Rosetta Stone&lt;/h4&gt;

&lt;p&gt;Below is a partial &lt;a href="http://en.wikipedia.org/wiki/Rosetta_stone"&gt;Rosetta Stone&lt;/a&gt; to help you convert between the two SAL syntaxes if you need to do so. 

  &lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;
      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;&lt;b&gt;Declspec&lt;/b&gt;&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;&lt;b&gt;Attribute&lt;/b&gt;&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td width="227"&gt;
          &lt;p&gt;__in_opt&lt;/p&gt;
        &lt;/td&gt;

        &lt;td width="284"&gt;
          &lt;p&gt;_In_opt_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_z_opt&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_z_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_opt&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_opt&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;&amp;#160;&lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;&amp;#160;&lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_ecount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_count_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_bcount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_xcount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_count_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_ecount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_z_count_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_bcount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_z_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_xcount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_z_count_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_ecount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_count_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_bcount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_xcount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_count_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_ecount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_z_count_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_bcount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_z_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__in_xcount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_In_opt_z_count_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;&amp;#160;&lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;&amp;#160;&lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_xcount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_z_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_z_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_xcount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_z_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_part(cap,count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_cap_post_count_(cap, count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_part(cap,count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_bytecap_post_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_full(capcount)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_capcount_(capcount)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_full(capcount)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_bytecapcount_(capcount)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_xcount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_z_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_z_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_xcount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_z_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_part_opt(cap,count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_cap_post_count_(cap,count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_part_opt(cap,count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_bytecap_post_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_ecount_full_opt(capcount)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_capcount_(capcount)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__out_bcount_full_opt(capcount)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Out_opt_bytecapcount_(capcount)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;&amp;#160;&lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;&amp;#160;&lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_ecount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_bcount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_xcount(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_ecount_full(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_count_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_bcount_full(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_xcount_full(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_count_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_ecount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_z_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_bcount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_z_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_xcount_z(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_z_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_ecount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_bcount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_xcount_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_ecount_full_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_count_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_bcount_full_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_bytecount_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_xcount_full_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_count_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_ecount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_z_cap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_bcount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_z_bytecap_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;

      &lt;tr&gt;
        &lt;td valign="bottom" width="227"&gt;
          &lt;p&gt;__inout_xcount_z_opt(count)&lt;/p&gt;
        &lt;/td&gt;

        &lt;td valign="bottom" width="284"&gt;
          &lt;p&gt;_Inout_opt_z_cap_x_(count)&lt;/p&gt;
        &lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;&lt;/table&gt;
&lt;/p&gt;

&lt;h4&gt;Acknowledgments&lt;/h4&gt;
I would like to thank Hannes Ruescher (Dev Mgr in Office,) Dave Bartolomeo (Principal Software Design Engineer in Visual Studio) and Bruce Dawson (Principal Software Design Engineer in Windows) for their gracious help providing core content for this document. 

&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9727129" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author><category term="SDL" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL/default.aspx" /></entry><entry><title>Announcing SDL-LOB “Security Development Lifecycle for Line-of-Business Applications”</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/06/05/announcing-sdl-lob-security-development-lifecycle-for-line-of-business-applications.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/06/05/announcing-sdl-lob-security-development-lifecycle-for-line-of-business-applications.aspx</id><published>2009-06-05T16:55:00Z</published><updated>2009-06-05T16:55:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Hi all, Anmol Malhotra here… I’m a Senior Security Engineer with Microsoft’s ACE (Assessment, Consulting &amp;amp; Engineering) Team. We are part of Microsoft &lt;/FONT&gt;&lt;A href="http://www.msinfosec.com/"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Information Security&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; group and our mission is to enable secure and reliable business for Microsoft and its customers. ACE Team is responsible for security, privacy and performance for line-of-business (LOB) applications at Microsoft.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Since 2001, we have been working in identifying and reducing risk posed by applications in our enterprise.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This experience has resulted in development of processes, tools and best practices to help develop and maintain secure applications for an enterprise. We developed the &lt;SPAN style="FONT-SIZE: 12pt; mso-bidi-font-size: 11.0pt"&gt;Security Development Lifecycle for Line-of-Business Applications&lt;/SPAN&gt; (SDL-LOB) process which defines the standards and best practices for securing LOB applications. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;As part of our continued commitment towards sharing security processes, and recommendations with our customers, we are excited to announce the new addition of detailed security requirements and recommendations for LOB applications with the release of &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/84aed186-1d75-4366-8e61-8d258746bopq.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Microsoft SDL version 4.1&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; on MSDN. &lt;SPAN style="mso-bidi-font-family: Arial"&gt;SDL-LOB provides a mainstream approach to the SDL which focuses on development of applications which support business such as accounting, human resources (HR), payroll, &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;A href="http://searchcio.techtarget.com/sDefinition/0,,sid182_gci214546,00.html"&gt;&lt;SPAN style="COLOR: windowtext; TEXT-DECORATION: none; mso-bidi-font-family: Arial; text-underline: none"&gt;&lt;FONT size=3 face=Calibri&gt;supply chain management&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; and resource planning applications etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Couple of things around this guidance –&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-ALIGN: justify; TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-font-size: 10.0pt; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;a)&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-size: 10.0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;This guidance is positioned exclusively for &lt;B style="mso-bidi-font-weight: normal"&gt;line-of-business applications or web applications and not for ISV/rich client and server application development.&lt;/B&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="mso-bidi-font-family: Calibri; mso-bidi-font-size: 10.0pt; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT size=3 face=Calibri&gt;b)&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bidi-font-size: 10.0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;It is important to emphasize that organizations should &lt;I style="mso-bidi-font-style: normal"&gt;&lt;U&gt;adapt &lt;/U&gt;&lt;/I&gt;rather than &lt;I style="mso-bidi-font-style: normal"&gt;&lt;U&gt;adopt&lt;/U&gt;&lt;/I&gt; the SDL-LOB process. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;BR&gt;&lt;FONT size=3 face=Calibri&gt;So here it is, &lt;/FONT&gt;&lt;/SPAN&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd831975.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;Security Development Lifecycle for Line-of-Business Applications&lt;/FONT&gt;&lt;/A&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;FONT size=3 face=Calibri&gt;. Also look out for SDL-LOB blog series on &lt;/FONT&gt;&lt;/SPAN&gt;&lt;A href="http://blogs.msdn.com/ace_team"&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;the ACE Team blog&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt; starting in June.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;We’ll discuss the SDL-LOB phases and highlights. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="mso-bidi-font-family: Arial"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Your comments &amp;amp; suggestions are very welcome.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9701589" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>A note on the recent SDL 4.1 process release...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/28/a-note-on-the-recent-sdl-4-1-process-release.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/28/a-note-on-the-recent-sdl-4-1-process-release.aspx</id><published>2009-05-29T00:17:00Z</published><updated>2009-05-29T00:17:00Z</updated><content type="html">Hello all - Dave here... 
&lt;P&gt;Wanted to drop a quick note to talk about the SDL 4.1 process guidance that we released on May 19th...&lt;/P&gt;
&lt;P&gt;While most of the attention and chatter from the development community has been focused on the announcement of the &lt;A href="http://msdn.microsoft.com/en-us/security/dd670265.aspx" mce_href="http://msdn.microsoft.com/en-us/security/dd670265.aspx"&gt;SDL Process Template for Visual Studio Team System&lt;/A&gt; and the addition of &lt;A href="http://www.saic.com/" mce_href="http://www.saic.com/"&gt;SAIC&lt;/A&gt; and &lt;A href="http://www.sans.org/" mce_href="http://www.sans.org/"&gt;SANS&lt;/A&gt; to the &lt;A href="http://msdn.microsoft.com/en-us/security/dd219581.aspx" mce_href="http://msdn.microsoft.com/en-us/security/dd219581.aspx"&gt;SDL Pro Network&lt;/A&gt;, the SDL 4.1 documentation release has a few important points to touch on.&lt;/P&gt;
&lt;P&gt;First, it demonstrates our ongoing commitment to process transparency - we released the SDL 3.2 process documentation for the first time at RSA 2008 along with a promise to update it on a regular basis.&amp;nbsp; So here we are, just over a year later, with the latest changes.&amp;nbsp; Many people in the IT and developer communities are curious about the individual requirements and recommendations that make up the SDL.&amp;nbsp; Additionally, there has been a lot of interest on how a process like the SDL is applied at an organization the size of Microsoft - we think the new documentation does a good job at answering both these queries.&lt;/P&gt;
&lt;P&gt;Second, there is a myth that I often hear repeated that the SDL &lt;STRONG&gt;"only works for Microsoft"&lt;/STRONG&gt; or &lt;STRONG&gt;"is&lt;/STRONG&gt; &lt;STRONG&gt;only suitable for development on Microsoft platforms."&lt;/STRONG&gt;&amp;nbsp; Honestly, that's a bit of a shocker for me.&amp;nbsp; Security training, threat modeling, static code analysis, fuzz testing and other security actions performed as part of the SDL are *&lt;I&gt;not*&lt;/I&gt; proprietary to Microsoft or the SDL.&amp;nbsp; While the 4.1 documentation *&lt;I&gt;is*&lt;/I&gt; focused on how the SDL is applied at MS, it doesn't require a Nobel Laureate to see that many of the things that make up the SDL are simply good security practices.&amp;nbsp; So, I'd encourage people to take a look at the requirements and recommendations that are listed in the document and form your own conclusions. Fight the FUD.&lt;/P&gt;
&lt;P&gt;Finally, we've illustrated the changes that one would expect of a living process - the expected fine tuning of our SDL requirements and recommendations to reflect changes in the security space.&amp;nbsp; In addition, we have included information on how the SDL is applied to online services (i.e. Microsoft publicly available websites) and how we use the SDL to build line-of-business (LOB) applications for internal use at Microsoft.&amp;nbsp; The changes specific to online services and LOB are called out in the text for easier review.&lt;/P&gt;
&lt;P&gt;So that's it - a quick snapshot of the 4.1 process.&amp;nbsp; As before, it's available both as &lt;A href="http://msdn.microsoft.com/en-us/library/cc307748.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc307748.aspx"&gt;web guidance&lt;/A&gt; on the MSDN Security Developer Center and as a &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=967389d8-6ed0-4751-a8d2-9c2fad39adce&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=967389d8-6ed0-4751-a8d2-9c2fad39adce&amp;amp;displaylang=en"&gt;Word document&lt;/A&gt; from the MSDN Download Center.&lt;/P&gt;
&lt;P&gt;As always, comments are welcome!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9651162" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>SDL Template and Agile...</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/22/sdl-template-and-agile.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/22/sdl-template-and-agile.aspx</id><published>2009-05-22T18:18:00Z</published><updated>2009-05-22T18:18:00Z</updated><content type="html">&lt;P&gt;Hello all - Dave here...&lt;/P&gt;
&lt;P&gt;We have been pleased thus far with the reaction from the developer community to our release of the &lt;A title="SDL Template for Visual Studio Team System" href="http://msdn.microsoft.com/en-us/security/dd670265.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/security/dd670265.aspx"&gt;SDL Template for Visual Studio Team System&lt;/A&gt;. However, some folks in the developer community have inquired about applying the template to agile methods.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The SDL template is a software manifestation of the Microsoft SDL requirements and recommendations as we apply them to typical Microsoft “packaged product” development projects.&amp;nbsp; Most of those projects are using native code and following a spiral development methodology.&lt;/P&gt;
&lt;P&gt;Agile methods are also used at Microsoft, but it’s &lt;EM&gt;critically&lt;/EM&gt; important that we fully examine how the SDL can be integrated into agile methods to ensure that we get it right.&amp;nbsp; We’ve already learned that simply taking the SDL for spiral methodology and applying the entire SDL at each agile sprint is not the right answer. We're working to bring the benefits of the Microsoft SDL to users of the Visual Studio Team System MSF for Agile template in the near future.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9635652" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>New SDL Pro Network Members: SANS and SAIC</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/21/new-sdl-pro-network-members-sans-and-saic.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/21/new-sdl-pro-network-members-sans-and-saic.aspx</id><published>2009-05-21T15:50:00Z</published><updated>2009-05-21T15:50:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;When &lt;A href="http://blogs.msdn.com/sdl/archive/2008/09/11/new-addition-to-the-starting-line-up.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2008/09/11/new-addition-to-the-starting-line-up.aspx"&gt;I joined the SDL team&lt;/A&gt; last fall, the &lt;A href="http://msdn.microsoft.com/en-us/security/dd219581.aspx" mce_href="http://msdn.microsoft.com/en-us/security/dd219581.aspx"&gt;SDL Pro Network&lt;/A&gt; had launched as a &lt;A href="http://blogs.msdn.com/sdl/archive/2008/09/18/about-the-sdl-pro-network.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2008/09/18/about-the-sdl-pro-network.aspx"&gt;one-year pilot program&lt;/A&gt;.&amp;nbsp; Upon returning from maternity leave, I took over management of the SDL Pro Network.&amp;nbsp; I have been working on formalizing the program in order to bring it from pilot phase into a full blown partner program, to launch after November 2009.&amp;nbsp; I have also been working on bringing new consulting services and training members into the fold, even during this pilot phase of the program.&lt;/FONT&gt;&lt;FONT size=3 face=Calibri&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;On May 19, the SANS Institute, one of the most trusted and largest sources for information security training, certification &amp;amp; research in the world, and SAIC, a company of over 45,000 employees worldwide with expertise in national security, energy and the environment, critical infrastructure and health, were also added to the SDL Pro Network in an effort to further broaden the SDL’s reach. &lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In joining forces with these two new SDL Pro Network members, Microsoft’s SDL team is bringing more options for world-renowned security training and consulting services to new developers around the world.&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Please join me in welcoming &lt;A href="http://www.sans.org/sdl.php" mce_href="http://www.sans.org/sdl.php"&gt;SANS&lt;/A&gt; and &lt;A href="http://www.saic.com/" mce_href="http://www.saic.com/"&gt;SAIC&lt;/A&gt; into the SDL Pro Network.&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;-&lt;A href="http://twitter.com/k8em0" mce_href="http://twitter.com/k8em0"&gt;Katie Moussouris&lt;/A&gt;, Senior Security Strategist, SDL&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9633926" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author><category term="SDL" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL/default.aspx" /><category term="SDL Pro Network" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL+Pro+Network/default.aspx" /></entry><entry><title>Making Secure Code Easier</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/19/making-secure-code-easier.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/19/making-secure-code-easier.aspx</id><published>2009-05-19T16:31:00Z</published><updated>2009-05-19T16:31:00Z</updated><content type="html">&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c5275c5a-cb28-4d77-8114-3dac530e0a92" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/SDL" rel="tag"&gt;SDL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SDL+Process+Template" rel="tag"&gt;SDL Process Template&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Tools" rel="tag"&gt;Tools&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;Hi everyone! Jeremy Dallman here. I would like to announce a new and easier way to integrate the SDL into your development lifecycle.&lt;/p&gt;  &lt;p&gt;In the year since we released the &lt;a href="http://msdn.microsoft.com/en-us/security/dd670265.aspx"&gt;Microsoft SDL Process Guidance&lt;/a&gt; documentation, companies interested in adopting the SDL have often asked us “where do I start”? In the past year, we’ve provided the &lt;a href="http://msdn.microsoft.com/en-us/security/dd221356.aspx"&gt;SDL Optimization Model&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/en-us/security/dd206731.aspx"&gt;The SDL Threat Modeling Tool&lt;/a&gt;, and the &lt;a href="http://msdn.microsoft.com/en-us/security/dd219581.aspx"&gt;SDL Pro Network&lt;/a&gt; as great options to get you started. Quite often, the follow-up comment has been “I just need a way to practically apply the SDL in my development lifecycle… can’t you just put it into Visual Studio?” In order to successfully integrate security into their development process, the people who own a security initiative realize that they need to introduce secure development practices and the SDL with minimal impact on their existing development frameworks and as part of the familiar environment.&lt;/p&gt;  &lt;h5&gt;&lt;b&gt;Today we are making available the &lt;/b&gt;&lt;a href="http://msdn.microsoft.com/en-us/security/dd670265.aspx"&gt;Microsoft SDL Process Template&lt;/a&gt;&lt;b&gt;.&lt;/b&gt;&lt;/h5&gt;  &lt;p&gt;The SDL Process Template is a &lt;b&gt;free downloadable template&lt;/b&gt; for &lt;a href="http://msdn.microsoft.com/en-us/vsts2008/default.aspx"&gt;Visual Studio Team System&lt;/a&gt; that integrates the SDL directly into a customer’s software development environment. Because it integrates with the team and process features of Team System, you do need a Team Foundation Server to manage your work. This is our first comprehensive offering that addresses all phases of the SDL from Requirements through Release.&lt;/p&gt;  &lt;p&gt;By taking advantage of the rich functionality in Visual Studio Team System and Team Foundation Server, we are now able to offer an SDL solution that reduces the barrier to entry for SDL adoption, provides auditing for satisfying the security requirements, and demonstrates security return on investment. The SDL Template is intended to provide the foundational components of the SDL for every phase of your development project. &lt;/p&gt;  &lt;h4&gt;How to check it out for yourself&lt;/h4&gt;  &lt;p&gt;We hope you will take the time to download the SDL Process Template and consider using it to integrate security and the SDL into your team project. If you do not currently use Visual Studio Team System, but would like to evaluate the SDL Process Template, evaluation versions in both &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=72262EAD-E49D-43D4-AA45-1DA2A27D9A65&amp;amp;displaylang=en%20+%20http://www.microsoft.com/downloads/details.aspx?familyid=04D26402-3199-48A3-AFA2-2DC0B40A73B6&amp;amp;displaylang=en"&gt;VPC&lt;/a&gt; and &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9eb65c97-29c9-4d05-ae45-73d22ad4b86e&amp;amp;displaylang=en"&gt;Hyper-V&lt;/a&gt; environments are available for download. You can simply upload the SDL Process Template into that virtual environment and check it out for yourself.&lt;/p&gt;  &lt;h4&gt;A quick walk-through&lt;/h4&gt;  &lt;p&gt;Here is a quick preview of the basic functionality the SDL Process Template offers:&lt;/p&gt;  &lt;h5&gt;Process Guidance: Integrated SDL Overview, SDL documents, and How to customize &lt;/h5&gt;  &lt;p&gt;After installation completes and a new Team Project is created, the first page that appears is the Process Guidance page. This page provides everyone on the project with: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A brief overview of the SDL&lt;/li&gt;    &lt;li&gt;Five steps for Getting Started on an SDL project&lt;/li&gt;    &lt;li&gt;Details on customizing the template and extending it for third party security tools&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: The SDL Process Guidance “front page”&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image002_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image002_thumb.jpg" width="381" height="265" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;h5&gt;SharePoint: SDL Document Library and Project dashboard&lt;/h5&gt;  &lt;p&gt;Since SharePoint is included with Visual Studio Team System, The basic SharePoint site provides a single location for all project participants to get a common view of project status, related announcements and dates, and access the large document library.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: the SharePoint site serves as a project dashboard&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image004_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image004_thumb.jpg" width="378" height="272" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;h5&gt;SDL Requirements: Pre-loaded SDL work items ready to triage &lt;/h5&gt;  &lt;p&gt;By selecting the “All SDL Tasks” query the team can find the pre-populated list of all SDL Requirements and Recommendations. No more trying to figure out where to start when it comes to defining security requirements! The SDL Template also provides a custom work item that allows you to create and add your own unique requirements or recommendations.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: all SDL Requirements and Recommendations pre-loaded and ready to triage&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image006_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006" border="0" alt="clip_image006" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image006_thumb.jpg" width="376" height="272" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h4&gt;&lt;/h4&gt;  &lt;h5&gt;SDL Check-in Policies: Enforce SDL policy with existing VS features &lt;/h5&gt;  &lt;p&gt;Developers care about security, but they want it to be intuitive. We have provided check-in policies that will ensure every set of code is taking advantage of the SDL required compiler/linker flags and Code Analysis features already in Visual Studio. This will eliminate entire classes of security weaknesses from your code. A Security Code Review work item is also included to support enforcement of security code reviews for security-sensitive code.&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: Setting Check-in policies&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image008_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image008" border="0" alt="clip_image008" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image008_thumb.jpg" width="374" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: Check-in policies in action&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;h4&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image010_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image010" border="0" alt="clip_image010" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image010_thumb.jpg" width="376" height="272" /&gt;&lt;/a&gt;&lt;/h4&gt;  &lt;h5&gt;Customized Security bugs: Tag and track Cause, Severity, and STRIDE Effect &lt;/h5&gt;  &lt;p&gt;Testers want to be able to emphasize the importance of a security bug and properly communicate the impact to their product. The default “bug” work item now has customized security fields so you can identify security cause, severity, and security effect (using STRIDE), and mark a bug as Blocking or Not Blocking. This feature allows you to track and search for security-specific bugs. &lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: Identifying a bug as a security issue&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image012_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image012" border="0" alt="clip_image012" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image012_thumb.jpg" width="375" height="261" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Final Security Review: Track and audit the state of all active security bugs, completion of SDL tasks, and effectiveness of security tools&lt;/h5&gt;  &lt;p&gt;The entire team and especially senior management want an easy-to-read document that summarizes the security work completed. The Final Security Review Report and Security Bugs Report provide an auditable set of evidence that details security work completed as well as deferred tasks. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Page One: status of all bugs marked as Security Bugs &lt;/li&gt;    &lt;li&gt;Page Two: completion status for the SDL Requirements and Recommendations&lt;/li&gt;    &lt;li&gt;Page Three: security bugs found by all tools integrated with the template&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: Page 1 of the Final Security Review&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image014_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image014" border="0" alt="clip_image014" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image014_thumb.jpg" width="372" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;i&gt;&lt;u&gt;Below: Page 2 of the Final Security Review&lt;/u&gt;&lt;/i&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image016_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image016" border="0" alt="clip_image016" src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/MakingSecureCodeEasier_C533/clip_image016_thumb.jpg" width="371" height="265" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h5&gt;Threat modeling: Seamless integration with the SDL Threat Modeling Tool&lt;/h5&gt;  &lt;p&gt;Threat modeling is a critical part of your early design process. It informs architects of the attack surface, provides insight for the developers to write more secure code, and enables testers to more effectively build test cases to verify mitigations. The SDL Process Template includes a script that will convert SDL Threat Modeling tool issues into security bugs and hook into the reporting piece of the template. &lt;/p&gt;  &lt;p&gt;~~~~~~~&lt;/p&gt;  &lt;p&gt;We hope you will take a look at the SDL Process Template and consider using it to ease adoption of the SDL in your development teams. As we move forward with more SDL offerings, our plan is to integrate any tools and guidance into the SDL Process Template – making it a dynamic foundation for an end-to-end SDL solution. &lt;/p&gt;  &lt;p&gt;We look forward to your feedback as you download and begin using the SDL Process Template to make your code more secure. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9628492" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>Please Join me in welcoming memcpy() to the SDL Rogues Gallery</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/14/please-join-me-in-welcoming-memcpy-to-the-sdl-rogues-gallery.aspx</id><published>2009-05-14T21:41:00Z</published><updated>2009-05-14T21:41:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Over the last few years I have written a number of articles, papers and books describing some of the dangers of using various buffer-manipulating C runtime functions. Well-known examples of bad function calls include strcpy(), strcat(), strncpy(), strncat(), gets() and their foul brethren. The &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/sdl/archive/2008/10/22/good-hygiene-and-banned-apis.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2008/10/22/good-hygiene-and-banned-apis.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;SDL bans&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; these and many other functions with dubious security history. But, when it comes to banning functions, we must tread a very fine line because we can’t just ban something because it looks odd, or that gut instinct tells us it’s bad, we can only ban functionality that has been demonstrated to cause security vulnerabilities and only if there is a viable alternative. &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Because we have seen many security vulnerabilities in products from Microsoft and many others, including ISVs and competitors, and because we have a viable replacement, I am “proud” to announce that we intend to add memcpy() will to the SDL C and C++ banned API list later this year as we make further revisions to the SDL. Right now, memcpy() is on the SDL Recommended banned list, but will soon be added to the SDL banned API requirement list now that we have more feedback from Microsoft product groups.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The following security updates all have one thing in common: memcpy().&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpFirst&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MS03-030 (DirectX)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MS03-043 (Messenger Service)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MS03-044 (Help and Support)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MS05-039 (PnP) &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MS04-011 (PCT) &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;MS05-030 (Outlook Express) &lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;CVE-2007-3999 (MIT Kerberos v5)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpMiddle&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;CVE-2007-4000 (MIT Kerberos v5)&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1; tab-stops: list .5in" class=MsoListParagraphCxSpLast&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: Symbol; FONT-SIZE: 10pt; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-size: 11.0pt"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=3 face=Calibri&gt;…many more!&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;It’s not just memcpy() that we’re banning; we will also ban CopyMemory() and RtlCopyMemory(), and the replacement function is memcpy_s(). &lt;/FONT&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=3 face=Cambria&gt;Banning memcpy() in your code&lt;/FONT&gt;&lt;/H3&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;You too should start banning memcpy() in your new code, here’s what you can do right now:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Add the following line of code to a common header file:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;#pragma&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;deprecated&lt;/SPAN&gt; (memcpy, RtlCopyMemory, CopyMemory)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Every time the compiler sees an instance of the banned functions, you’ll get the following warning:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;warning C4995: 'memcpy': name was marked as #pragma deprecated&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;In Visual C++, you can also add this early in a common header:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;#define&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; _CRT_SECURE_WARNINGS_MEMORY&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;And you will get warnings like:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 8pt; mso-no-proof: yes"&gt;warning C4996: 'memcpy': This function or variable may be unsafe. Consider using memcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. c:\program files\microsoft visual studio 9.0\vc\include\wchar.h(1201) : see declaration of 'memcpy'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;You can deprecate these functions if you’re using gcc by poisoning them:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;#pragma&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt; GCC poison memcpy RtlCopyMemory CopyMemory&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT color=#4f81bd size=3 face=Cambria&gt;Fixing memcpy() calls&lt;/FONT&gt;&lt;/H3&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Thankfully, it’s pretty simple to migrate a call to memcpy() to a safer call to memcpy_s(); the big difference is memcpy_s() takes one extra parameter: the size of the destination buffer. If nothing else, memcpy_s makes you think about the size of the target buffer.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;The &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/michael_howard/archive/2006/05/19/a-brief-introduction-to-the-standard-annotation-language-sal.aspx" mce_href="http://blogs.msdn.com/michael_howard/archive/2006/05/19/a-brief-introduction-to-the-standard-annotation-language-sal.aspx"&gt;&lt;FONT color=#0000ff size=3 face=Calibri&gt;SAL-decorated&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt; function signature in VC++ 2008 is:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;errno_t &lt;SPAN style="COLOR: blue"&gt;__cdecl&lt;/SPAN&gt; &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;memcpy_s(&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_Out_opt_bytecap_post_bytecount_(_DstSize, _MaxCount) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; * _Dst,&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_In_ rsize_t _DstSize, &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_In_opt_bytecount_(_MaxCount) &lt;SPAN style="COLOR: blue"&gt;const&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; * _Src, &lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_In_ rsize_t _MaxCount&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;All you need to do is update calls to memcpy() by adding the size of the destination buffer. So calls like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;char dst[32];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;memcpy(dst,src,len);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;becomes&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;char dst[32];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;memcpy_s(dst,sizeof(dst), src,len);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Of course, you can easily make a call to memcpy_s() insecure by getting the buffer sizes wrong. The following code is no better than memcpy():&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"&gt;memcpy_s(dst,len, src,len);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;You’ve been warned!&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;I wonder when Larry, Steve and Linus will start banning strcpy() in their products?&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9617155" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author><category term="SDL" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL/default.aspx" /></entry><entry><title>SDL for the 5-Person PHP Shop</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/08/sdl-for-the-5-person-php-shop.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/08/sdl-for-the-5-person-php-shop.aspx</id><published>2009-05-08T18:28:00Z</published><updated>2009-05-08T18:28:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Hi, Bryan here. Regular readers of this blog know that I’m more likely to write technical posts about new defense tactics than I am to pontificate on the state of the security industry. However, while I was at the RSA Conference last month, I overheard a concerning misconception about the SDL that I’d like to address.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;During a panel discussion on static- and source-analysis techniques, the panelists – Chris Wysopal of Veracode, Jerry Archer of Intuit, Mary Ann Davidson of Oracle, and Brian Chess of Fortify – had strayed somewhat from the original topic and into a discussion of security processes. At this point, several of them stated their belief that the SDL is only useful for large organizations running Windows, and that it wouldn’t work well for “5-person shops writing PHP.”&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Now, I don’t believe that the only way to create secure software is to follow the SDL exactly the way we follow it at Microsoft. Not everyone building software is ready to commit as much time and energy to security as we do. For that matter, not everyone even needs to commit as much time and energy to security as we do! But everyone building software should be doing something to make that software more secure, which is exactly why we developed the &lt;/FONT&gt;&lt;A href="http://msdn.microsoft.com/en-us/security/dd221356.aspx"&gt;&lt;FONT size=3 face=Calibri&gt;SDL Optimization Model&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3 face=Calibri&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;It’s true that if you have 1000 or more developers, you’ll probably want to eventually work your way up to the Dynamic level of the Optimization Model (where we see ourselves), but the 5-person PHP shop could greatly benefit from implementing the SDL at the Standardized level. At the Standardized level, you perform high-ROI security activities such as validating input and encoding output to defend against cross-site scripting attacks, using stored procedures to defend against SQL injection attacks, and fuzzing your application inputs to find unknown errors. These all sound pretty applicable to a 5-person PHP shop to me!&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;FONT size=3 face=Calibri&gt;Ok, that’s definitely enough pontification for me for a while. The next time I post, I promise it’ll be something technical, like a comparison of various managed code static analysis tools or best practices for implementing cryptographic agility in your applications. Talk to you then.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9597493" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author></entry><entry><title>The Open Source Quality Challenge</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/05/01/the-open-source-quality-challenge.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/05/01/the-open-source-quality-challenge.aspx</id><published>2009-05-01T14:02:00Z</published><updated>2009-05-01T14:02:00Z</updated><content type="html">&lt;P&gt;Steve Lipner here, &lt;/P&gt;
&lt;P&gt;Steve Bellovin, &lt;A href="http://tools.ietf.org/html/rfc1579" mce_href="http://tools.ietf.org/html/rfc1579"&gt;one&lt;/A&gt; &lt;A href="http://tools.ietf.org/html/rfc1675" mce_href="http://tools.ietf.org/html/rfc1675"&gt;of&lt;/A&gt; &lt;A href="http://tools.ietf.org/html/rfc1948" mce_href="http://tools.ietf.org/html/rfc1948"&gt;the&lt;/A&gt; &lt;A href="http://tools.ietf.org/html/rfc3631" mce_href="http://tools.ietf.org/html/rfc3631"&gt;pioneers&lt;/A&gt; &lt;A href="http://www.wilyhacker.com/1e" mce_href="http://www.wilyhacker.com/1e"&gt;of&lt;/A&gt; &lt;A href="http://tools.ietf.org/html/rfc4107" mce_href="http://tools.ietf.org/html/rfc4107"&gt;Internet&lt;/A&gt; &lt;A href="http://www.cs.columbia.edu/~smb/papers/" mce_href="http://www.cs.columbia.edu/~smb/papers/"&gt;security&lt;/A&gt; wrote a &lt;A href="http://www.cs.columbia.edu/~smb/blog//2009-04/2009-04-29.html" mce_href="http://www.cs.columbia.edu/~smb/blog//2009-04/2009-04-29.html"&gt;blog post &lt;/A&gt;about security, open source, and secure development process.&amp;nbsp; It's worth reading if you're an open source fan, or if you're not.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;My one quibble is that Steve refers to fixing bugs in a way that implies that just fixing bugs improves security.&amp;nbsp; Our experience is that fixing bugs is not enough - you have to use tools and processes that specifically prevent security bugs from getting into the code in the first place. &lt;/P&gt;
&lt;P&gt;But that’s a minor quibble.&amp;nbsp; I think Steve's post is right on and a great read.&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9582398" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author><category term="SDL" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL/default.aspx" /></entry><entry><title>Security Development Processes and Transparency</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/04/30/security-development-processes-and-transparency.aspx" /><link rel="enclosure" type="application/vnd.ms-powerpoint" length="118784" href="http://blogs.msdn.com/sdl/attachment/9581118.ashx" /><id>http://blogs.msdn.com/sdl/archive/2009/04/30/security-development-processes-and-transparency.aspx</id><published>2009-04-30T19:33:00Z</published><updated>2009-04-30T19:33:00Z</updated><content type="html">&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Hi, Michael here,&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3 face=Calibri&gt;The following article, ”&lt;/FONT&gt;&lt;A href="http://www.sdtimes.com/link/33432"&gt;&lt;FONT size=3 face=Calibri&gt;Major software makers fail security transparency test&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;” caught my eye this morning, because it covers a topic of great interest to me&lt;S&gt;;&lt;/S&gt;: companies documenting their security and privacy-related software development practices for the world to critique and perhaps more important, use.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;As the article noted, Microsoft’s process has been public for nearly half a decade.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;About two years ago I created a short presentation (attached) that asks many of the questions implied by the SD Times article. We support the proposition that vendors should be evaluated by criteria that are closer to the real security properties people want in their systems.&amp;nbsp; Ask your vendors: are you investing in security or certificates?&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;The industry clearly has a long way to go, both in terms of improving security, and explaining how they achieve or plan to achieve their security objectives. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9581118" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author><category term="SDL" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL/default.aspx" /></entry><entry><title>You Can’t Outrun the Bear, so Let’s Make a Deal</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/sdl/archive/2009/04/23/you-can-t-outrun-the-bear-so-let-s-make-a-deal.aspx" /><id>http://blogs.msdn.com/sdl/archive/2009/04/23/you-can-t-outrun-the-bear-so-let-s-make-a-deal.aspx</id><published>2009-04-23T20:27:00Z</published><updated>2009-04-23T20:27:00Z</updated><content type="html">&lt;P&gt;Hello, Michael Weiss here. Nothing like having two Michaels around to confuse everyone. At least there are only two here. On a previous team, I was one of five Michaels.&lt;/P&gt;
&lt;P&gt;Over the next several weeks, I’ll be posting a series of entries to help explain why I do what I do for the SDL team. Today marks the first of them. It’s a twofer, since the first part doesn’t fully make sense until you read the second part.&lt;/P&gt;
&lt;H3&gt;You Can’t Outrun the Bear&lt;/H3&gt;
&lt;P&gt;It’s a wild world out there. When you’re walking through the forest of the Internet, there are hungry bears all around you. The thing is, you can’t outrun the bear. Well, you can, but it’s very hard, not worth it, and not necessary, because you can avoid being eaten without having to outrun the bear in the first place. And contrary to popular belief, simply being faster than the other guy won’t necessarily protect you.&lt;/P&gt;
&lt;P&gt;There are two ways you can avoid being eaten. The first is to have little meat, in which case your gross value is low. The other is to be fast enough that it would cost the bear more in energy to catch you than it would gain from eating you, in which case your gross cost is high. In either case, the bear makes a determination of your net value, that is, your gross value minus your gross cost. If the net value is positive, the bear chases you. If the net value is negative, the bear leaves you alone. This graph helps illustrate the point.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; MARGIN-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image align=right src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/YouCantOutruntheBearsoLetsMakeaDeal_BD56/image_3.png" width=285 height=209 mce_src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/YouCantOutruntheBearsoLetsMakeaDeal_BD56/image_3.png"&gt;The blue line represents zero net value. As long as you are above the blue line, you have a negative net value so you’re safe; if you’re under the line, you have a positive net value so you’re dinner. In software, if you’re the green dot in the Dinner Zone, how can you move toward the Safe Zone? One way is to increase the gross cost to your attackers, by closing off the easy avenues of attack. The SDL was created to provide a mechanism to systematically do this.&lt;/P&gt;
&lt;P&gt;While the SDL can move you toward the Safe Zone, it’s not necessarily going to get you all the way there. But that’s OK, because in the real world, you’re not the only bear food.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; MARGIN-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image align=right src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/YouCantOutruntheBearsoLetsMakeaDeal_BD56/image_9.png" width=285 height=206 mce_src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/YouCantOutruntheBearsoLetsMakeaDeal_BD56/image_9.png"&gt; Let’s assume on this second graph that you are represented by the green dot, and some other potential target (your buddy, maybe?) is represented by the orange dot. You have a more secure system than him (your dot is higher up, costing the attacker more), so the orange dot person gets targeted instead of you. But what about that other person (represented by the red dot)? Sure, you have a more secure system, but you’re also a more valuable target (your dot is farther to the right). Since you’re farther from the blue line than the red person is, the attacker will go after you before working on the red person; you have a higher net value, despite having a higher gross cost.&lt;/P&gt;
&lt;P&gt;In other words, just being more secure isn’t enough if you’re also a more valuable target.&lt;/P&gt;
&lt;P&gt;Decreasing your gross value is rarely easy. For example, if you’re a bank, you could choose not to have any money. &lt;A href="http://en.wikipedia.org/wiki/Willie_Sutton" mce_href="http://en.wikipedia.org/wiki/Willie_Sutton"&gt;Willie Sutton&lt;/A&gt; would certainly lose interest in you. At the same time, your value as a bank is gone, too…hardly a sustainable business model. Besides, attackers rarely know exactly what they will gain from a successful attack on you. Sure, they might get control of your machine, but there’s no telling what’s on it. So, other than under extraordinary circumstances, they can at best make educated guesses. Put another way, attackers gamble based on their &lt;I&gt;belief&lt;/I&gt; of your gross value.&lt;/P&gt;
&lt;P&gt;In most cases, it takes far less effort to increase the attacker’s cost than to decrease your gross value. This is why most people will buy security systems for their homes before they give up the big flat-screen TVs. Applying the SDL and increasing the attackers’ costs, therefore, is a great way to protect yourself from those bears out there.&lt;/P&gt;
&lt;P&gt;Based on what I said thus far, it’s easy to conclude that very few of us would be potential victims. After all, if you’re not a bank or some similar high-value target, you’re not worth attacking, right? Attackers have a weapon that deflates this argument.&lt;/P&gt;
&lt;H3&gt;Let’s Make a Deal&lt;/H3&gt;
&lt;P&gt;In the classic game show &lt;I&gt;&lt;A href="http://www.letsmakeadeal.com/" mce_href="http://www.letsmakeadeal.com/"&gt;Let’s Make a Deal&lt;/A&gt;&lt;/I&gt;, host Monty Hall gave contestants a choice between keeping an existing prize or trading it for something hidden behind various doors. The contestant had to determine whether it was worth the gamble for an unknown prize.&lt;/P&gt;
&lt;P&gt;An attacker would have to do the same, investing the same amount of time on the second victim as on the first, were it not for the magic of amortization. With amortization, an attacker can trade current assets (the investment of time, and maybe some equipment and/or money, to craft the attack) to open not only Door #1, but also Doors #2 through 1,000,000, collecting whatever is behind all of them. It’s an offer no contestant could refuse.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; MARGIN-LEFT: 0px; BORDER-TOP: 0px; MARGIN-RIGHT: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image align=right src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/YouCantOutruntheBearsoLetsMakeaDeal_BD56/image_8.png" width=285 height=207 mce_src="http://blogs.msdn.com/blogfiles/sdl/WindowsLiveWriter/YouCantOutruntheBearsoLetsMakeaDeal_BD56/image_8.png"&gt; Let’s put this on the graph to see how amortization works.&lt;/P&gt;
&lt;P&gt;So let’s assume you are still represented by the green dot, but note your new location. You’re easy to attack, but you’re not really valuable. On &lt;I&gt;Let’s Make a Deal&lt;/I&gt;, this would be like giving up the diamond ring for a year’s supply of laundry detergent. Congratulations, you’re in the safe zone, so you don’t need to do anything, right?&lt;/P&gt;
&lt;P&gt;Not necessarily. If the vulnerability that you have is shared with others, then the attacker can aggregate all of you at a very small increase in cost. To the attacker, all of the victims aggregate to a single high value at low cost. To the attacker, it’s trading the one diamond ring for a million years’ supply of laundry detergent. The attacker can open a store online to sell the excess and really clean up! Collectively, then, you are represented by the red dot…very high value in aggregate, at a small increase in cost over attacking you alone. So you’re not really in the safe zone at all. You’re deep in the danger zone!&lt;/P&gt;
&lt;P&gt;A real world example of this is the use of vulnerabilities in Windows to create botnets. The same vulnerability existed on millions of machines, so even though a single bot is of sufficiently low value as to render the individual machine safe (i.e., where the green dot is), the low additional cost of applying that same attack to millions of machines made the attack worthwhile to an attacker. Collectively, the botnet is represented by the red dot.&lt;/P&gt;
&lt;P&gt;But you don’t even need to have exactly the same software across multiple machines in order for amortization to work. An entire &lt;I&gt;class&lt;/I&gt; of vulnerability, such as SQL injection, can benefit from amortization. So even if you write your own application, to be used in a single installation, on a singularly low-value machine, you can still find yourself a member of the collective dreaded red dot!&lt;/P&gt;
&lt;P&gt;If you’re a member of such a group, increasing the cost to an attacker pays even bigger dividends. By applying the SDL, you can improve your security, pull you out of the group, and therefore move you up the graph. Furthermore, as you increase your differentiation from the herd, you become harder to aggregate, which (from the attacker’s perspective) moves you to the left as well. The rest of the group you left behind can be bear food.&lt;/P&gt;
&lt;P&gt;So you can see that it’s not only unnecessary to outrun the bear, but it’s also not necessarily enough to be faster than the other guy. By applying a systematic, thorough approach to security, such as through the SDL, you can become hard enough to attack that you can significantly reduce your risk.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9565425" width="1" height="1"&gt;</content><author><name>sdl</name><uri>http://blogs.msdn.com/members/sdl.aspx</uri></author><category term="SDL" scheme="http://blogs.msdn.com/sdl/archive/tags/SDL/default.aspx" /></entry></feed>