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

Rangkaian Sensor Infrared dengan Photo Dioda

Keunggulan photodioda dibandingkan LDR adalah photodioda lebih tidak rentan terhadap noise karena hanya menerima sinar infrared, sedangkan LDR menerima seluruh cahaya yang ada termasuk infrared. Rangkaian yang akan kita gunakan adalah seperti gambar di bawah ini. Pada saat intensitas Infrared yang diterima Photodiode besar maka tahanan Photodiode menjadi kecil, sedangkan jika intensitas Infrared yang diterima Photodiode kecil maka tahanan yang dimiliki photodiode besar. Jika  tahanan photodiode kecil  maka tegangan  V- akan kecil . Misal tahanan photodiode mengecil menjadi 10kOhm. Maka dengan teorema pembagi tegangan: V- = Rrx/(Rrx + R2) x Vcc V- = 10 / (10+10) x Vcc V- = (1/2) x 5 Volt V- = 2.5 Volt Sedangkan jika  tahanan photodiode besar  maka tegangan  V- akan besar  (mendekati nilai Vcc). Misal tahanan photodiode menjadi 150kOhm. Maka dengan teorema pembagi tegangan: V- = Rrx/(Rrx + R2) x Vcc V- = 150 / (1...

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...

API Gateway Using KrakenD

The increasing demands of users for high-quality web services create the need to integrate various technologies into our application. This will cause the code base to grow larger, making maintenance more difficult over time. A microservices approach offers a solution, where the application is built by combining multiple smaller services, each with a distinct function. For example, one service handles authentication, another manages business functions, another maintains file uploads, and so on. These services communicate and integrate through a common channel. On the client side, users don't need to understand how the application is built or how it functions internally. They simply send a request to a single endpoint, and processes like authentication, caching, or database querying happen seamlessly. This is where an API gateway is effective. It handles user requests and directs them to the appropriate handler. There are several tools available for building an API gateway, su...

Deploying a Web Server on UpCloud using Terraform Modules

In my earlier post , I shared an example of deploying UpCloud infrastructure using Terraform from scratch. In this post, I want to share how to deploy the infrastructure using available Terraform modules to speed up the set-up process, especially for common use cases like preparing a web server. For instance, our need is to deploy a website with some conditions as follows. The website can be accessed through HTTPS. If the request is HTTP, it will be redirected to HTTPS. There are 2 domains, web1.yourdomain.com and web2.yourdomain.com . But, users should be redirected to "web2" if they are visiting "web1". There are 4 main modules that we need to set up the environment. Private network. It allows the load balancer to connect with the server and pass the traffic. Server. It is used to host the website. Load balancer. It includes backend and frontend configuration. Dynamic certificate. It is requ...

Installing VSCode Server Manually on Ubuntu

I've ever gotten stuck on updating the VSCode server on my remote server because of an unstable connection between my remote server and visualstudio.com that host the updated server source codes. The download and update process failed over and over so I couldn't remotely access my remote files through VSCode. The solution is by downloading the server source codes through a host with a stable connection which in my case I downloaded from a cloud VPS server. Then I transfer the downloaded source codes as a compressed file to my remote server through SCP. Once the file had been on my remote sever, I extracted them and align the configuration. The more detailed steps are as follows. First, we should get the commit ID of our current VSCode application by clicking on the About option on the Help menu. The commit ID is a hexadecimal number like  92da9481c0904c6adfe372c12da3b7748d74bdcb . Then we can download the compressed server source codes as a single file from the host. ...

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...