Skip to main content

OWASP Top 10 Security Threats

The Open Worldwide Application Security Project (OWASP) is an online community that produces freely available articles, methodologies, documentation, tools, and technologies in the fields of IoT, system software and web application security (Wikipedia). In this post, I want to share the top 10 security threats published by OWASP. The list is regularly updated by OWASP, the following list is based on 2021 publication.


Broken Access Control

This security issue can be caused by many things such as violation of the least privilege principle, unprotected API endpoints, use of unique identifiers without permission checking, and so on. There are several threats related to broken access control.

  • Insecure Direct Object Reference. It happens when an application provides direct access to objects based on user-supplied input. For example, after submitting a form, the endpoint returns an ID of the object being submitted while with that ID, a user can access the information of the object directly.
  • Insecure Session Management. It happens when an application fails to properly secure and manage user sessions. This can be caused by weak session token generation, improper session storage or transmission mechanism, and lack of session timeouts or termination mechanisms. This can result in a data breach, unauthorized access, or other malicious activities utilizing the compromised session.
  • Cross-Site Request Forgery (CSRF). In a CSRF attack, the attacker tricks the user into performing actions on a site they are already authenticated on, without the user’s knowledge or consent. The attack is executed by exploiting the web application’s failure to properly validate the source of incoming requests. It typically involves crafting malicious links, embedding them in seemingly innocuous content such as emails or web pages, and then enticing the user to click on those links.
  • Security Misconfiguration. This can happen on any layer of the application stack. For example, some tools or platforms do not provide built-in authentication by default, leaving the responsibility of implementation to developers. Such a case allows unrestricted access by default, making sensitive information vulnerable to unauthorized access by attackers.

Cryptographic Failure

This issue can be caused by a lot of factors such as outdated algorithms, insufficient key length, improper key management, or weak random number generation. There are a few common issues related to cryptographic failure.

  • Insecure Randomness. It is related to a weak random number generator that is used in generating any kind of token or key that results in a predictable token or key.
  • Deprecated Hash Function. It is considered an outdated or insecure cryptographic algorithm due to advances in technology or the discovery of vulnerabilities.

Injection

Injection attacks are a type of cyber-attack where an attacker submits malicious data to a web application, which in turn gets executed or processed by the application. Vulnerability of this attack can exist when the system accepts input from the user without proper sanitization or accepts dynamic queries without valid escaping. Common types of injection are as follows.

  • SQL Injection. This can be prevented by input validation and the use of parameterized queries.
  • OS Command Injection. It is an attack in which the goal is the execution of arbitrary commands on the host operating system via a vulnerable application. Some web applications may execute or call OS commands or tools in the backend service for certain purposes like editing images, converting videos, gathering certain metrics, etc.
  • LDAP Injection. LDAP is commonly used for authentication, authorization, and user management purposes. This injection is a type of security vulnerability that occurs when an attacker can manipulate LDAP queries sent by a web application.

Insecure Design

It is different from implementation defects where a secure design may have insecure implementation. One of the factors that contribute to insecure design is the lack of business risk profiling inherent in the software or system being developed. A few examples of insecure design are as follows.

  • Insufficient input validation
  • Insecure data storage
  • Weak authentication and session management
  • Insecure communication
  • Misconfigured security settings

To help us create a secure design, threat modelling becomes necessary. The approach for threat modelling can be based on asset, system design, attacker perspective, or list (assessment checklist). In general, there are several steps we can run.

  • Identify all assets in the system
  • Create a model that explains the architecture, components, and data flow.
  • Identify possible threats to the identified assets
  • Define the risks based on the likelihood and impacts of the threats
  • Define the mitigation plan

Related to threat modeling, the list-centric approach can have some benefits such as simplicity, standardized procedures, or coverage. But, it may lack at some point to handle context-related issues of the system. So, it is good to use a list-centric approach along with other approaches.

There is a standard developed by OWASP to help us assess our system which is named ASVS (Application Security Verification Standard). We can see the details and download the document HERE.

