Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2025-1213 Overview
CVE-2025-1213 is a reflected cross-site scripting (XSS) vulnerability in PiHome 1.77, a smart home controller platform from pihome-shc. The flaw resides in /index.php, where the application reflects the $_SERVER['PHP_SELF'] value without proper sanitization. An attacker can craft a URL that injects arbitrary HTML or JavaScript into the response, which executes in the victim's browser session. The issue is tracked under CWE-79 and requires low privileges plus user interaction to exploit. A public proof of concept has been disclosed, increasing the likelihood of opportunistic abuse against exposed PiHome deployments.
Critical Impact
Successful exploitation enables script execution in an authenticated user's browser, allowing session theft, UI manipulation, or forced actions against the PiHome interface.
Affected Products
- pihome-shc PiHome (maxair) version 1.77
- Deployments exposing /index.php to untrusted networks
- Browsers rendering unsanitized responses from the affected endpoint
Discovery Timeline
- 2025-02-12 - CVE-2025-1213 published to the National Vulnerability Database (NVD)
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-1213
Vulnerability Analysis
The vulnerability is a reflected cross-site scripting flaw in the PiHome web interface. PHP's $_SERVER['PHP_SELF'] superglobal returns the filename of the currently executing script, but it also includes any path information appended to the URL after the script name. When a developer echoes this value into HTML without escaping, an attacker can append arbitrary content to the URL that is then reflected into the rendered page. PiHome 1.77 performs exactly this unsafe pattern in /index.php, producing a classic client-side injection sink.
Exploitation requires an attacker to deliver a crafted link to a logged-in PiHome user. Because PiHome is a self-hosted controller for home automation hardware, successful script execution can hijack the session cookie, perform state-changing requests against connected devices, or alter the rendered administrative UI through a cross-site scripting payload.
Root Cause
The root cause is unsanitized reflection of the $_SERVER['PHP_SELF'] variable into HTML output. The application fails to apply contextual output encoding such as htmlspecialchars() before echoing the value, violating standard PHP guidance on handling superglobals that contain user-controllable path data.
Attack Vector
The attack vector is network-based and depends on social engineering. An attacker crafts a URL targeting /index.php with an injected payload embedded in the path segment. When a victim with an active PiHome session clicks the link, the server reflects the payload and the browser executes it in the context of the PiHome origin. Technical details are published in the GitHub PoC Repository and the VulDB CTI Report #295172.
No synthetic exploit code is reproduced here. Refer to the linked PoC for the exact URL pattern used to trigger the reflected payload.
Detection Methods for CVE-2025-1213
Indicators of Compromise
- Web server access logs showing requests to /index.php with embedded <script>, onerror, javascript:, or percent-encoded HTML characters in the path
- Unusual outbound requests from browser sessions that recently loaded the PiHome interface
- Session cookies for PiHome accounts observed in unexpected geolocations or user agents
Detection Strategies
- Inspect HTTP request paths to PiHome for angle brackets, quote characters, and script-like tokens appended after index.php
- Deploy a web application firewall rule that blocks reflected XSS signatures targeting PHP path info
- Correlate browser telemetry with PiHome request logs to identify sessions that loaded injected content
Monitoring Recommendations
- Enable verbose access logging on the PiHome web server and forward logs to a central analytics platform
- Alert on repeated 200-status responses to /index.php requests containing suspicious URL-encoded payloads
- Monitor PiHome user accounts for anomalous device-control actions following suspicious page loads
How to Mitigate CVE-2025-1213
Immediate Actions Required
- Restrict PiHome administrative access to trusted networks or VPN-only reachability
- Instruct users to avoid clicking unsolicited links that reference the PiHome host or /index.php
- Deploy a Content Security Policy (CSP) that disables inline scripts to limit payload execution
Patch Information
No vendor advisory or patched release is referenced in the NVD record for CVE-2025-1213 at the time of publication. Operators should monitor the pihome-shc project for an updated release that applies htmlspecialchars() or an equivalent output-encoding routine to the reflected PHP_SELF value.
Workarounds
- Place PiHome behind a reverse proxy that strips or rejects URL paths containing HTML metacharacters
- Apply a local patch replacing any echo $_SERVER['PHP_SELF'] usage with htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'UTF-8')
- Enforce browser-side mitigations such as X-XSS-Protection, Content-Security-Policy, and SameSite=Strict session cookies
# Example nginx rule to block script-like payloads in the PiHome path
location /index.php {
if ($request_uri ~* "(<|%3C)script|onerror=|javascript:") {
return 403;
}
proxy_pass http://pihome_backend;
}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

