CVE-2026-43938: YAFNET.Core Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-33gv-fc78-qgf5
CVSS 8.1
CWE-116 CWE-80 CWE-79
Published
Advisory Summary

CVE-2026-43938 is a HIGH (CVSS 8.1) cross-site scripting vulnerability (CWE-116: Improper Encoding or Escaping of Output) affecting YAFNET.Core libraries in the NuGet ecosystem. The issue involves yafnet has unauthenticated stored second-order xss in admin event log via reflected `user-agent` header. Remediation is available by upgrading affected packages to version 4.0.5, 3.2.12.

CVE-2026-43938 at a Glance

CVE Identifier CVE-2026-43938
GHSA Identifier GHSA-33gv-fc78-qgf5
Severity HIGH
CVSS v3.1 Base Score 8.1
CWE Classification CWE-116: Improper Encoding or Escaping of Output
Affected Product YAFNET.Core
Package Ecosystem NuGet
Published Date
Last Updated

Security Impact

CVSS: 8.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-43938

To remediate this vulnerability, upgrade all affected YAFNET.Core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

YAFNET.Core fixed: 4.0.5
Upgrade YAFNET.Core to 4.0.5
YAFNET.Core fixed: 3.2.12
Upgrade YAFNET.Core to 3.2.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for YAFNET.Core

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-43938, inspect your project dependencies for YAFNET.Core:

inspect dependencies for YAFNET.Core

