Step 1: Payload Delivery: An attacker crafts a malicious JavaScript payload (e.g., <script>alert('XSS')</script>) and submits it as input to the application, typically within a memo.
Step 2: Data Storage: The application stores the attacker's input, including the malicious JavaScript, in its database without proper sanitization or encoding.
Step 3: User Interaction: A legitimate user accesses the application and views the memo created by the attacker.
Step 4: Payload Execution: The application retrieves the attacker's input from the database and renders it in the user's browser without proper HTML escaping. This allows the browser to interpret the injected JavaScript as part of the page's content.
Step 5: Exploitation: The malicious JavaScript executes within the user's browser, potentially allowing the attacker to steal cookies, redirect the user, or perform other malicious actions.