External Entity Resolution Blocking
The XML parser is configured so that external entities cannot be resolved.
Prevent attacker-controlled XML from causing the server to access external resources.
Modern application environments rely heavily on APIs to provide controlled access to application resources and business functions. APIs may expose user-specific resources, account information, transactions, orders, and other application objects. Improper authorization at the object level can allow an authenticated user to access resources that belong to another user
In this use case, OWASP crAPI (Completely Ridiculous API) is deployed as the controlled API application on an Ubuntu virtual machine. The application provides an intentionally vulnerable API environment that can be used to safely reproduce and validate API authorization weaknesses
A controlled Broken Object-Level Authorization (BOLA) attack is performed from Kali Linux against the laboratory API environment. The attacker authenticates as a legitimate test user and identifies API requests that contain object-level resource identifiers. The resource identifier is manipulated while maintaining the valid authentication context to determine whether the API performs appropriate authorization validation.
Burp Suite Community Edition is used to intercept, modify, and replay API requests during the security assessment. OWASP ZAP is used as an additional API security assessment and validation tool.
The API behavior is analyzed to determine whether the server verifies the authenticated user's authorization to access the requested object. If unauthorized object access is possible, the behavior is identified as a Broken Object-Level Authorization vulnerability.
The proposed solution implements server-side object-level authorization validation. The server verifies the authenticated user's identity, resource ownership, and access permission before allowing protected object operations.
After implementing the defensive mechanism, the same controlled security test is repeated to verify that unauthorized object access is prevented while legitimate users retain access to their authorized resources.
OWASP crAPI is used as the controlled API application for reproducing and validating API authorization vulnerabilities. The application contains authenticated users and user-associated resources, allowing object-level authorization behavior to be assessed under controlled conditions.
The API may correctly authenticate a user but fail to determine whether that authenticated user has permission to access the specific object requested through an API endpoint. Object identifiers are often supplied as part of API requests. If the server trusts these identifiers without performing an authorization check against the authenticated user's permissions, an attacker may manipulate the identifier to request another user's resource.
The API may correctly authenticate a user but fail to determine whether that authenticated user has permission to access the specific object requested through an API endpoint.
The security problem is therefore:
The proposed solution introduces server-side object-level authorization enforcement to ensure that every protected object operation is evaluated against the authenticated user's permissions.
Broken Object-Level Authorization (BOLA) is an API authorization vulnerability in which an application fails to properly enforce access control for individual resources or objects.
The attacker uses a legitimate authenticated account and manipulates the object identifier associated with an API request. The attack does not require authentication bypass when valid credentials or an authenticated session are already available.
Object-level authorization is the security concept of determining whether an authenticated user has permission to access a specific application resource.
The authorization decision must consider the identity of the authenticated user and the permissions associated with the requested object.
The secure processing flow is:
The XML parser is configured so that external entities cannot be resolved.
Prevent attacker-controlled XML from causing the server to access external resources.
The application restricts or disables DTD processing when DTD functionality is not required.
Prevent XML documents from defining external entities that could be processed by the parser.
The XML parser is configured using security-focused settings rather than relying on default parser behavior.
Ensure unsafe XML processing features are explicitly disabled.
The application restricts excessive entity expansion.
Prevent malicious XML documents from causing abnormal parser resource consumption.
Incoming XML is validated according to the application's expected XML structure.
Reject XML content that does not conform to the permitted application format.
The XML API server is prevented from making unnecessary outbound connections.
Provide an additional security layer if an application-level validation control is bypassed.
XML parser errors and rejected XML security-policy violations are recorded.
Provide visibility into attempted XXE activity and support investigation
XXEinjector is used as the primary security-testing tool because it is specifically designed to automate XXE testing.
The controlled XML API provides the target environment.
Ubuntu hosts the XML API.
Docker is used to deploy the XML API.
Kali Linux is used as the security-testing environment.