Thursday, March 9, 2023

What is CSRF? How is CSRF Protection enabled in AEM?

 What is CSRF?

  1. The victim is authenticated in the target web application (e.g., www.example.com).
  2. The attacker uses social engineering to trick the victim into visiting a malicious website (e.g.,checkthiscoupen.com).
  3. The malicious web page includes code that causes the victim’s browser to send an implicit request to the target (www.example.com).
  4. The malicious request causes the target to perform state change actions that the user did not intend.

How CSRF Protection Enabled in AEM?

Valid Scenario:

Malicious Attack:

Granite jQuery or Granite CSRF standalone library:

CSRF Token Servlet:

CSRF Filter:

HMAC Key Sync:

Dispatcher Configuration:

Conclusion:

Monday, February 27, 2023

Responsive Layouts not working for the nested containers - Adobe Experience Manager(AEM)

The responsive layout resizing was not working for the nested 3rd-level containers in the Editable template.

The responsive layout containers with Editable templates help the authors to manage the page layouts through drag-and-drop resizing. But it looks to be the resizing is not working when nested more than two levels - the resizing stopped working in the 3rd level.

The actual issue is the responsive configurations (cq:responsive node) are not inherited to the 3rd level.

Added a container (container1) 

  •   Container(container1) is aligned to a specific column, e.g., 8.
  •   Added a child container 2 to the container 1.
  •   Added a child container 3 to container 2.
  •   Made container 3 a responsive grid.
  •   Added a text component to container 3.
  •   Layouting not working for the text component.

Workaround: Resize container 3 to a different column size and return to the original column size — this will add the cq:responsive node to container 3 and allow the layout for the text component.