Close
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
Read Down
Sign in
Close
Welcome!Log into your account
Forgot your password?
Read Down
Password recovery
Recover your password
Close
Search
Logo
Logo
  • Latest News
  • Artificial Intelligence
  • Video
  • Big Data and Analytics
  • Cloud
  • Networking
  • Cybersecurity
  • Applications
  • IT Management
  • Storage
  • Sponsored
  • Mobile
  • Small Business
  • Development
  • Database
  • Servers
  • Android
  • Apple
  • Innovation
  • Blogs
  • PC Hardware
  • Reviews
  • Search Engines
  • Virtualization
More
    Home Cybersecurity
    • Cybersecurity
    • Development
    • IT Management
    • Networking

    Top 25 Programming Errors That Kill Network Security

    By
    Don E. Sears
    -
    March 2, 2010
    Share
    Facebook
    Twitter
    Linkedin

      eWEEK content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

      PrevNext

      1Top 25 Programming Errors That Kill Network Security

      1

      by Don Sears

      2No. 25: Race Condition
      Consequences: Denial of Service, Code Execution, Data Loss
      Ease of Detection: Moderate
      Weakness Prevalence:

      2

      MediumTraffic accidents occur when two vehicles attempt to use the exact same resource at almost exactly the same time, like the same part of the road. Race conditions in your software aren’t much different, except an attacker is consciously looking to exploit them to cause chaos or get your application to cough up something valuable. In many cases, a race condition can involve multiple processes in which the attacker has full control over one process.

      3No. 24: Use of a Broken or Risky Cryptographic Algorithm
      Consequences: Data Loss, Security Bypass
      Ease of Detection: Moderate
      Weakness Prevalence:

      3

      HighIf you are handling sensitive data or you need to protect a communication channel, you may be using cryptography to prevent attackers from reading it. You may be tempted to develop your own encryption scheme in the hopes of making it difficult for attackers to crack. This kind of grow-your-own cryptography is a welcome sight to attackers.

      4No. 23: URL Redirection to Untrusted Site (-Open Redirect’)
      Consequences: Code Execution, Data Loss, Denial of Service
      Ease of Detection: Easy
      Weakness Prevalence:

      4

      HighMany Web applications have implemented redirect features that allow attackers to specify an arbitrary URL to link to, and the Web client does this automatically. This may be another of those features that are “just the way the Web works,” but if left unchecked, it could be useful to attackers in a couple important ways. First, the victim could be automatically redirected to a malicious site that tries to attack the victim through the Web browser. Alternately, a phishing attack could be conducted, which tricks victims into visiting malicious sites that are posing as legitimate sites. Either way, an uncontrolled redirect will send your users someplace that they don’t want to go.

      5No. 22: Allocation of Resources Without Limits or Throttling
      Consequences: Denial of Service
      Ease of Detection: Moderate
      Weakness Prevalence:

      5

      HighWhile software often runs under hard limits of the system (memory, disk space, CPU), it’s not particularly polite when it uses all these resources to the exclusion of everything else. And often, only a little bit is ever expected to be allocated to any one person or task. The lack of control over resource allocation is an avenue for attackers to cause a denial of service against other users of your software, possibly the entire system. In some cases, this can be leveraged to conduct other more devastating attacks.

      6No. 21: Incorrect Permission Assignment for Critical Resource
      Consequences: Data Loss, Code Execution
      Ease of Detection: Easy
      Weakness Prevalence:

      6

      MediumIf you have critical programs, data stores or configuration files with permissions that make your resources readable or writable by the world, thats just what they’ll become. While this issue might not be considered during implementation or design, sometimes that’s where the solution needs to be applied. Leaving it up to a harried system administrator to notice and make the appropriate changes is far from optimal, and sometimes impossible.

      7No. 20: Download of Code Without Integrity Check
      Consequences: Code Execution
      Ease of Detection: Moderate
      Weakness Prevalence:

      7

      MediumMaybe you only access a download site that you trust, but attackers can perform all sorts of tricks to modify that code before it reaches you. They can hack the download site, impersonate it with DNS spoofing or cache poisoning, convince the system to redirect to a different site, or even modify the code in transit as it crosses the network. This scenario even applies to cases in which your own product downloads and installs its own updates. When this happens, your software will wind up running code that it doesn’t expect, which is bad for you but great for attackers.

      8No. 19: Missing Authentication for Critical Function
      Consequences: Bypass Security
      Ease of Detection: Moderate
      Weakness Prevalence:

      8

      CommonIn countless action movies, the villain breaks into a high-security building by crawling through heating ducts or pipes, scaling elevator shafts, or hiding under a moving cart. This works because the pathway into the building doesn’t have all those nosy security guards asking for identification. Software may expose certain critical functionality with the assumption that nobody would think of trying to do anything but break in through the front door. But attackers know how to case a joint and figure out alternate ways of getting into a system.

      9No. 18: Incorrect Calculation of Buffer Size
      Consequences: Code Execution, Denial of Service, Data Loss
      Ease of Detection: Easy to Moderate
      Weakness Prevalence:

      9

      HighIn languages such as C, where memory management is the programmer’s responsibility, there are many opportunities for error. If the programmer does not properly calculate the size of a buffer, then the buffer may be too small to contain the data that the programmer plans to write—even if the input was properly validated. Any number of problems could produce the incorrect calculation, but when all is said and done, you’re going to run headfirst into the dreaded buffer overflow.

      10No. 17: Integer Overflow or Wraparound
      Consequences: Denial of Service, Code Execution, Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      10

      CommonIn the real world, 255+1=256. However, to a computer program, sometimes 255+1=0, or 0-1=65535, or maybe 40,000+40,000=14464. You don’t have to be a math whiz to smell something fishy. Actually, this kind of behavior has been going on for decades, and there’s a perfectly rational and incredibly boring explanation. Ultimately, its buried deep in the DNA of computers, which cant count to infinity even if it sometimes feels like they take that long to complete an important task. When programmers forget that computers don’t do math like people, bad things ensue—anywhere from crashes, faulty price calculations, infinite loops and execution of code.

      11No. 16: Information Exposure Through an Error Message
      Consequences: Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      11

      HighIf you use chatty error messages, then they could disclose secrets to any attacker who dares to misuse your software. The secrets could cover a wide range of valuable data, including personally identifiable information (PII), authentication credentials and server configuration. Sometimes, they might seem like harmless secrets that are convenient for your users and administrators, such as the full installation path of your software. Even these little secrets can greatly simplify a more concerted attack that yields much bigger rewards, which is done in real-world attacks all the time. This is a concern whether you send temporary error messages back to the user or if you permanently record them in a log file.

      12No 15: Improper Check for Unusual or Exceptional Conditions
      Consequences: Denial of Service, Security Bypass, Data Loss, Code Execution
      Ease of Detection: Moderate
      Weakness Prevalence:

      12

      HighMurphy’s Law says that anything that can go wrong will go wrong. Yet it’s human nature to always believe that bad things could never happen, at least not to you. Securitywise, it pays to be cynical. If you always expect the worst, then you’ll be better prepared for attackers who seek to inflict their worst. By definition, they’re trying to use your software in ways you don’t want.

      13No. 14: Improper Validation of Array Index
      Consequences: Code Execution, Denial of Service, Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      13

      CommonIf you use untrusted inputs when calculating an index into an array, then an attacker could provide an index that is outside the boundaries of the array. If you’ve allocated an array of 100 objects or structures, and an attacker provides an index that is -23 or 978, then “unexpected behavior” is the euphemism for what happens next.

      14No. 13: Improper Control of Filename for Include/Require Statement in PHP Program (-PHP File Inclusion’)
      Consequences: Code Execution, Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      14

      CommonWhile many of the Top 25 on the list are not unique to a single programming language, here is??ía notable exception. The idea was simple enough: You can make a lot of smaller parts of a document (or program), then combine them all together into one big document (or program) by “including” or “requiring” those smaller pieces. This is a common enough way to build programs. Combine this with the common tendency to allow attackers to influence the location of the document (or program)—perhaps even on an attacker-controlled Website, if you’re unlucky enough—then suddenly the attacker can read any document (or run any program) on your Web server. This feature has been removed or significantly limited in later versions of PHP, but despite the evidence that everything changes on the Internet every two years, code is forever.

      15No 12: Buffer Access with Incorrect Length Value
      Consequences: Code Execution, Denial of Service, Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      15

      CommonA popular insult is: “Take a long walk off a short pier.” One programming equivalent for this insult is to access memory buffers using an incorrect length value. Whether you’re reading or writing data as you march down that pier, once you’ve passed the boundaries of the buffer, you’ll wind up in deep water.

      16No. 11: Use of Hard-Coded Credentials
      Consequences: Security Bypass
      Ease of Detection: Moderate
      Weakness Prevalence:

      16

      MediumHard-coding a secret password or cryptographic key into your program is bad manners, even though it makes it extremely convenient—for skilled reverse engineers. While it might shrink your testing and support budgets, it can reduce the security of your customers to dust. If the password is the same across all your software, then every customer becomes vulnerable if (rather, when) your password becomes known. Because it’s hard-coded, it’s usually a huge pain for system administrators to fix.

      17No. 10: Missing Encryption of Sensitive Data
      Consequences: Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      17

      HighWhenever sensitive data is being stored or transmitted anywhere outside of your control, attackers may be looking for ways to get to it. Thieves could be anywhere—sniffing your packets, reading your databases and sifting through your file systems. If your software sends sensitive information across a network, such as private data or authentication credentials, that information crosses many different nodes in transit to its final destination. Attackers can sniff this data right off the wire, and it doesn’t require a lot of effort. All they need to do is control one node along the path to the final destination, control any node within the same networks of those transit nodes, or plug into an available interface.

      18No. 9: Improper Sanitization of Special Elements Used in an OS Command (OS Command Injection)
      Consequences: Code Execution
      Ease of Detection: Easy
      Weakness Prevalence:

      18

      MediumYour software is often the bridge between an outsider on the network and the internals of your operating system. When you invoke another program on the operating system, but you allow untrusted inputs to be fed into the command string that you generate for executing that program, then you are inviting attackers to cross that bridge into a land of riches by executing their own commands instead of yours.

      19No. 8: Unrestricted Upload of File with Dangerous Type
      Consequences: Code Execution
      Ease of Detection: Moderate
      Weakness Prevalence:

      19

      CommonYou may think you’re allowing uploads of innocent images (rather, images that won’t damage your system—the Interweb’s not so innocent in some places). But the name of the uploaded file could contain a dangerous extension such as .php instead of .gif, or other information (such as content type) may cause your server to treat the image like a big honkin’ program. So, instead of seeing the latest paparazzi shot of your favorite Hollywood celebrity in a compromising position, you’ll be the one whose server gets compromised.

      20No. 7: Improper Limitation of a Pathname to a Restricted Directory (Path Traversal)
      Consequences: Code Execution, Data Loss, Denial of Service
      Ease of Detection: Easy
      Weakness Prevalence:

      20

      WidespreadWhile data is often exchanged using files, sometimes you don’t intend to expose every file on your system while doing so. When you use an outsider’s input while constructing a filename, the resulting path could point outside of the intended directory. An attacker could combine multiple “..” or similar sequences to cause the operating system to navigate out of the restricted directory and into the rest of the system.

      21No. 6: Reliance on Untrusted Inputs in a Security Decision
      Consequences: Security Bypass
      Ease of Detection: Moderate
      Weakness Prevalence:

      21

      HighIn countries where there is a minimum age for purchasing alcohol, the bartender is typically expected to verify the purchaser’s age by checking a driver’s license or other legally acceptable proof of age. But if somebody looks old enough to drink, then the bartender may skip checking the license altogether. This is a good thing for underage customers who happen to look older. Driver’s licenses may require close scrutiny to identify fake licenses, or to determine if a person is using someone else’s license. Software developers often rely on untrusted inputs in the same way, and when these inputs are used to decide whether to grant access to restricted resources, trouble is just around the corner.

      22No. 5: Improper Access Control (Authorization)
      Consequences: Security Bypass
      Ease of Detection: Moderate
      Weakness Prevalence:

      22

      HighSuppose you’re hosting a house party for a few close friends and their guests. You invite everyone into your living room, but while you’re catching up with one of your friends, one of the guests raids your fridge, peeks into your medicine cabinet and ponders what you’ve hidden in the nightstand next to your bed. Software faces similar authorization problems that could lead to more dire consequences. If you don’t ensure that your software’s users are only doing what they’re allowed to, then attackers will try to exploit your improper authorization and exercise unauthorized functionality that you only intended for restricted users.

      23No. 4: Cross-Site Request Forgery (CSRF)
      Consequences: Data Loss, Code Execution
      Ease of Detection: Moderate
      Weakness Prevalence:

      23

      HighYou know better than to accept a package from a stranger at the airport. It could contain dangerous contents. Plus, if anything goes wrong, then it’s going to look as if you did it because you’re the one with the package when you board the plane. Cross-site request forgery is like that strange package, except the attacker tricks a user into activating a request that goes to your site. Thanks to scripting and the way the Web works in general, the user might not even be aware that the request is being sent. But once the request gets to your server, it looks as if it came from the user, not the attacker. This might not seem like a big deal, but the attacker has essentially masqueraded as a legitimate user and gained all the potential access that the user has.

      24No. 3: Buffer Copy Without Checking Size of Input (Classic Buffer Overflow)
      Consequences: Code Execution, Denial of Service, Data Loss
      Ease of Detection: Easy
      Weakness Prevalence:

      24

      HighBuffer overflows are Mother Nature’s little reminder of that law of physics that says: If you try to put more stuff into a container than it can hold, you’re going to make a mess. The scourge of C applications for decades, buffer overflows have been remarkably resistant to elimination. However, copying an untrusted input without checking the size of that input is the simplest error to make in a time when there are much more interesting mistakes to avoid. That’s why this type of buffer overflow is often referred to as “classic.” It’s decades old, and it’s typically one of the first things you learn about in Secure Programming 101.

      25No. 2: Improper Sanitization of Special Elements Used in an SQL Command (SQL Injection)
      Consequences: Data Loss, Security Bypass
      Ease of Detection: Easy
      Weakness Prevalence:

      25

      HighThese days, it seems as if software is all about the data: getting it into the database, pulling it from the database, massaging it into information, and sending it elsewhere for fun and profit. If attackers can influence the SQL that you use to communicate with your database, then suddenly all your fun and profit belongs to them. If you use SQL queries in security controls such as authentication, attackers could alter the logic of those queries to bypass security. They could modify the queries to steal, corrupt or otherwise change your underlying data. They’ll even steal data one byte at a time if they have to, and they have the patience and know-how to do so.

      PrevNext

      Get the Free Newsletter!

      Subscribe to Daily Tech Insider for top news, trends & analysis

      MOST POPULAR ARTICLES

      Artificial Intelligence

      9 Best AI 3D Generators You Need...

      Sam Rinko - June 25, 2024 0
      AI 3D Generators are powerful tools for many different industries. Discover the best AI 3D Generators, and learn which is best for your specific use case.
      Read more
      Cloud

      RingCentral Expands Its Collaboration Platform

      Zeus Kerravala - November 22, 2023 0
      RingCentral adds AI-enabled contact center and hybrid event products to its suite of collaboration services.
      Read more
      Artificial Intelligence

      8 Best AI Data Analytics Software &...

      Aminu Abdullahi - January 18, 2024 0
      Learn the top AI data analytics software to use. Compare AI data analytics solutions & features to make the best choice for your business.
      Read more
      Latest News

      Zeus Kerravala on Networking: Multicloud, 5G, and...

      James Maguire - December 16, 2022 0
      I spoke with Zeus Kerravala, industry analyst at ZK Research, about the rapid changes in enterprise networking, as tech advances and digital transformation prompt...
      Read more
      Video

      Datadog President Amit Agarwal on Trends in...

      James Maguire - November 11, 2022 0
      I spoke with Amit Agarwal, President of Datadog, about infrastructure observability, from current trends to key challenges to the future of this rapidly growing...
      Read more
      Logo

      eWeek has the latest technology news and analysis, buying guides, and product reviews for IT professionals and technology buyers. The site’s focus is on innovative solutions and covering in-depth technical content. eWeek stays on the cutting edge of technology news and IT trends through interviews and expert analysis. Gain insight from top innovators and thought leaders in the fields of IT, business, enterprise software, startups, and more.

      Facebook
      Linkedin
      RSS
      Twitter
      Youtube

      Advertisers

      Advertise with TechnologyAdvice on eWeek and our other IT-focused platforms.

      Advertise with Us

      Menu

      • About eWeek
      • Subscribe to our Newsletter
      • Latest News

      Our Brands

      • Privacy Policy
      • Terms
      • About
      • Contact
      • Advertise
      • Sitemap
      • California – Do Not Sell My Information

      Property of TechnologyAdvice.
      © 2024 TechnologyAdvice. All Rights Reserved

      Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.

      ×