Analyze the terminal output to locate any version of YAFNET.Core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-116: Improper Encoding or Escaping of Output, where the product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. as a result, the intended structure of the message is not preserved. In YAFNET.Core, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Description:** Stored (second-order) Cross-Site Scripting (XSS) occurs when attacker-controlled input is persisted through one component of an application and later rendered, without proper sanitization or contextual output encoding, by a completely different component — often one that implicitly trusts the stored data. Because the dangerous sink is typically a privileged administrative interface, the payload executes in the browser of a high-value user (such as an administrator) and inherits their authenticated session. This class of issue is especially severe when the entry point is an HTTP header on an unauthenticated endpoint, since the attack surface extends to any anonymous attacker on the internet with no prerequisites. **Issue Details:** 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`. Critically, the attacker does not need to be authenticated: the unauthenticated endpoint `GET /api/Attachments/GetAttachment?attachmentId=2147483647` reliably triggers a server-side exception that is written to `dbo.EventLog` together with the attacker-controlled `User-Agent`. A single anonymous request such as `curl -A "<img src=x onerror=alert('XSS')>" "http://<target>/api/Attachments/GetAttachment?attachmentId=2147483647"` is sufficient to persist the payload, and when an administrator later visits `/Admin/EventLog` the malicious markup is rendered as live HTML in the admin's authenticated session. **Impact:** An entirely unauthenticated attacker, with no account, no CSRF token, and no prior access, can stage JavaScript that will execute in an administrator's browser the next time the Event Log is viewed. Because the script runs in the admin's authenticated origin, it can perform any action the admin can: creating new administrative accounts, modifying site-wide settings, exfiltrating user data through admin-only endpoints. This effectively converts a single anonymous HTTP request into a full forum-takeover primitive, and the lack of any authentication requirement makes it exploitable at internet scale, including by automated scanners. **Likelihood:** Exploitation requires only the ability to send a single HTTP request to a public, unauthenticated endpoint, which any anonymous attacker on the internet can do. Administrators routinely review the Event Log as part of normal operations, so payload delivery is highly probable with negligible attacker effort, making the overall likelihood very high. **Steps to Reproduce:** - From an unauthenticated session (no cookies, no tokens), send the following request with a malicious `User-Agent` header: - `curl.exe -sS -A "<img src=x onerror=alert('XSS')>" "http://yetanotherforum.internal:8080/api/Attachments/GetAttachment?attachmentId=2147483647"` - Confirm the server returns an error response and that a row has been written to `dbo.EventLog` containing the attacker-controlled `UserAgent` value inside the JSON `Description`. - As an administrator (e.g., `Superuser`), navigate to `/Admin/EventLog`. - Observe that the rendered page contains the raw `<img src=x onerror="alert('XSS')">` element inside the event's badge block, and that the `onerror` handler executes in the admin's authenticated session, confirming cross-session, cross-privilege script execution from an unauthenticated source. <img width="1193" height="809" alt="image" src="https://github.com/user-attachments/assets/70c59ef2-8d31-435b-9a9d-338f753e58f8" />

CVE-2026-43938 Affected YAFNET.Core Versions

2 component(s)
Fixed Versions:
4.0.53.2.12
Product / Package Ecosystem Affected Versions Fixed Version
YAFNET.Core
NuGet
≥ 4.0.0-beta01
< 4.0.5
4.0.5
YAFNET.Core
NuGet
< 3.2.12
3.2.12

References

Frequently Asked Questions

What is CVE-2026-43938?
CVE-2026-43938 is a security vulnerability in YAFNET.Core involving YAFNET has Unauthenticated Stored Second-Order XSS in Admin Event Log via Reflected `User-Agent` Header under CWE-116: Improper Encoding or Escaping of Output.
Which YAFNET.Core versions are affected?
Affected versions include releases prior to 4.0.5, 3.2.12 across affected packages: YAFNET.Core.
What version fixes CVE-2026-43938?
Upgrading to 4.0.5, 3.2.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is YAFNET.Core affected?
Yes, YAFNET.Core is affected in releases prior to 4.0.5, 3.2.12. Upgrade your dependency to 4.0.5, 3.2.12 or later.
What is the CVSS score of CVE-2026-43938?
CVE-2026-43938 has a CVSS v3.1 base score of 8.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-43938?
CVE-2026-43938 is classified under CWE-116: Improper Encoding or Escaping of Output (The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.).
How can I check NuGet dependencies for CVE-2026-43938?
Run the dependency tree command: 'inspect dependencies for YAFNET.Core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-33gv-fc78-qgf5",
  "modified" : "2026-05-13T16:24:19Z",
  "published" : "2026-05-05T20:31:36Z",
  "aliases" : [ "CVE-2026-43938" ],
  "summary" : "YAFNET has Unauthenticated Stored Second-Order XSS in Admin Event Log via Reflected `User-Agent` Header",
  "details" : "**Description:**\nStored (second-order) Cross-Site Scripting (XSS) occurs when attacker-controlled input is persisted through one component of an application and later rendered, without proper sanitization or contextual output encoding, by a completely different component — often one that implicitly trusts the stored data. Because the dangerous sink is typically a privileged administrative interface, the payload executes in the browser of a high-value user (such as an administrator) and inherits their authenticated session. This class of issue is especially severe when the entry point is an HTTP header on an unauthenticated endpoint, since the attack surface extends to any anonymous attacker on the internet with no prerequisites.\n\n**Issue Details:**\nThe 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`. Critically, the attacker does not need to be authenticated: the unauthenticated endpoint `GET /api/Attachments/GetAttachment?attachmentId=2147483647` reliably triggers a server-side exception that is written to `dbo.EventLog` together with the attacker-controlled `User-Agent`. A single anonymous request such as `curl -A \"<img src=x onerror=alert('XSS')>\" \"http://<target>/api/Attachments/GetAttachment?attachmentId=2147483647\"` is sufficient to persist the payload, and when an administrator later visits `/Admin/EventLog` the malicious markup is rendered as live HTML in the admin's authenticated session.\n\n**Impact:**\nAn entirely unauthenticated attacker, with no account, no CSRF token, and no prior access, can stage JavaScript that will execute in an administrator's browser the next time the Event Log is viewed. Because the script runs in the admin's authenticated origin, it can perform any action the admin can: creating new administrative accounts, modifying site-wide settings, exfiltrating user data through admin-only endpoints. This effectively converts a single anonymous HTTP request into a full forum-takeover primitive, and the lack of any authentication requirement makes it exploitable at internet scale, including by automated scanners.\n\n**Likelihood:**\nExploitation requires only the ability to send a single HTTP request to a public, unauthenticated endpoint, which any anonymous attacker on the internet can do. Administrators routinely review the Event Log as part of normal operations, so payload delivery is highly probable with negligible attacker effort, making the overall likelihood very high.\n\n**Steps to Reproduce:**\n- From an unauthenticated session (no cookies, no tokens), send the following request with a malicious `User-Agent` header:\n  - `curl.exe -sS -A \"<img src=x onerror=alert('XSS')>\" \"http://yetanotherforum.internal:8080/api/Attachments/GetAttachment?attachmentId=2147483647\"`\n- Confirm the server returns an error response and that a row has been written to `dbo.EventLog` containing the attacker-controlled `UserAgent` value inside the JSON `Description`.\n- As an administrator (e.g., `Superuser`), navigate to `/Admin/EventLog`.\n- Observe that the rendered page contains the raw `<img src=x onerror=\"alert('XSS')\">` element inside the event's badge block, and that the `onerror` handler executes in the admin's authenticated session, confirming cross-session, cross-privilege script execution from an unauthenticated source.\n\n<img width=\"1193\" height=\"809\" alt=\"image\" src=\"https://github.com/user-attachments/assets/70c59ef2-8d31-435b-9a9d-338f753e58f8\" />",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "YAFNET.Core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0-beta01"
      }, {
        "fixed" : "4.0.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.0.4"
    }
  }, {
    "package" : {
      "ecosystem" : "NuGet",
      "name" : "YAFNET.Core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.2.11"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/YAFNET/YAFNET/security/advisories/GHSA-33gv-fc78-qgf5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-43938"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/YAFNET/YAFNET"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/YAFNET/YAFNET/releases/tag/v3.2.12"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/YAFNET/YAFNET/releases/tag/v4.0.5"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-116", "CWE-79", "CWE-80" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T20:31:36Z",
    "nvd_published_at" : "2026-05-12T15:16:15Z"
  }
}