SourceCodester My Food Recipe Cross-Site Scripting Vulnerability

Vulnerability

A stored cross-site scripting vulnerability has been identified in SourceCodester My Food Recipe version 1.0. The issue occurs in the 'Add Recipe' feature, specifically within the 'addRecipeModal' function of the '/endpoint/add-recipe.php' file. The vulnerability arises because user input for the 'Name' argument is not properly sanitized before being saved and displayed, allowing the execution of arbitrary JavaScript in the context of other users' sessions. This vulnerability can be exploited remotely and requires user interaction.

Impact

Exploitation of this vulnerability allows for the execution of injected JavaScript payloads when the affected recipe data is viewed, confirming the presence of a persistent cross-site scripting issue.

Reproduction

To reproduce this vulnerability, open the 'Add Recipe' modal and insert a script tag payload into the 'Recipe Name' field. After filling out the other required fields, submit the form. The injected script will execute when the recipe is viewed, demonstrating the stored cross-site scripting vulnerability.

Added: Jun 20, 2025, 3:18 PM
Updated: Jun 20, 2025, 3:18 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
1.7
exploitability
7.7
remediation
0.0
relevance
0.2
threat
6.4
urgency
2.9
incentive
1.7

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