Security Best Practice - Host Naming and URL Conventions : Whitepapers : Home | ||
![]() ![]() |
Security Best Practice - Host Naming and URL Conventions Security Considerations for Web-based Applications From an attacker’s perspective, the method by which an organisation names their Internet visible hosts or references web-application URL’s can often be abused to make for a more successful attack. Due to a lack of insight or understanding of current attack vectors, many organisations are failing to follow best security practices in their host naming and linking conventions – thereby unwittingly aiding their attackers. In the last 5 years, organisations have seen a phenomenal year-on-year increase in the number and sophistication of the vectors used by malicious attackers to target their customers or clients. Ranging from social engineering through to URL obfuscation and domain hijacking, attackers are abusing poorly thought out and implemented host naming and URL referencing conventions. For example, attacks such as Phishing often make use of confusing host names to dupe customers by directing them to web applications designed to impersonate a legitimate site – once the customer hits the fake site their authentication credentials are recorded for later use in financial fraud or identity theft. In addition, many organisations who have developed web-based applications to service the requirements of their customers have given negligible thought to the increasing sophistication and length of URL’s being used, and how confusing these can be to their customers. Consequently, it has become easier for attackers to disguise their attack within a URL – making it increasingly difficult for customers or third-party tools to detect any embedded malicious payloads. By following a few simple best practices, organisations can easily strengthen the security of their environments against many of these attacks and make it much more difficult for an attacker to confuse customers or clients. Understanding the ThreatAttackers have an ever increasing number of vectors in which they can manipulate poorly thought-out and implemented online services. The consequences of this ranges from the erosion of customer confidence in the online offering, through to the manipulation and eventual compromise of the hosting environment. To understand the necessity of improving the processes in which an organisation selects host names for their Internet services or references URL’s within a web-based application, a study of key threats and the attack vectors that abuse them is required. This section focuses upon the techniques currently used by attackers to construct their attack. Which Threats?Depending upon an attacker’s motivation and the sophistication of the online service, there are a large number of threats which an organisation may be exposed to. However, by focusing upon the threats that can make use of poorly implemented host naming procedures or web-application URL referencing, the number becomes more manageable. Threats that traditionally make use of poor host naming and URL referencing include:
The Attackers ArmouryMost attackers, whether they are malicious users or professional criminals, have a bag of ‘tricks’ from which they construct their attack. Many common attack vectors initially depend upon the manipulation of the host name and/or application URL to deceive the customer in order to be successful. To conduct an attack comprised of any of the threats previously discussed, the attacker has a finite pool of techniques and vectors that he can use. The most important and successful techniques are:
Registration of Similarly Named DomainsIt is a simple process for an attacker to register a domain name through any international domain registrar. Consequently there are many routes and opportunities for third parties to register domain names that may infringe upon an organisation’s trademark or be used to trick customers into believing that they have reached a legitimate host.
This problem is compounded by the fact that many organisations also register a myriad of top level domains themselves, and then use them inconsistently when interacting with their customers. Due to this, it is almost impossible for a customer to differentiate between a ‘new’ legitimate domain (and the message using it) and one created by a malicious attacker. Manipulation of Complex URLsDue to poor application development processes and an over-reliance on third-party suite integration tools, organisations increasingly find themselves implementing long and complex URL’s in order to provide access to specific components of their online service. Their customers are subsequently barraged with undecipherable URL’s and links. Consequently, these customers are unlikely and often unable to identify URL’s that may contain an attacker’s malicious code.
Note how much of the URL is not actually visible within the browser window. Applications that make use of similarly long and complex URL’s make for excellent attack delivery platforms since much of the payload can be hidden from view. Session InformationThe use of URL’s that contain SessionID information can help an attacker carryout a number of sophisticated attacks – ranging from brute-forcing of access controls through to preset session hijacking. For many poorly constructed applications, if an attacker creates their own unique SessionID and passes the URL on to unsuspecting customers, they may be able to hijack a customer’s account after they have successfully authenticated themselves using the attackers SessionID (this attack is commonly referred to as a ‘Preset Session Attack’).
Third-party Shortened URL’sDue to the length and complexity of many web-based application URLs – combined with the way URL’s may be represented and displayed within various email systems (e.g. extra spaces and line feeds may be inadvertently inserted into the URL) – numerous third-party organisations have sprung up offering free services designed to provide shorter and more memorable URL’s. The most popular web sites providing this functionality for free are http://smallurl.com and http://tinyurl.com.
The attacker could easily create a fake web site at a URL such as http://www.attackersite.com/fake/mybank/support and register it as http://tinyurl.com/4outd Best PracticesThe secret to protecting against all of the threats and attack vectors explained in the previous section is by adopting a robust and comprehensive defence-in-depth posture. While there are no ‘silver bullets’ in information security, the inclusion of well thought out and implemented best practices can significantly contribute to an organisations ability to thwart many aspects of these attacks. In many cases, it is often the adoption of the simplest and most basic security best practices that have the greatest impact in helping to secure an organisation and the multiple Internet-based services it offers. Domain Names and Host ServicesAll organisations with an Internet presence will have registered a domain name and are likely to own a number of very similar domain names. For the majority of web-based applications, the selected domain name forms an integral part of the online offering – providing information about the business unit or service being accessed by the customer, or the particular application sub-component being referenced. Care should be taken when considering how domain names are to be used when delivering host services. Regardless of any particular attack vector, most customers are non-technical and are easily overwhelmed with the long and complex information presented in “follow this link” URLs. Best practices in domain naming and host service referencing include:
Use the Same Top-Level DomainThere has been a trend for organisations to register unique domains (or to direct multiple domain permutations on a theme to a single ‘approved’ new domain) for each new service the organisation creates. The result is an ever increasing menagerie of custom domains and loosely associated URL’s which customers are required to trust in order to access new services. Consequently, an attacker who chooses to register and use a similarly sounding or affiliated domain name can easily deceive customers. To prevent this abuse, it is important that customers can always gain access to services (new or existing) through a well known and trusted domain. Wherever possible, organisations should always use the same top-level domain for all Internet applications. The following table provides some best practice examples.
Redirect Regional DomainsFor organisations with an international presence, or those just wishing to safeguard certain country-specific domains, it is recommended that any registered regional domains are redirected to easily identifiable links from the root domain. In this way customers attempting to access any regional domain (e.g. www.mybank.co.za) would be automatically redirected to a single root domain (e.g. www.mybank.com) which would provide appropriate information or redirection to the country specific customer service. This process not only aids security, but also helps to promote a scalable environment capable of managing global load-balancing. The following table provides some best practice examples.
Representative NamingIt is recommended that host names be representative of the web-based application or service offered to the customer, and that it be clear or easily identifiable. This means that, instead of registering complex domains that include the service and organisations name (e.g. CustomerPlus-mybank.com), the root domain should be used and provide an appropriate URL instead (e.g. www.mybank.com/customerplus). Additionally, when using secure services (such as SSL-based HTTPS), it is generally recommended that this added protection service be reflected in the host name. For instance, instead of referring to the standard host over HTTPS (e.g. https://www.mybank.com) the organisation should redirect customers to the dedicated secure host (e.g. https://secure.mybank.com). Similarly, double-barrelled domains that reflect additional security mechanisms (e.g. www.secure-mybank.com) should instead be replaced with an appropriate host name which is part of the same root domain (e.g. secure.mybank.com). The following table provides some best practice examples.
Simple URL Paths and Host NamesTo prevent unnecessary confusion for customers or clients, the shortest and least complex combination of host name and URL should be used. Time and effort should be made when building an online web-application to ensure that each customer service can be referenced through a shortened URL. When selecting a host name, ensure that the name reflects the key aspects of the service. The following table provides some best practice examples.
Avoid Host NumberingOrganisations should use an appropriate mix of address translation and load-balancing technologies to prevent sequentially numbered hosts being visible on the Internet. Failure to do so will not only cause confusion to customers, but also aid potential attackers in their discovery of additional insecure hosts that could be individually targeted for later abuse. The following table provides a best practice example.
URL ReferencingLinked closely with domain names and host services, the URL’s used within a web-based application must similarly be handled with care. To defend against many of the most malicious application-focused threats, organisations must review how URL’s are used to navigate and access application functionality. Through a careful combination of application design and use of appropriate host naming conventions, URL complexity can be markedly reduced – thereby reducing the window of opportunity for an attacker. Best security practices in URL referencing for web-based applications include:
Small URL’s are BestLong URL’s introduce unnecessary complexity to a customer’s experience of the web-application as well as introducing numerous vectors for attack (of both the client and server). While traditional development techniques have made extensive use of the HTTP GET request, all this functionality can be easily migrated to HTTP POST requests instead. In addition to reducing the complexity of the URL’s presented to the customer, this modification makes it more difficult for attackers to conduct certain attacks (such as Phishing, cross-site scripting and SQL injection). Organisations should only use URL’s to direct customers to key application components or services – ideally binding all environment details to their unique SessionID (e.g. customer identity, application preferences, etc.). All other details and data submissions can be handled through the use of HTTP POST requests through HTML forms. A combination of HTML forms and client-side scripting can enable any possible request that would traditionally be managed through HTTP GET requests alone. With foresight, it is possible to develop applications that make use of short and very simple URL’s. An advantage to this process is that the URL’s become more memorable to the customer – consequently becoming easily transportable between systems, and easy for the customer to detect any obfuscated attacks. Application developers should strive to remove any reliance on individual page references, and instead use a well designed and implemented session management solution. The following table provides some best practice examples.
Developers should ensure that the application is configured in such a way that it is not possible for an attacker to successfully submit HTTP POST data through an alternative carefully designed URL. However, it is important to note that the use of HTTP POST by itself does not provide a robust security mechanism for protection against all types of data manipulation – but it does provide some protection against the threats previously discussed. Through the use of personal proxies and other hacking tools, an attacker can easily manipulate data sent via the POST method. Remove Session Information from URL’sSession information must never be stored or referenced directly through the applications URL. Instead, application developers must use session cookies (i.e. cookies which are temporarily recorded in the client browsers dynamic memory and are automatically purged when the browser is closed) to temporarily store SessionID information and use them instead for access control or application tracking. If application SessionID’s must be passed to the application (or associated/affiliated sites) it can be achieved through a combination of client-side scripting and the HTTP POST command. For example, instead of using the following HTTP GET request:
Application developers should use the more secure and robust HTTP POST method to make application requests. For example, the code behind the customer’s page request may look like:
Which could result in the following HTTP POST from the client browser:
|
|