Moreover, suppose we want to be better at mapping the threats and mitigation actions. In that case, we can design an RTM (Requirement Traceability Matrix) that lists all functions in the system, possible threats and attack scenarios, and mitigation. For defining threats, we can use the STRIDE methodology that categorizes threats into common types which are spoofing, tampering, repudiation, information disclosure, denial of service, and elevation of privilege.


Security Misconfiguration

Any framework or tool used in our web application may be shipped with some security-related configuration. This configuration, if it is not managed well, can pose certain vulnerabilities in our web application. Some factors lead to security misconfiguration.

  • Default Configuration. In most software or tools, the default configuration is provided to ease the usage of the tools at the starting point or to keep the process lightweight in the first place. The default configuration issue can be in the form of default credentials, insecure communication protocol, unprotected resources, insecure or outdated encryption algorithms, unused features or services, etc.
  • Insecure Settings. An application can have some security-related settings such as access control settings, information visibility, authentication methods, etc. Improper settings can pose risks to the user or the system itself like unauthorized access, data breaches, data tampering, and so on.
  • Outdated Software & Libraries. Using outdated software can pose some risks like security vulnerabilities, incompatibility issues, limited support, and compliance issues.

Vulnerable and Outdated Components

Component is anything that is part of the application. It can be a module, library, API, etc. If we don't monitor and regularly verify the security of components in our application, the application might have vulnerabilities and pose some threats. OWASP provides tools to help us identify all components in our application and analyse the risks.

  • CycloneDX. This tool is used to generate Software Bill of Materials (SBOM) or details of components that construct our application. It supports a variety of programming platforms like Java, Node.js, PHP, etc. To get the tool, we can visit the CycloneDX GitHub page.
  • OWASP Dependency Track. This tool is used to analyse the risks of your application based on details in the BOM. So, typically we should generate BOM using tools like CyclonDX first then provide the result to this tool to be analysed. Installation and usage guides are available on its website.

Identification and Authentication Failure

This condition can be caused by many factors such as allowing user to use a weak password, no rate limiting feature in the login endpoint, insecure credentials storage, etc. There are some threats related to identification and authentication failure.

  • Brute Force. In this attack, all combinations of username and password are checked. But, it becomes impractical when the number of characters in the credentials is quite long.
  • Dictionary Attack. It is a kind of brute force attack that leverages a list of common credentials used by people.

Another reason for this failure is the use of insecure comments. Comments in a program source code should be regularly reviewed to prevent accidental sensitive data exposure like login details or information about the system that can be leveraged by adversaries to craft the attack.


Software and Data Integrity Failure

This happens when the application developer doesn't well monitor the integrity of the software like allowing insecure software patches, use of unverified third-party libraries, or applying insecure CI/CD pipelines.

  • Insecure Object Deserialization. Serialization is commonly used to stream an object from one machine to another or to store the object in storage for later use. When performing deserialization to retrieve the object back, it is important to perform validation before executing anything contained in the object. This can lead to types of attacks like remote code execution, injection, or denial of service by making the system crash.
  • Rogue CDN or Untrusted Sources. It is discouraged to utilize tools or libraries provided by untrusted sources in our application. It can be like self-XSS. This can lead to issues related to privacy, availability, or data integrity.

Security Logging And Monitoring Failure

The indications of this failure are such as no log for failed login, no error log generated by the errors that happen in the application, no log for suspicious activities, no alert generated from a security incident, and so on. There are disadvantages if we don't implement a proper logging and monitoring system.

  • Ineffective incident response
  • Failed to maintain regulatory compliance
  • Undetected security breach
  • Lack of early-warning and preventive mechanism

Server-Side Request Forgery (SSRF)

It allows an attacker to induce the server-side application to make HTTP requests to an arbitrary domain of the attacker’s choosing. This is typically used by the attacker to access URLs that normally shouldn't be allowed for public but are accessible from the exploited server because the server is already behind the firewall or inside a private network. This risk can occur when the server application accepts URL input from the client and makes a call based on the URL without proper sanitisation.



