CVE-2026-35515: @nestjs/core @nestjs/core Improperly Neutralizes Special Elements Vulnerability

MODERATE
Advisory Identifier: GHSA-36xv-jgw5-4q75
CVSS 6.1
CWE-74
Published
Advisory Summary

CVE-2026-35515 is a MODERATE (CVSS 6.1) @nestjs/core improperly neutralizes special elements vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting @nestjs/core libraries in the npm ecosystem. The issue involves @nestjs/core improperly neutralizes special elements in output used by a downstream component ('injection'). Remediation is available by upgrading affected packages to version 11.1.18.

CVE-2026-35515 at a Glance

CVE Identifier CVE-2026-35515
GHSA Identifier GHSA-36xv-jgw5-4q75
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product @nestjs/core
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.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:C/C:L/I:N/A:L).

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

How to Fix CVE-2026-35515

To remediate this vulnerability, upgrade all affected @nestjs/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.

@nestjs/core fixed: 11.1.18
npm install @nestjs/core@11.1.18
Verify Direct and Transitive Dependencies

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

npm ls @nestjs/core

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-35515, inspect your project dependencies using npm:

npm ls @nestjs/core

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

Note: The npm ls @nestjs/core command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In @nestjs/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

### Impact _What kind of vulnerability is it? Who is impacted?_ [`SseStream._transform()`](https://github.com/nestjs/nest/blob/dea5279ef8fcb568de158003e4281759a2cd7675/packages/core/router/sse-stream.ts) interpolates `message.type` and `message.id` directly into Server-Sent Events text protocol output without sanitizing newline characters (`\r`, `\n`). Since the SSE protocol treats both `\r` and `\n` as field delimiters and `\n\n` as event boundaries, an attacker who can influence these fields through upstream data sources can inject arbitrary SSE events, spoof event types, and corrupt reconnection state. Spring Framework's own security patch ([6e97587](https://github.com/spring-projects/spring-framework/commit/6e9758700a4946be1dca85ca937ef2603e291301)) validates these same fields (`id`, `event`) for the same reason. Actual impact: - **Event spoofing**: Attacker forges SSE events with arbitrary `event:` types, causing client-side `EventSource.addEventListener()` callbacks to fire for wrong event types. - **Data injection**: Attacker injects arbitrary `data:` payloads, potentially triggering XSS if the client renders SSE data as HTML without sanitization. - **Reconnection corruption**: Attacker injects `id:` fields, corrupting the `Last-Event-ID` header on reconnection, causing the client to miss or replay events. - **Attack precondition**: Requires the developer to map user-influenced data to the `type` or `id` fields of SSE messages. Direct HTTP request input does not reach these fields without developer code bridging the gap. - ### Patches _Has the problem been patched? What versions should users upgrade to?_ Patched in `@nestjs/core@11.1.18`

CVE-2026-35515 Affected @nestjs/core Versions

1 component(s)
Fixed Versions:
11.1.18
Product / Package Ecosystem Affected Versions Fixed Version
@nestjs/core
npm
< 11.1.18
11.1.18

References

Frequently Asked Questions

What is CVE-2026-35515?
CVE-2026-35515 is a security vulnerability in @nestjs/core involving @nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection') under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which @nestjs/core versions are affected?
Affected versions include releases prior to 11.1.18 across affected packages: @nestjs/core.
What version fixes CVE-2026-35515?
Upgrading to 11.1.18 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @nestjs/core affected?
Yes, @nestjs/core is affected in releases prior to 11.1.18. Upgrade your dependency to 11.1.18 or later.
What is the CVSS score of CVE-2026-35515?
CVE-2026-35515 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L.
What CWE is associated with CVE-2026-35515?
CVE-2026-35515 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-35515?
Run the dependency tree command: 'npm ls @nestjs/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-36xv-jgw5-4q75",
  "modified" : "2026-04-24T20:46:22Z",
  "published" : "2026-04-06T17:59:51Z",
  "aliases" : [ "CVE-2026-35515" ],
  "summary" : "@nestjs/core Improperly Neutralizes Special Elements in Output Used by a Downstream Component ('Injection')",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\n[`SseStream._transform()`](https://github.com/nestjs/nest/blob/dea5279ef8fcb568de158003e4281759a2cd7675/packages/core/router/sse-stream.ts) interpolates `message.type` and `message.id` directly into Server-Sent Events text protocol output without sanitizing newline characters (`\\r`, `\\n`). Since the SSE protocol treats both `\\r` and `\\n` as field delimiters and `\\n\\n` as event boundaries, an attacker who can influence these fields through upstream data sources can inject arbitrary SSE events, spoof event types, and corrupt reconnection state. Spring Framework's own security patch ([6e97587](https://github.com/spring-projects/spring-framework/commit/6e9758700a4946be1dca85ca937ef2603e291301)) validates these same fields (`id`, `event`) for the same reason.\n\nActual impact:\n\n- **Event spoofing**: Attacker forges SSE events with arbitrary `event:` types, causing client-side `EventSource.addEventListener()` callbacks to fire for wrong event types.\n- **Data injection**: Attacker injects arbitrary `data:` payloads, potentially triggering XSS if the client renders SSE data as HTML without sanitization.\n- **Reconnection corruption**: Attacker injects `id:` fields, corrupting the `Last-Event-ID` header on reconnection, causing the client to miss or replay events.\n- **Attack precondition**: Requires the developer to map user-influenced data to the `type` or `id` fields of SSE messages. Direct HTTP request input does not reach these fields without developer code bridging the gap.\n-\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nPatched in `@nestjs/core@11.1.18`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@nestjs/core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.1.18"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 11.1.17"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/security/advisories/GHSA-36xv-jgw5-4q75"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35515"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/pull/16686"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/commit/83558ae774a990a7916141d3abe0b6548ff3a8b2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/nestjs/nest"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/nestjs/nest/releases/tag/v11.1.18"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T17:59:51Z",
    "nvd_published_at" : "2026-04-07T16:16:27Z"
  }
}