harshitbansal373 / PHP-CMS

This Project is based on content management system build using PHP. This projects includes secured login system or signup system with admin and local user supporter. It also contain dashboard with different analytics which helps to analyse data.
MIT License
24 stars 13 forks source link

Stored Cross-Site Scripting #5

Open prasadlingamaiah opened 3 years ago

prasadlingamaiah commented 3 years ago

Description: Stored XSS, also known as persistent XSS, is the more damaging than non-persistent XSS. It occurs when a malicious script is injected directly into a vulnerable web application. Cross-site scripting is a web security vulnerability that allows an attacker to compromise the interactions that users have with a vulnerable application. It allows an attacker to circumvent the same origin policy, which is designed to segregate different websites from each other. Cross-site scripting vulnerabilities normally allow an attacker to masquerade as a victim user, to carry out any actions that the user is able to perform, and to access any of the user's data. If the victim user has privileged access within the application, then the attacker might be able to gain full control over all of the application's functionality and data

Proof of Concept Step1: Access the PHP-CMS login page using the. http://127.0.0.1/PHP-CMS/login.php dashboard

Step2: Navigate to profile location using the URL: http://127.0.0.1/PHP-CMS/admin/profile.php Step3: Go to the Lastname parameter and insert the with malicious javascript and update profile. lastname

allusers1

Step4: Now goto users list. Step5: The XSS malicious javascript popup is rendered. allusers2

Mitigation: Preventing cross-site scripting is trivial in some cases but can be much harder depending on the complexity of the application and the ways it handles user-controllable data.

In general, effectively preventing XSS vulnerabilities is likely to involve a combination of the following measures: Filter input on arrival. At the point where user input is received, filter as strictly as possible based on what is expected or valid input. Encode data on output. At the point where user-controllable data is output in HTTP responses, encode the output to prevent it from being interpreted as active content. Depending on the output context, this might require applying combinations of HTML, URL, JavaScript, and CSS encoding. Use appropriate response headers. To prevent XSS in HTTP responses that aren't intended to contain any HTML or JavaScript, you can use the Content-Type and X-Content-Type-Options headers to ensure that browsers interpret the responses in the way you intend. Content Security Policy. As a last line of defense, you can use Content Security Policy (CSP) to reduce the severity of any XSS vulnerabilities that still occur.