Comments

Popular posts from this blog

Increase of Malicious Activities and Implementation of reCaptcha

In recent time, I've seen the increase of malicious activities such as login attempts or phishing emails to some accounts I manage. Let me list some of them and the actions taken. SSH Access Attempts This happened on a server that host a Gitlab server. Because of this case, I started to limit the incoming traffic to the server using internal and cloud firewall provided by the cloud provider. I limit the exposed ports, connected network interfaces, and allowed protocols. Phishing Attempts This typically happened through email and messaging platform such as Whatsapp and Facebook Page messaging. The malicious actors tried to share a suspicious link lured as invoice, support ticket, or something else. Malicious links shared Spammy Bot The actors leverage one of public endpoint on my website to send emails. Actually, the emails won't be forwarded anywhere except to my own email so this just full my inbox. This bot is quite active, but I'm still not sure what...

Configuring Swap Memory on Ubuntu Using Ansible

If we maintain a Linux machine with a low memory capacity while we are required to run an application with high memory consumption, enabling swap memory is an option. Ansible can be utilized as a helper tool to automate the creation of swap memory. A swap file can be allocated in the available storage of the machine. The swap file then can be assigned as a swap memory. Firstly, we should prepare the inventory file. The following snippet is an example, you must provide your own configuration. [server] 192.168.1.2 [server:vars] ansible_user=root ansible_ssh_private_key_file=~/.ssh/id_rsa Secondly, we need to prepare the task file that contains not only the tasks but also some variables and connection information. For instance, we set /swapfile  as the name of our swap file. We also set the swap memory size to 2GB and the swappiness level to 60. - hosts: server become: true vars: swap_vars: size: 2G swappiness: 60 For simplicity, we only check the...

Deliver SaaS According Twelve-Factor App

If you haven't heard of  the twelve-factor app , it gives us a recommendation or a methodology for developing SaaS or web apps structured into twelve items. The recommendation has some connections with microservice architecture and cloud-native environments which become more popular today. We can learn the details on its website . In this post, we will do a quick review of the twelve points. One Codebase Multiple Deployment We should maintain only one codebase for our application even though the application may be deployed into multiple environments like development, staging, and production. Having multiple codebases will lead to any kinds of complicated issues. Explicitly State Dependencies All the dependencies for running our application should be stated in the project itself. Many programming languages have a kind of file that maintains a list of the dependencies like package.json in Node.js. We should also be aware of the dependencies related to the pla...

Kenshin VS The Assassin

It is an assassin versus assassin.

Handling PDF Generation in Web Service

If we are building a website that requires a PDF generation feature, there are several options for implementing it based on the use cases or user requirements. First, we can generate the PDF on the client side using any available client library. It is suitable if the use case is to print out some data that is already available inside certain website components, and we want to maintain the styles of the components in the document. Second, we can do it fully in the back-end using any library available, such as PDF-lib, jsPDF, and so on. This approach is suitable if we want to keep the data processing or any related business functions in the back-end server. This second approach might have disadvantages, such as the difficulty of maintaining the design assets and styles which are already on our website. Third, it is using a hybrid approach, where certain processes are handled on the client side, and some are handled on the back-end. In this post, I want to discuss more about the...

Free Cloud Services from UpCloud

Although I typically deploy my development environment or experimental services on UpCloud , I do not always stay updated on its announcements. Recently, I discovered that UpCloud has introduced a new plan called the Essentials plan, which enables certain cloud services to be deployed at no cost. The complimentary services are generally associated with network components or serve as the foundation for other cloud services. This feature is particularly useful when retaining foundational services, such as a load balancer, is necessary, while tearing down all services and reconfiguring the DNS and other application settings each time we temporarily clean up infrastructure to reduce costs is undesirable.  When reviewing the service specifications of the cloud services in the Essentials plan, they appear to be very similar to those in the Development plan. The difference in service levels is unclear, but it could be related to hardware or resource allocation. For instance, the loa...