This past winter, a worm known as Slammer rattled the Internet violently enough to become what you might call a "CNN-level virus"?that is, it burrowed its way into the national consciousness.Nearly everything about the SQL Slammer was old. It was an old hack that exploited a year-old vulnerability found in an old target, Microsoft software. There was a patch to block Slammer that was six months old, and that patch suffered from an old patch problem: It was so kludgy to install that the patch needed a patch. Above all, the reaction to Slammer?the call to use the event to build security awareness?was so old it called Bob Hope "kid."But this much was new: Everyone agreed that Slammer was your fault.How to Save $60 BillionThe old game was to blame Microsoft. "Microsoft did not protect its customers," read a letter to The New York Times after the Melissa virus hit in 1999. A year later, after the I Love You virus infected Microsoft Outlook, a Washington Post editorial stated, "This is a software development problem." The Nimda worm (2001), according to Forrester Research, required 625 combinations of patches applied to Microsoft\u2019s Internet Information Server. Nimda, along with its contemporary, the Code Red virus, eventually compelled Microsoft to implement and market Trustworthy Computing, an initiative aimed at helping Microsoft developers learn how to write secure code.Slammer, though, hasn\u2019t followed the old pattern. A developing consensual wisdom suggests that as woeful as Microsoft\u2019s products may be, CIOs have been equally sloppy. A February poll of more than 200 IT professionals, by antivirus company Sophos, showed that 64 percent of respondents blamed their peers\u2019 lax security practices for Slammer. Only 24 percent blamed Microsoft.The poll also revealed that only 43 percent of the respondents said they subscribed to Microsoft\u2019s vulnerability mailing list, which provides early alerts of viruses in the wild. Twelve percent said they relied on "mainstream news"?newspapers and TV?to learn about new viruses. Three percent said they "don\u2019t really hear about them at all." And 19 percent said they patched software when they "got around to it.""I\u2019ve got to look around at my comrades and ask, Why aren\u2019t you patching your systems?" says Bob Ferderer, vice president of IT internal operations and security at CUNA Mutual Group, the nation\u2019s largest financial service provider for credit unions, with 5,000 employees and $9.3 billion in assets. "There\u2019s a relationship between individuals not taking action and how these things spread out of control."What frustrates Ferderer and other security experts is the fact that this seemingly intractable problem is actually quite tractable. The tools and strategies to prevent another Slammer are just waiting to be used. In fact, the number of tools and strategies available to you?and available at a reasonable cost?makes it inexcusable for any CIO to fiddle while the software burns.There is, after all, $60 billion on the table. A 2002 study by the National Institute of Standards and Technology (NIST) developed that number to describe buggy software\u2019s cost to the national economy. Improved software testing alone, NIST suggests, could shave $22 billion off that.Why can\u2019t the software community motivate itself to grab all that cash? The answer lies in software culture.Vendors, for the most part, value time-to-market over security. As long as they can get away with shipping buggy code, they will. (See "Sledgehammer," Page 64.)Developers live by deadlines, which compel them to work fast. At the same time, they\u2019re being asked to provide ever more features.And CIOs, as a group, have been passive, assuming there was little they could do to effect change.They assumed wrong. In fact, a growing number of advocates believe CIOs should be leading the charge for secure software."CIOs must take action," says Linda Northrop, director of the product-line systems program at the Software Engineering Institute (SEI) and coauthor of Software Product Lines: Practices and Patterns. "I think CIOs have done a deplorable job matching their software decisions to business goals, especially in its security and quality. What we need from the CIO ranks are leaders."Northrop could be talking about Al Schmidt, vice president of IT and CIO of $939 million Arch Chemicals. "What I\u2019ve come to realize," says Schmidt, "is that security is really about operational excellence. So why wouldn\u2019t I jump on that? I mean, operational excellence?that\u2019s what I\u2019m supposed to be doing, right?"Know Your EnemyThe vast majority of vulnerabilities in software arise from the following 10 basic development flaws.1. Unvalidated parameters: Anyone can change a URL to access data. For example, switching "admin=no" to "admin=yes" within the URL gives the hacker admin privileges.2. Broken access control: Software doesn\u2019t check a user\u2019s authorization properly, which means that credentials are cached and can be co-opted by anyone.3. Broken account and session management: Hackers can take advantage of predictable validation schemes by, for example, manufacturing or altering cookies.4. Cross-site scripting: User hits a poisoned webpage, which his browser accepts uncritically, allowing the hacker to access his machine.5. Buffer overflows: Miscreant is allowed to input so much data that memory gets junked up and starts accepting malicious commands.6. Command injection flaws: User\u2019s Web application executes malicious commands because it doesn\u2019t know any better.7. Error-handling problems: Error messages give away information?for example, "ODBC Error" signals that a SQL injection (such as the SQL Slammer) is possible.8. Insecure use of cryptography: Use of homegrown, weak cryptography is easily compromised by professional bad guys.9. Remote administration flaws: Web apps allow remote control of machines on a known port with predictable default configurations, making hacking child\u2019s play.10. Web and application server misconfiguration: Unused features that leave ports open make servers vulnerable.SEI studied 2,500 software products and 56,000 security incidents, and found the vast majority of problems are caused by those defects. Buffer overflows alone account for 40 percent to 60 percent of incidents, says CEO Steve Cross. What\u2019s more, the flaws are, from a coding perspective, simple to fix."The thing that frustrates me is people think that since the problem is so prevalent, it must be complex," says Cross. "It\u2019s not. If the public understood that any freshman computer science student knows how to fix these problems, there would be an outcry. And there should be."The trick with code defects is to find them. A million-line software program, which is about the size of the average CAD\/CAM package, comprises 20,000 pages of text. Finding errors?even in poorly written programs that will have two or so errors per page?is like finding needles in a binary haystack. And, once you do find the vulnerabilities, you have to make sure the fix doesn\u2019t break anything else.This used to provide a reasonable excuse for letting bad software practices continue. But a new class of application scanning software is emerging that makes the process of finding flaws almost trivial.How to Take Responsibility for More Secure SoftwareScan Everything...Application scanning is based on the proposition that programming errors are reasonably predictable and limited, even if their consequences are not. (See "Application Scanning Vendors and Products," Page 68, for eight top scanning tools on the market.)Once you buy (one large insurance company recently paid $120,000) and then train your developers and IT staff to use the application (which should take anywhere from two days to two weeks), plan to use it in two ways.First, make app scans a mandated part of all application audits. Whether it\u2019s internally developed code or third-party software, create a checkpoint at which an application must contain fewer than a certain number of bugs, with all egregious errors eliminated."We\u2019ve decided to push back," says Ferderer\u2019s partner, Tim Burke, IS manager at CUNA Mutual. "Any new software we\u2019re developing or having developed must go through an error-free scan before it\u2019s deployed." Second, integrate the application scanners into the development process by training your developers and mandating that outside developers scan their work at predictable intervals. (This was made easier for .Net developers last February when Microsoft integrated the application scanner from Sanctum into Visual Studio .Net.)Expect developers to freak out about that. "The first time we had one of our developers run the scan on some sample code he wrote, his eyes bugged out," says Erick Weber, vice president of enterprise information security at IndyMac Bank, which holds $9.6 billion in assets and last year earned $600 million. "He thought he wrote pretty good code, but he had created significant security holes."But it made him want to learn how to integrate the scanning into his development. That\u2019s what we want. The last thing we want is to have developers continue coding the same way, run scans on their work, and then throw the code back at them and say, Hey, fix this."...But Know Scanning\u2019s LimitationsIt would be folly to deploy app scanning and think the security problem is therefore licked. Know the limitations of these tools. First, they don\u2019t know what they don\u2019t know. That is, they scan for known vulnerabilities, the most common ones. The tools will have to evolve as vulnerabilities evolve.Second, the tools don\u2019t know whether a flaw is dire or benign.Third, some of these scanning apps just tell you where the holes in the roof are, some others put buckets under the holes, and still others even suggest how to patch the roof. But none of them actually fix anything."My concern is people buy them and think that alone fixes the problem," says Bill Guttman, director of the Sustainable Computing Consortium?a collaborative designed to protect the nation\u2019s computing infrastructure and improve the reliability of its IT systems. "It happened with antivirus [software]. Firewalls. People develop a false sense of security."The next generation of application scanners should address some of those issues. Plan for an ongoing investment in application scanning. A divisional IS officer at one of the nation\u2019s largest banks (who asked not to be named) says his company will spend $30,000 to $40,000 per quarter scanning and auditing a major application.IndyMac\u2019s Weber has no trouble justifying the cost. As an ancillary benefit, he uses the tools to convince both developers and his executive peers of the value of security. He says security is like pollution; no one cares until they can see it. "I can rattle off really great reasons we need application security to users and management," says Weber. "But they never really understand until they see, you know, eight buffer overflows, right there on their screen."Pull Rank on the Development TeamApplication scanning is a useful tool, but it\u2019s also fixing a problem 10,000 times rather than solving it once. If the 10 basic software flaws are so easy to avoid, why don\u2019t developers do so?The answer is that developers have two masters: features and deadlines. Until recently, security was not a feature. And dealing with it usually threatened a deadline. (There\u2019s an adage among developers: Speed to market, number of features, level of quality. Pick two.)"It\u2019s why we published the 10 vulnerabilities," says Mark Curphey, chairman of the Open Web Application Security Project (OWASP), an open-source project that develops Web application and Web services tools. "Developers understand the vulnerabilities technically, but they don\u2019t change how they code because of them. But when CIOs get the list, right away they understand."Bring the list to a meeting with the person in charge of application development. Each of the 10 vulnerabilities can be assigned to either the development group or the IT-operations group, or in a few cases, both."As CIO, you need to be pretty intolerant of development that doesn\u2019t address these basic issues," says Schmidt, the Arch Chemicals CIO who, as a former developer, has come to appreciate the need for a sit-down between the CIO and the head of developers. "Absolutely get talking. And bring some of the numbers on how much you save by catching bugs early. That data is out there." (See "Bug Economics," Page 62.)Give QA Some TLCThe development culture that rewards features delivered quickly also scorns quality assurance (QA). Here\u2019s how several developers view the code testing piece of QA:\n\n "Thankless."\n "Entry-level button pushing."\n "You know your career is advancing when you don\u2019t have to do testing anymore."\nIt\u2019s imperative for the CIO and the head of developers to reward developers who don\u2019t feel that way.\nAt CUNA Mutual, Ferderer has recruited top developers and trained them to write secure code. He created a mentor program in which developers bring their code to their quality mentors and together they work on securing it. Ferderer says it\u2019s early, but there\u2019s anecdotal evidence that code quality is improving.Make no mistake, forcing developers to get involved with QA puts you at the fulcrum of some wrenching cultural change in a guild whose practices are 30 years entrenched."There\u2019s a fair bit of marketing involved because, no question, it\u2019s a politically tricky situation," says the aforementioned unnamed divisional IS officer of a large bank. "No matter how you approach development, they\u2019ll resist. They\u2019ll say you\u2019re threatening their timetables. If you\u2019re a jerk about it, you end up losing and things don\u2019t get secured.""There is a delicacy to confronting development," agrees IndyMac Bank\u2019s Weber. "The application scanning tools add some objectivity. The CIO should also set development requirements and get management buy-in first. That adds more objectivity. If you clearly define the security parameters, development can\u2019t make it a personal argument or a grudge match."It\u2019s easy to see how it could devolve into politics and sniping when Weber explains what he\u2019s really doing. "My job," says Weber, "is to impose a security will on the developers."Use Freely Available Security StandardsStart with NSTISSP No. 11, the national security standard that mandates that any software used in a national security setting must pass certain government audits. Learn the criteria, and then demand that your developers and vendors meet them. (Go to www.cio.com\/bugs for the NSTISSP No. 11 standard.)The government has many other security standards. (Go to www.cio.com\/bugs for a list.) None is a defining standard but virtually every one of them contains something useful. Special Publication 800-27, a NIST document, for example, contains 33 application security principles. (One of them: Implement least-user privilege, which means start with all access turned off and turn it on only as needed, not vice versa.)It\u2019s important to note that most of the standards are foundational. That is, they\u2019re most useful for software at the design and requirements phase, and less useful for applications that have already been developed and deployed.Put Security in WritingFerderer now requires that his vendors do application scanning on every software package Mutual deploys."The trend to put security right in contracts has become quite successful," says OWASP\u2019s Curphey. "It\u2019s more common and more accepted than ever, in part because there are the tools which, to a degree, lend objectivity to the security of an application."A contract signed between General Electric and the software vendor General Magic last year excited security experts. (Go to www.cio.com\/bugs to see the full contract.) Section 7.3 is called Code Integrity Warranty, and it holds the vendor financially accountable for bad software and requires the vendor to fix it.Tick Off These To-Dos TooAfter buying the software, reeducating your developers, poring over standards and hanging out with contract attorneys, you can (if you have the energy):\n\n Check out OWASP. Weber at IndyMac Bank lifts heavily from the OWASP guidelines for secure Web application development.\n Read Winning with Software, by Watts Humphrey, and have the developers read Writing Secure Code, by Michael Howard and David LeBlanc.\n Send your developers to school. College-level computer science classes in writing secure code are starting to appear. At SEI, fellow Humphrey (called "the Edwards Deming of software") has developed an entire development methodology for secure coding called the Team Software Process (TSP). Microsoft recently put a small group of coders through TSP\u2019s intense two-week training. The group was then charged with rewriting a 24,000-line application under the TSP process. The goal was to reduce the number of defects in the program from 350 to about 22. Microsoft says a post-production defect costs it $4,200. If the company meets its goal, the total cost of post-production defects in this small application (it\u2019s an internal one) would shrink from $1,470,000 to $92,400.\nDon\u2019t Give Up, Don\u2019t Ever Give UpAsked if he was more optimistic now about security than he was four years ago, when Melissa first hit, Rich Pethia says flatly, "No."That\u2019s an unsurprising response from the director of the CERT Coordination Center, charged with disseminating early notice of serious vulnerabilities. CERT has logged over 182,000 security incidents in 14 years, 82,084 in 2002. From 1995 to 2002, CERT mapped 9,162 vulnerabilities, nearly half of them last year. So you\u2019d expect Pethia, who has briefed President George W. Bush on such matters, to be gloomy. Still, Pethia thought for a minute and then revised his stance."Actually, I am a little more optimistic," he says. "There\u2019s far more awareness. The economy is terrible, so people can\u2019t afford insecure applications. After 9\/11, there\u2019s a national sense of what these vulnerabilities mean. We\u2019re starting to put numbers on the problem and use risk assessment tools. That means insurance will soon get in the game, which is always a big step for security."Combine these factors, Pethia says, and there\u2019s a breath of hope. In fact, he\u2019s convinced that one more ingredient will validate his optimism: proactive CIOs who demand better software. So what exactly are you waiting for?