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

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 exi

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 / (150+10) x Vcc V- = (150/160) x 5

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.

Resize VirtualBox LVM Storage

VirtualBox is a free solution to host virtual machines on your computer. It provides configuration options for many components on our machine such as memory, storage, networking, etc. It also allows us to resize our machine storage after its operating system is installed. LVM is a volume manager in a Linux platform that helps us to allocate partitions in the system and configure the storage size that will be utilized for a specific volume group. There are some points to be noticed when we work with LVM on VirtualBox to resize our storage. These are some steps that need to be performed. 1. Stop your machine before resizing the storage. 2. Set new storage size using GUI by selecting " File > Virtual Media Manager > Properties " then find the desired virtual hard disk name that will be resized. OR , by running a CLI program located in " Program Files\Oracle\VirtualBox\VBoxManage.exe ".  cd "/c/Program Files/Oracle/VirtualBox" ./VBoxManage.exe list

Managing MongoDB Records Using NestJS and Mongoose

NestJS is a framework for developing Node.js-based applications. It provides an additional abstraction layer on top of Express or other HTTP handlers and gives developers a stable foundation to build applications with structured procedures. Meanwhile, Mongoose is a schema modeling helper based on Node.js for MongoDB. There are several main steps to be performed for allowing our program to handle MongoDB records. First, we need to add the dependencies which are @nestjs/mongoose , mongoose , and @types/mongoose . Then, we need to define the connection configuration on the application module decorator. import { MongooseModule } from '@nestjs/mongoose'; @Module({ imports: [ MongooseModule.forRoot('mongodb://localhost:27017/mydb'), ], controllers: [AppController], providers: [AppService], }) Next, we create the schema definition using helpers provided by NestJS and Mongoose. The following snippet is an example with a declaration of index setting and an o

Generate API Documentation Using Swagger Module in NestJS

Swagger provides us a standard to generate API documentation based on the Open API specification. If we use NestJS for building our API providers, we can utilize a tool provided by NestJS in the  @nestjs/swagger  module to generate the documentation automatically in the built time. This module also requires the swagger-ui-express module if we use Express as the NestJS base HTTP handler. Set Swagger configuration First, we need to define Swagger options and instantiate the documentation provider on the main.ts file. import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; // sample application instance const app = await NestFactory.create(AppModule); // setup Swagger options const options = new DocumentBuilder() .setTitle('Coffee') .setVersion('1.0') .setDescription('Learn NestJS with coffee') .build(); // build the document const document = SwaggerModule.createDocument(app, options); // provide an endpoint