CVE-2023-46729: @sentry/nextjs Sentry Next.js Vulnerable To SSRF Vulnerability

MODERATE
Advisory Identifier: GHSA-2rmr-xw8m-22q9
CVSS 6.1
CWE-918
Published
Advisory Summary

CVE-2023-46729 is a MODERATE (CVSS 6.1) sentry next.js vulnerable to ssrf vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting @sentry/nextjs libraries in the npm ecosystem. The issue involves sentry next.js vulnerable to ssrf via next.js sdk tunnel endpoint. Remediation is available by upgrading affected packages to version 7.77.0.

CVE-2023-46729 at a Glance

CVE Identifier CVE-2023-46729
GHSA Identifier GHSA-2rmr-xw8m-22q9
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product @sentry/nextjs
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:L/A:N).

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 Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-46729

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

@sentry/nextjs fixed: 7.77.0
npm install @sentry/nextjs@7.77.0
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 @sentry/nextjs

How to Check if You Are Affected

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

npm ls @sentry/nextjs

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

Note: The npm ls @sentry/nextjs 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In @sentry/nextjs, 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 An unsanitized input of Next.js SDK tunnel endpoint allows sending HTTP requests to arbitrary URLs and reflecting the response back to the user. This could open door for other attack vectors: * client-side vulnerabilities: XSS/CSRF in the context of the trusted domain; * interaction with internal network; * read cloud metadata endpoints (AWS, Azure, Google Cloud, etc.); * local/remote port scan. This issue only affects users who have [Next.js SDK tunneling feature](https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-tunneling-to-avoid-ad-blockers) enabled. ### Patches The problem has been fixed in [sentry/nextjs@7.77.0](https://www.npmjs.com/package/@sentry/nextjs/v/7.77.0) ### Workarounds Disable tunneling by removing the `tunnelRoute` option from Sentry Next.js SDK config — `next.config.js` or `next.config.mjs`. ### References * [Sentry Next.js tunneling feature](https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-tunneling-to-avoid-ad-blockers) * [The fix](https://github.com/getsentry/sentry-javascript/pull/9415) * [More Information](https://blog.sentry.io/next-js-sdk-security-advisory-cve-2023-46729/) ### Credits * [Praveen Kumar](https://hackerone.com/mr_x_strange)

CVE-2023-46729 Affected @sentry/nextjs Versions

1 component(s)
Fixed Versions:
7.77.0
Product / Package Ecosystem Affected Versions Fixed Version
@sentry/nextjs
npm
≥ 7.26.0
< 7.77.0
7.77.0

References

Frequently Asked Questions

What is CVE-2023-46729?
CVE-2023-46729 is a security vulnerability in @sentry/nextjs involving Sentry Next.js vulnerable to SSRF via Next.js SDK tunnel endpoint under CWE-918: Server-Side Request Forgery (SSRF).
Which @sentry/nextjs versions are affected?
Affected versions include releases prior to 7.77.0 across affected packages: @sentry/nextjs.
What version fixes CVE-2023-46729?
Upgrading to 7.77.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @sentry/nextjs affected?
Yes, @sentry/nextjs is affected in releases prior to 7.77.0. Upgrade your dependency to 7.77.0 or later.
What is the CVSS score of CVE-2023-46729?
CVE-2023-46729 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:L/A:N.
What CWE is associated with CVE-2023-46729?
CVE-2023-46729 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2023-46729?
Run the dependency tree command: 'npm ls @sentry/nextjs'. 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-2rmr-xw8m-22q9",
  "modified" : "2023-11-17T21:55:44Z",
  "published" : "2023-11-09T22:03:44Z",
  "aliases" : [ "CVE-2023-46729" ],
  "summary" : "Sentry Next.js vulnerable to SSRF via Next.js SDK tunnel endpoint",
  "details" : "### Impact\nAn unsanitized input of Next.js SDK tunnel endpoint allows sending HTTP requests to arbitrary URLs and reflecting the response back to the user. This could open door for other attack vectors:\n* client-side vulnerabilities: XSS/CSRF in the context of the trusted domain;\n* interaction with internal network;\n* read cloud metadata endpoints (AWS, Azure, Google Cloud, etc.);\n* local/remote port scan.\n\nThis issue only affects users who have [Next.js SDK tunneling feature](https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-tunneling-to-avoid-ad-blockers) enabled.\n\n### Patches\nThe problem has been fixed in [sentry/nextjs@7.77.0](https://www.npmjs.com/package/@sentry/nextjs/v/7.77.0)\n\n### Workarounds\nDisable tunneling by removing the `tunnelRoute` option from Sentry Next.js SDK config — `next.config.js` or `next.config.mjs`.\n\n### References\n* [Sentry Next.js tunneling feature](https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-tunneling-to-avoid-ad-blockers)\n* [The fix](https://github.com/getsentry/sentry-javascript/pull/9415)\n* [More Information](https://blog.sentry.io/next-js-sdk-security-advisory-cve-2023-46729/)\n\n### Credits\n* [Praveen Kumar](https://hackerone.com/mr_x_strange)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@sentry/nextjs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.26.0"
      }, {
        "fixed" : "7.77.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry-javascript/security/advisories/GHSA-2rmr-xw8m-22q9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46729"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry-javascript/pull/9415"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry-javascript/commit/ddbda3c02c35aba8c5235e0cf07fc5bf656f81be"
  }, {
    "type" : "WEB",
    "url" : "https://blog.sentry.io/next-js-sdk-security-advisory-cve-2023-46729"
  }, {
    "type" : "WEB",
    "url" : "https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-tunneling-to-avoid-ad-blockers"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getsentry/sentry-javascript"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@sentry/nextjs/v/7.77.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-11-09T22:03:44Z",
    "nvd_published_at" : "2023-11-10T01:15:07Z"
  }
}