{"id":7553,"date":"2014-02-11T10:30:19","date_gmt":"2014-02-11T16:30:19","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/blog\/?p=7553"},"modified":"2023-03-13T16:07:01","modified_gmt":"2023-03-13T21:07:01","slug":"7-critical-security-tips-for-modern-web-development","status":"publish","type":"post","link":"https:\/\/www.mrc-productivity.com\/blog\/2014\/02\/7-critical-security-tips-for-modern-web-development\/","title":{"rendered":"7 critical security tips for modern web development"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-725\" src=\"https:\/\/www.mrc-productivity.com\/blog\/wp-content\/uploads\/2010\/11\/Education.jpg\" alt=\"Education\" width=\"76\" height=\"100\" \/>Modern developers are caught between a rock and a hard place. On one hand, businesses are requiring faster application delivery from their development staff. As software plays an increasingly important role in the modern business, developers regularly face impossible deadlines.<\/p>\n<p>On the other hand, web application development is becoming more complex. For instance, as outlined in <a href=\"https:\/\/www.mrc-productivity.com\/blog\/2013\/10\/5-new-realities-that-developers-must-learn-to-accept\/\" target=\"_blank\" rel=\"noopener\"><span style=\"color: red; font-weight: bold;\">this article<\/span><\/a>, modern developers must create applications that adapt to any device, port to any platform, integrate with other services, and withstand increasingly sophisticated attacks. Whew!<\/p>\n<p><strong>The big problem<\/strong>: With these changing requirements and growing demands for faster development, developers struggle to keep up. Certain development aspects are bound to fall through the cracks.<\/p>\n<p>As it turns out, that is exactly what\u2019s happening&#8230;with security. Despite the growing importance of proper security, many developers aren\u2019t following basic security principles. How bad is it? According to <span style=\"color: red; font-weight: bold;\">this study<\/span> from last year, 99% of applications have one or more serious vulnerabilities.<\/p>\n<p>Today, let\u2019s examine this problem. While I know we can\u2019t address every security mistake developers make, we can highlight the most important principles. What basic security guidelines should every modern web developer follow? How can you protect your web applications from being easy targets for an attack? While the list could be much larger, I\u2019ve rounded up 7 of the most important security tips every developer must follow, and listed them below:<br \/>\n<a name=\"20140210\"><\/a><!--more--><\/p>\n<h3>1. Understand what data you need to protect<\/h3>\n<p>One of the most important security principles a developer can practice: Only store the data you absolutely NEED to store. This starts with two questions: First, what data does your company need to store and protect? Second, if that data was compromised, how much could it harm the company or your customers?<\/p>\n<p>For example, some companies put themselves (and their customers) at risk because they needlessly store sensitive customer data. Do you really need to store credit card numbers, addresses, or other sensitive information? Reducing the amount of sensitive data stored instantly makes your applications more secure.<\/p>\n<h3>2. Encrypt sensitive user data<\/h3>\n<p>What happens if you absolutely must store sensitive data in your database? If so, never store anything unencrypted. Ignoring this advice will likely land your company on the front page of the news&#8211;but not for good reasons. Do you really want to be the company that loses your customer\u2019s sensitive data because it was all stored in plain text in your database?<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>\u201cEncrypting sensitive user data, such as passwords, with one-way encryption &#8212; In case your server ever gets hacked, you want to make sure that no one gets hold of secure data,\u201d explains Alex Zorach, Founder and Editor of <a href=\"https:\/\/www.RateTea.com\" target=\"_blank\" rel=\"noopener\"><span style=\"color: red; font-weight: bold;\">RateTea.com<\/span><\/a>. \u201cIn larger organizations or shared hosting environments, this becomes even more important because you may not be able to trust everyone with access to the data not to exploit user data.\u201d<\/p><\/blockquote>\n<h3>3. Keep software updated (or disabled)<\/h3>\n<p>Hackers look for the path of least resistance when trying to access your database. In many cases, this involves finding outdated or insecure software and working from there. To minimize this risk, you must follow two important guidelines. First&#8211;as explained below&#8211;you must rigorously patch and update your software.<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>&#8220;In web applications, similar to any other modern software, there are a large number of third party libraries used,&#8221; says Ehsan Foroughi, Director of Research of <a href=\"https:\/\/securitycompass.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"color: red; font-weight: bold;\">Security Compass<\/span><\/a>. &#8220;An example is usage of OpenSSL library to facilitate HTTPS communication, or LDAP libraries to provide Single Sign-On support. Many of these libraries\/packages are open source. Regardless, there are vulnerabilities discovered every day in these libraries, such as failure to properly validate input elements, or special boundary cases that can be exploited to gain privileged access to the server by remote users. The detail of these vulnerabilities gets published online and attackers start looking for software that use these libraries, either based on signs or by blindly testing against these weaknesses. The recommended best practice is to monitor common sources of vulnerability disclosures, such as the SecurityFocus email list and portal, and once there is a vulnerability disclosed and the patch becomes available, apply the patch to your environment as soon as possible. In rare cases where the patch is not immediately available, there might be other mitigation factors suggested by the vendor of the specified third party software.\u201d<\/p><\/blockquote>\n<p>Secondly, you must disable unused software. It&#8217;s not uncommon for companies to have software connected to their systems that&#8217;s not in use. As explained below, this provides an excellent path for hackers if left unchecked.<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>\u201cMany web hosting packages come with software enabled that is not used by the developer,\u201d says Zorach. \u201cEvery service or piece of software installed or running on your server introduces an additional piece of software that can potentially be hacked. Common examples include Plesk or mail servers. By disabling or removing anything that you are not using, you decrease your risk of getting hacked.\u201d<\/p><\/blockquote>\n<h3>4. Limit user privileges<\/h3>\n<p>Sometimes, the biggest threat to your data isn\u2019t an outside attacker at all. It\u2019s an uneducated end user with too many system privileges. Limiting these privileges is best for all involved&#8211;it helps keep your applications secure while eliminating the risk of security mistakes from end users.<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>&#8220;In a web application or within a business&#8217;s IT systems, it&#8217;s a good idea to give each user only the privileges he or she really needs as opposed to giving everyone the same level of access,&#8221; explains Jason Swett, IT Consultant at <a href=\"https:\/\/www.benfranklinlabs.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"color: red; font-weight: bold;\">Ben Franklin Labs<\/span><\/a>. &#8220;This is called the Principle of Least Privilege. In addition to the obvious benefit of protecting the system from abuse by unqualified users, application of the Principle of Least Privilege also protects unprivileged users of accusation when an abuse occurs, since a properly privileged system makes it physically impossible for users to carry out tasks they&#8217;re not authorized to perform.&#8221;<\/p><\/blockquote>\n<h3>5. Use both client-side and server-side validation<\/h3>\n<p>When accepting user input from a web application into your database, you must perform two forms of validation: Client-side and server-side. Client-side validation (using JavaScript) protects against user error, like incorrectly entering data or forgetting a field. Server-side validation protects against malicious input, like users trying to inject their own code into your database. The problems arise when developers make the mistake of using client-side validation as a security measure.<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>&#8220;Validating user input on the client side with JavaScript is a convenient way to give the user instant feedback, but server-side checking is still necessary for security,&#8221; explains Swett. &#8220;A user with malicious intent can bypass your client-side validation by either turning JavaScript off or manipulating your JavaScript code however he or she pleases. Since everything on the client side is manipulable, everything coming from the client side must be treated with suspicion. Client-side validation can provide an improved user experience but not meaningfully improved security.&#8221;<\/p><\/blockquote>\n<h3>6. Sanitize user input<\/h3>\n<p>It should go without saying, but user input from a web application should never communicate directly with the database. It must be validated and sanitized to maintain data integrity, and avoid common attacks like SQL injection.<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>\u201cUser input &#8211; from forms, querystrings, and even cookies or other non-visible sources &#8211; are the number one vulnerability that lead to web applications being compromised,\u201d says Jonathan Weber, Founder of <a href=\"https:\/\/www.marathon-studios.com\/\" target=\"_blank\" rel=\"noopener\"><span style=\"color: red; font-weight: bold;\">Marathon Studios, Inc<\/span><\/a>. \u201cAs a security-conscious developer, you have to understand the threats that can be posed by unsanitized input (such as SQL injection, XSS attacks) and make sure you make it an automatic habit to sanitize every input to your web apps. All it takes is one missed input to open a back-door for hackers to compromise your application.\u201d<\/p><\/blockquote>\n<h3>7. Secure all connections that contain cookie data<\/h3>\n<p>The common practice of \u201csession hijacking\u201d often occurs because only the login system of the application is secured&#8211;not the entire application. As a result, hackers can simply steal a user\u2019s session ID, and gain complete access. As you might imagine, the results of this mistake can be disastrous.<\/p>\n<blockquote style=\"line-height: 1.7em; background-image: none; margin-left: 0; padding-left: 18px; height: auto;\"><p>\u201cOne important, but sometimes overlooked security issue (even for bigger players like Facebook) is securing *all* connections that contain cookie data,\u201d says Tim Henrich, Founder of <span style=\"color: red; font-weight: bold;\">Task Science<\/span>. \u201cMany web applications will secure their login system, set a cookie, and then allow the user to continue interacting with the application over an insecure channel. While this can improve performance and save system resources on the server-side, the cookie sent with each request (to identify the user&#8217;s session) is now vulnerable. Anyone with network access to the many networks that user&#8217;s request will traverse can imitate that user within the web application.\u201d<\/p><\/blockquote>\n<p>So, what do you think? Did I leave anything off of that list? Feel free to share your thoughts in the comments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Modern developers are caught between a rock and a hard place. On one hand, businesses are requiring faster application delivery from their development staff. As software plays an increasingly important role in the modern business, developers regularly face impossible deadlines. On the other hand, web application development is becoming more complex. For instance, as outlined &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.mrc-productivity.com\/blog\/2014\/02\/7-critical-security-tips-for-modern-web-development\/\"> <span class=\"screen-reader-text\">7 critical security tips for modern web development<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","slim_seo":{"title":"7 critical security tips for modern web development - mrc&#039;s Cup of Joe Blog","description":"Modern developers are caught between a rock and a hard place. On one hand, businesses are requiring faster application delivery from their development staff. As"},"footnotes":""},"categories":[8],"tags":[71],"class_list":["post-7553","post","type-post","status-publish","format-standard","hentry","category-education","tag-security"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/posts\/7553","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/comments?post=7553"}],"version-history":[{"count":22,"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/posts\/7553\/revisions"}],"predecessor-version":[{"id":14664,"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/posts\/7553\/revisions\/14664"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/media?parent=7553"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/categories?post=7553"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/blog\/wp-json\/wp\/v2\/tags?post=7553"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}