{"id":200,"date":"2022-04-08T14:11:37","date_gmt":"2022-04-08T13:11:37","guid":{"rendered":"https:\/\/42crdev.prexihost.com\/?page_id=200"},"modified":"2024-04-29T15:04:29","modified_gmt":"2024-04-29T14:04:29","slug":"owasp-api-security-top-10","status":"publish","type":"page","link":"https:\/\/staging2022.42crunch.com\/owasp-api-security-top-10\/","title":{"rendered":"OWASP Top 10 Protection"},"content":{"rendered":"\n\n\t\t
Learn how 42Crunch can protect you against the most common API security risks and threats. The 42Crunch API Security Platform<\/a> is a set of automated API tools that ensure your APIs are secure from design to production. You can initiate API security testing<\/a> at design time with\u00a0API Audit<\/a>, utilize\u00a0API Scan<\/a> to test live endpoints, and protect your runtime APIs from all sides with the 42Crunch micro-API firewall<\/a>\u00a0API Protect.<\/p>\n\t\t\t\n\t\t\t\t\t\t\tOWASP API Security Datasheet\n\t\t\t\t\t<\/a>\n\tAPI 1: Broken Object APIs tend to expose endpoints that handle object identifiers, creating a wide attack surface Level Access Control issue. Object level authorization checks should be considered in every function that accesses a data source using an input from the user.<\/p>\n\t BOLA is also known as IDOR and is triggered by guessable IDs and lack of authorization checks at resources level. We can integrate via our protections with external authorization systems, acting as an enforcement point.<\/p>\n Additionally, we have added two approaches to address the guessable IDs problem, through dedicated protection extensions:<\/p>\n (1) Replace internal IDs by UUIDs on the fly: when IDs are returned by the back end, they are replaced by a UUID. This allows users to introduce non-guessable IDs with no need to change the APIs implementation.<\/p>\n (2) Track IDs by session: only IDs that have been returned by the API within a session can be used in subsequent calls.<\/p>\n\t Authentication mechanisms are often implemented incorrectly, allowing attackers to compromise authentication tokens or to exploit implementation flaws to assume other user’s identities temporarily or permanently. Compromising system’s ability to identify the client\/user, compromises API security overall.<\/p>\n\t Authentication is first enforced at design time: APIs with weak authentication schemes according to their risk level will be caught by the audit rules. Such APIs can be prevented from deployment in your CI\/CD pipeline<\/a>.<\/p>\n OAuth2 authorization servers endpoints (auth and token endpoints) can be protected to only allow specific grant types, enforce scopes values and access token validity time, making sure that consumers cannot use client credentials for example or enforce that a state is used with the authorization code grant, preventing attacks like\u00a0this API security breach<\/a>.<\/p>\n Additionally, our runtime protection policies validate JWT according to the RFC 8725, published in Feb 2020, preventing attacks listed in that RFC.<\/p>\n We are also working on supporting the FAPI security profiles\u00a0https:\/\/openid.net\/wg\/fapi\/<\/a>\u00a0with pre-built protections.<\/p>\n\t Looking forward to generic implementations, developers tend to expose all object properties without considering their individual sensitivity, relying on clients to perform the data filtering before displaying it to the user.<\/p>\n\t Helping developers to define response schema and follow them makes accidental data exposure impossible. 42Crunch enforces control at development and build time to ensure strong schemas are defined for all APIs. More than 300 controls are done as part of the API audit. Missing response codes are also flagged (401, 403, 404, 415, 500).<\/p>\n At QA \/ testing time, the API conformance scan<\/a> will detect if responses given by the API do not match the OpenAPI contract.<\/p>\n The 42Crunch API firewall<\/a> will block responses that do not match the schemas. When a response is invalid, the existing payload is replaced with a generic error, preventing exception leakage and\/or verbose error leakage. Responses with unknown error codes are also blocked.<\/p>\n Those services are highly complementary: if the schemas are loose, validation works all the time. So runtime support of OAS\/schemas validation is not enough, you must ensure the schemas are well-defined first.<\/p>\n\t Quite often, APIs do not impose any restrictions on the size or number of resources that can be requested by the client\/user. Not only can this impact the API server performance, leading to Denial of Service (DoS), but also leaves the door open to authentication flaws such as brute force.<\/p>\n\t 42Crunch API audit<\/a> validation rules flag loose definitions and will guide the developers to add constraints to string sizes, integer sizes and array sizes, limiting exposure to various overflow attacks. The audit also raises an issue when an API does not define 429 error codes for rate limiting.<\/p>\n At conformance scan<\/a> time, constraints are validated by sending data outside of limits and analyzing the API response.<\/p>\n Finally, at runtime, the expected limits are enforced. Rate-limiting protections can be added to the OAS file (at the API or operation level) as well as JSON parser protections (payload size, complexity).<\/p>\n\t Complex access control policies with different hierarchies, groups, and roles, and an unclear separation between administrative and regular functions, tend to lead to authorization flaws. By exploiting these issues, attackers gain access to other users’ resources and\/or administrative functions.<\/p>\n\t At runtime, 42Crunch ensures that only verbs and paths defined in the OAS-based contract can be called. APIs which are not defined are blocked as well, preventing unknown APIs from being called.<\/p>\n Additionally, at design time, customers can use our audit discovery mechanisms via CI\/CD<\/a> to uncover shadow APIs and automatically audit and report<\/a> them.<\/p>\n\t Binding client provided data (e.g., JSON) to data models, without proper properties filtering based on an allowlist, usually lead to Mass Assignment. Either guessing objects properties, exploring other API endpoints, reading the documentation, or providing additional object properties in request payloads, allows attackers to modify object properties they are not supposed to.<\/p>\n\t Similarly to API3, API Linter<\/a> also analyzes requests schemas\/forms flagging missing constraints and patterns, as well as headers, path and query parameters.<\/p>\n At runtime, the 42Crunch enforces the data constraints and blocks invalid requests, preventing hackers from injecting any undefined data or calling unknown path and verbs.<\/p>\n\t Security misconfiguration is commonly a result of unsecure default configurations, incomplete or ad-hoc configurations, open cloud storage, misconfigured HTTP headers, unnecessary HTTP methods, permissive Cross-Origin resource sharing (CORS), and verbose error messages containing sensitive information.<\/p>\n\t Our security as code approach allows enterprises to make security fully part of the API lifecycle, starting at design time. 42Crunch API Security Audit<\/a> flags unsecure transport configuration and automatically validates standard headers (such as Content-Type) within the OAS definition.<\/p>\n The 42Crunch runtime only accepts secure connections, supports MTLS inbound\/outbound and only accepts TLS1.2 with strong cipher suites. Standard protections include CORS support and automatic injection of security headers. Our API firewall<\/a> is constantly kept up to date for latest CVEs and checked for security vulnerabilities.<\/p>\n The API firewall runtime is very small and can be deployed for all APIs, with very limited impact to performance. Since the configuration only depends on the OAS file, firewalls can be put in place early in all environments, including development, limiting the possibility to inject security issues in early lifecycle phases.<\/p>\n Error messages which do not match the expected formats are blocked and replaced with standard ones which do not give away internal information.<\/p>\n\t Injection flaws, such as SQL, NoSQL, Command Injection, etc., occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s malicious data can trick the interpreter into executing unintended commands or accessing data without proper authorization.<\/p>\n\t Injections hit APIs via unsanitized inputs. By forcing the companies to define tightened input schemas and patterns, 42Crunch eliminates the risk of arbitrary payloads hitting the backend.<\/p>\n Additionally to the standard OAS based allowlist, customers can deploy denylist-based protections for properties where a precise regex is not an option.<\/p>\n\t APIs tend to expose more endpoints than traditional web applications, making proper and updated documentation highly important. Proper hosts and deployed API versions inventory also play an important role to mitigate issues such as deprecated API versions and exposed debug endpoints.<\/p>\n\t 42Crunch CI\/CD integration<\/a> is core to addressing this issue: by providing a security point of control whenever code is pushed to the platform and by delivering a discovery mechanism that leaves no room for unknown APIs in any code repository. All discovered APIs can be viewed in our dashboard, or in your dashboard of choice, providing instant visibility to security and dev teams alike. This is even more critical in companies where APIs are implemented across various technologies and where global visibility\/governance across those technologies is challenging.<\/p>\n At runtime, unknown paths and APIs traffic will be blocked by default. The firewall<\/a> listening only mode will allow you to record invalid traffic, without blocking it, and discover unwanted\/forgotten traffic.<\/p>\n\t N\/A<\/p>\n\t N\/A<\/p>\n\t Insufficient logging and monitoring, coupled with missing or ineffective integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to more systems to tamper with, extract, or destroy data. Most breach studies demonstrate the time to detect a breach is over 200 days, typically detected by external parties rather than internal processes or monitoring.<\/p>\n\t All transactions flowing through the API Protect<\/a> (successful or blocked) are recorded and can be leveraged via our API Security platform<\/a> or via the customers logging\/monitoring platform of choice. Attack information can be pushed to SIEM<\/a> using Common Event Format or JSON for correlation and incident response. Incidents are also visible in our platform’s real-time security dashboard.<\/p>\n\t Dr. Philippe De Ryck<\/p>\n\t Dr. Philippe De Ryck, Web Security Expert with Pragmatic Web Security and Colin Domoney of 42Crunch and APISecurity.io, take a deep dive into understanding and addressing the OWASP API Security Top 10 issues.<\/p>\n
\nLevel Authorization<\/a>\n\tAPI 2: Broken User
\nAuthentication<\/a>\n\tAPI 3<\/a>: Excessive
\nData Exposure<\/a>\n\tAPI 4: Lack of Resources
\n& Rate Limiting<\/a>\n\tAPI 5: Broken Function
\nLevel Authorization<\/a>\n\tAPI 6: Mass
\nAssignment<\/a>\n\tAPI 7: Security
\nMisconfiguration<\/a>\n\tAPI 8:
\nInjection<\/a>\n\tAPI 9: Improper
\nAssets Management<\/a>\n\tAPI 10: Insufficient
\nLogging & Monitoring<\/a>\n\tAPI 01:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tBroken Object Level Authorization\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 02:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tBroken User Authorization\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 03:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tExcessive Data Exposure\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 04:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tLack of Resources & Rate Limiting\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 05:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tBroken Function Level Authorization\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 06:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tMass Assignment\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 07:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tSecurity Misconfiguration\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 08:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tInjection\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n
\n
OWASP Definition<\/h4>\n
API 09:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tImproper Assets Management\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
\n<\/center>\n
\n
OWASP Definition<\/h4>\n
API 10:<\/h4>\n
\n\t\t42Crunch\u00a0Approach\n\t<\/h2>\n
\n\t\tInsufficient Logging & Monitoring\n\t<\/h2>\n\t
\n(API Audit)<\/center>\n\t\n
OWASP Definition<\/h4>\n
3-Part Webinar series<\/h4>\n
\n\t\t\n\t\tOWASP API Security Top 10\u00a0\n\t\t<\/a>\n\t<\/h2>\n
\n\t\tFind, Fix and Secure your APIs\n\t<\/h2>\n\t\t\t\t\n\t
\n\t\tReady to Learn More?\n\t<\/h2>\n\t