Hi, it's Alan from Crashtest Security. In this video, I will tell you more about insecure design flaws, potential impacts, and mitigation strategies. So let's get started!
What is Insecure Design? Insecure design encompasses various risks that arise from ignoring design and architectural best practices, starting from the planning phase before actual implementation. A quick point to note here is that an insecure design differs from an insecure implementation, and a near-perfect implementation cannot prevent defects from an insecure design.
While the Insecure design flaw is a new entrant to the OWASP top 10, it ranks number four on the 2021 list since mitigating risks at the design phase is considered fundamental toward 'Shift Left' security practices. Insecure design vulnerabilities arise when developers, QA, and/or security teams fail to anticipate and evaluate threats during the code design phase. These vulnerabilities are also a consequence of the non-adherence of security best practices while designing an application.
As the threat landscape evolves, mitigating design vulnerabilities requires consistent threat modeling to prevent known attack methods. Without a secure design, it is difficult to detect and remediate architectural flaws such as: Unprotected Storage of Credentials When designing an application, development teams often ignore secret management and access control best practices, which lead to security vulnerabilities. As a result, the system commonly gets compromised because of harmful password management practices such as storing user passwords as plaintext in application properties, configuration files, or memory.
Design flaws in identity and access management for certificate generation also enable access to confidential information. Such application security flaws would allow attackers to assume legitimate user accounts and obtain unauthorized access to password-protected resources for deeper system exploitation. Trust Boundary Violations A trust boundary is an interface in the program that allows for the safe exchange of data or commands between two entities.
These include areas of the application that accept uncontrolled external inputs like HTTP requests, network sockets, and file uploads. Trust boundary violations occur when the interface accepts and stores both trusted and untrusted data inputs in the same data store. Developers often fail to distinguish between trusted and untrusted sources, enabling the exchange of malicious data and commands.
In addition to this, the application’s backend may also allow the unsafe exchange of data across the trust boundary if the application lacks a diligently deployed input validation mechanism. Generation of Error Messages Containing Sensitive Information Most modern applications are designed to identify error conditions and generate diagnostic messages that inform the user of the error and possible remediation. Often these error messages are verbose and contain sensitive information like user id, password, the application environment, or other associated data that an attacker can access.
The attacker can use the exposed data to launch other attacks like path transversal and SQL injection attacks. Improper Isolation or Compartmentalization This vulnerability occurs when the application does not effectively separate entities with varying rights, privileges, and access permissions – resulting in broken access control. Suppose developers fail to separate the environments of a product successfully.
In that case, an attacker may gain access to any one of the environments and can further extend the scope of the attack to other environments. As a result, improper isolation of processes, resources, and application functionalities vulnerabilities leads to a giant attack blast radius. Prevention of insecure design vulnerabilities typically starts with enforcing a ‘shift left’ security mindset that requires business risk profiling from the onset of the SDLC.
Some common approaches to prevent insecure design vulnerabilities include: Establish a Secure Development Lifecycle During the application design phase, development teams should embrace factual design methodology and established design patterns. Each team member should have access to security tools, tested component libraries, and threat models to reduce their workload’s application security risk. Security teams should be engaged at the beginning of the development lifecycle and be consulted throughout the development, integration, and deployment phases.
Establish Continuous Unit and Integration Tests Developers should set up automated security tests for individual functions and methods within the modules, components, and classes used in the application. Outlined test plans should be included as a part of the blueprint for the design and release of the product, ensuring airtight security across each stage of the SDLC. Enforce Granular Requirements and Resource Management During the initial planning phases of application development, product managers should collect and assess the client’s technical and business requirements, including availability, authenticity, integrity, and confidentiality of the application logic and data.
Based on this, developer teams should determine the optimum segregation of tenants and exposure of each component within the application. The production plan should also cover the management of all development activities on a per-tenant basis to enforce secure access rights management. Implement System and Network Layer Tier Segregation Organizations should determine the application’s protection, and exposure needs to implement the appropriate level of segregation at the system or network layer.
By partitioning the deployment into modular subsystems or virtual networks, it is easier to restrict the level of access to specific data and resources. This makes it challenging for hackers to extend their scope of access in case of an attack. Impacts of Insecure Design Consequences of attacks on insecure design vulnerabilities vary depending on the scope of the attack, the data exposed, and the duration it continues till detection.
Potential impacts of a successful exploit include: User and system enumeration Complete account takeover System and data breaches Denial of service by spoofing a server with multiple requests Privilege escalation for compromised, low-privilege accounts The execution of other attacks, such as cross-site scripting, cross-site request forgery, and path transversal Examples of attack scenarios leveraging insecure design include: Verbose Error Message Leading to Path Transversal Error messages that return detailed information may direct attackers to files that contain valuable information. Attackers can access the files and directories using path transversal techniques, enabling further compromise. The following code snippet shows a PHP database error that exposes the system structure to malicious users: From the above error message, the malicious user can access Mysql_config_location and obtain credentials to access the database or replace the configuration file with a malicious one.
Injection As a Trust Boundary Violation Vulnerability An attacker can inject malicious code to retrieve data from the database in an application that uses an SQL database without adequate validation. Assume a car rental website using the following URL for clients looking to lease an SUV: https://darwin-cars. com/vehicles?
category=SUV Clicking on the link instructs the application to construct a query for retrieving details of the relevant vehicles from the database, as shown in this code. This query asks the backend to return all details from the vehicles table, where the category is SUV and the value of the registered column is 1. The restriction registered=1 is used to hide existing vehicles that have not been registered.
In the absence of user-supplied URL validation, the malicious user can construct a URL like: https://darwin-cars. com/vehicles? category=SUV’ dash This sends the following query to the database: The — characters indicate the start of a comment in SQL, so the server interprets the rest of the query as a comment.
By commenting out registered= 1 part of the query, the attacker forces the server to return details of all vehicles in the SUV category, even the unregistered ones. Try Crashtest Security today to discover how it integrates into your development stack for efficient, automated vulnerability scanning. The trial is free!
Also, subscribe to the Crashtest Security channel to get more information about the most significant web security threats, their prevention, and how to use the Crashtest Security Suite. Thank you for watching, and see you in our next video!