Sourcecodester AI-Powered To-Do List App Cross-Site Scripting Vulnerability

Vulnerability

A cross-site scripting (XSS) vulnerability has been identified in the Sourcecodester AI-Powered To-Do List App version 1.0. The issue arises in the 'Task Title' and 'Description (Optional)' fields when creating a task. This vulnerability allows attackers to inject arbitrary HTML or JavaScript code, which is executed in the context of the victim's browser when the 'Add Task' button is clicked.

Impact

Exploitation of this vulnerability allows for the injection of malicious scripts that are executed in the user's browser. This could lead to theft of cookies or session tokens, enabling attackers to impersonate users and potentially escalate privileges. Additionally, it could facilitate in-page phishing, credential harvesting, or malware distribution.

Reproduction

To reproduce this vulnerability, enter a malicious HTML or JavaScript payload into the 'Task Title' or 'Description (Optional)' fields while creating a new task. After inserting the payload, click the 'Add Task' button and observe the execution of the injected script.

Remediation

To mitigate this vulnerability, implement input validation and sanitization to rigorously check and encode user-supplied data before rendering it. Consider applying a Content Security Policy (CSP) to restrict script sources and prevent inline script execution. Additionally, properly encode data based on the context before output, use secure frameworks that handle escaping automatically, and mark session cookies as HttpOnly to prevent access via client-side scripts.

Added: Nov 7, 2025, 8:19 PM
Updated: Nov 7, 2025, 8:19 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
5.4
exploitability
7.7
remediation
0.0
relevance
0.9
threat
6.4
urgency
2.9
incentive
0.8

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.