Referrer Filter and CSRF Filter
In Adobe Experience Manager (AEM), both the Referrer Filter and CSRF (Cross-Site Request Forgery) Filter are security mechanisms designed to protect against different types of web vulnerabilities. While they serve related security purposes, they operate based on different principles. Let's take a closer look at each.
Referrer Filter
The Referrer Filter in AEM is used to restrict HTTP requests based on the value of the HTTP Referer header (the misspelling of "referrer" is historical and comes from the original HTTP specification). This header indicates the URL of the webpage that linked to the resource being requested. The purpose of the Referrer Filter is to ensure that only requests originating from trusted domains are accepted by the AEM server. This is a security measure to prevent unauthorized API calls, resource access, or other actions that might be part of a CSRF attack or other malicious activities.
Configuration of the Referrer Filter involves specifying which domains are allowed to make requests. This can be done using exact domain names, wildcard patterns, or regular expressions. The filter can be configured to apply to specific HTTP methods (like POST, PUT, DELETE) that are more likely to perform state-changing operations, which are of particular concern in CSRF attacks.
CSRF Filter
The CSRF Filter specifically targets Cross-Site Request Forgery attacks. A CSRF attack occurs when a malicious website, email, blog, or program causes a user's web browser to perform an unwanted action on a trusted site for which the user is currently authenticated. The CSRF Filter protects against this by requiring a special token in requests that could change the state of the application (such as form submissions). This token is unique to each user session and is used to verify that the request was intentionally made by the user and not forged by a third party.
In AEM, the CSRF Protection Framework generates and validates these tokens. For requests that are subject to CSRF protection (typically POST, PUT, DELETE, etc.), the framework requires that a valid CSRF token be present in the request. This token is often included as a request parameter or within the request headers. The presence and validity of the token ensure that the request is legitimate and not a result of a CSRF attack.
Comparison and Relation
While both the Referrer Filter and CSRF Filter aim to protect against unauthorized or malicious requests, they do so through different mechanisms:
. Referrer Filter: Works by validating the source of the request, checking the HTTP
Refererheader against a list of allowed domains. It's a more general security measure that can prevent a range of attacks, including but not limited to CSRF.. CSRF Filter: Directly targets CSRF attacks by requiring a unique token in state-changing requests, ensuring that the request is intentional and authorized by the user.
Comments
Post a Comment