Find, fix and prevent vulnerabilities in your code.
high severity
new
- Vulnerable module: next
- Introduced through: next@14.2.26
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › next@14.2.26Remediation: Upgrade to next@14.2.34.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Deserialization of Untrusted Data due to unsafe deserialization of payloads from HTTP requests to Server Function endpoints. An attacker can cause the server process to enter an infinite loop and hang, preventing it from serving future HTTP requests by sending specially crafted payloads.
Notes:
Even if your app does not implement any React Server Function endpoints it may still be vulnerable if your app supports React Server Components.
If your app’s React code does not use a server, your app is not affected by these vulnerabilities. If your app does not use a framework, bundler, or bundler plugin that supports React Server Components, your app is not affected by these vulnerabilities.
For React Native users not using a monorepo or react-dom, your react version should be pinned in your package.json, and there are no additional steps needed.
If you are using React Native in a monorepo, you should update only the impacted packages if they are installed: react-server-dom-webpack, react-server-dom-parcel, react-server-dom-turbopack. This is required to mitigate the security advisories, but you do not need to update react and react-dom so this will not cause the version mismatch error in React Native. See this issue for more information.
Details
Serialization is a process of converting an object into a sequence of bytes which can be persisted to a disk or database or can be sent through streams. The reverse process of creating object from sequence of bytes is called deserialization. Serialization is commonly used for communication (sharing objects between multiple hosts) and persistence (store the object state in a file or a database). It is an integral part of popular protocols like Remote Method Invocation (RMI), Java Management Extension (JMX), Java Messaging System (JMS), Action Message Format (AMF), Java Server Faces (JSF) ViewState, etc.
Deserialization of untrusted data (CWE-502) is when the application deserializes untrusted data without sufficiently verifying that the resulting data will be valid, thus allowing the attacker to control the state or the flow of the execution.
Remediation
Upgrade next to version 14.2.34, 15.0.6, 15.1.10, 15.2.7, 15.3.7, 15.4.9, 15.5.8, 16.0.9, 16.1.0-canary.19 or higher.
References
high severity
- Vulnerable module: next
- Introduced through: next@14.2.26
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › next@14.2.26Remediation: Upgrade to next@14.2.32.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the resolve-routes. An attacker can access internal resources and potentially exfiltrate sensitive information by crafting requests containing user-controlled headers (e.g.,
Location) that are forwarded or interpreted without validation.
Note: This is only exploitable if custom middleware logic is implemented in a self-hosted deployment. The project maintainers recommend using the documented NextResponse.next({request}) to explicitly pass the request object.
Remediation
Upgrade next to version 14.2.32, 15.4.2-canary.43, 15.4.7 or higher.
References
medium severity
- Vulnerable module: cookie
- Introduced through: @edgestore/react@0.1.7 and @edgestore/server@0.1.7
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › @edgestore/react@0.1.7 › cookie@0.5.0
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › @edgestore/server@0.1.7 › cookie@0.5.0
Overview
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the cookie name, path, or domain, which can be used to set unexpected values to other cookie fields.
Workaround
Users who are not able to upgrade to the fixed version should avoid passing untrusted or arbitrary values for the cookie fields and ensure they are set by the application instead of user input.
Details
Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
Types of attacks
There are a few methods by which XSS can be manipulated:
| Type | Origin | Description |
|---|---|---|
| Stored | Server | The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
| Reflected | Server | The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
| DOM-based | Client | The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
| Mutated | The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
Affected environments
The following environments are susceptible to an XSS attack:
- Web servers
- Application servers
- Web application environments
How to prevent
This section describes the top best practices designed to specifically protect your code:
- Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
- Convert special characters such as
?,&,/,<,>and spaces to their respective HTML or URL encoded equivalents. - Give users the option to disable client-side scripts.
- Redirect invalid requests.
- Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
- Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
- Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
Remediation
Upgrade cookie to version 0.7.0 or higher.
References
medium severity
- Vulnerable module: next
- Introduced through: next@14.2.26
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › next@14.2.26Remediation: Upgrade to next@14.2.31.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Use of Cache Containing Sensitive Information in the image optimization process, when responses from API routes vary based on request headers such as Cookie or Authorization. An attacker can gain unauthorized access to sensitive image data by exploiting cache key confusion, causing responses intended for authenticated users to be served to unauthorized users.
Note: Exploitation requires a prior authorized request to populate the cache.
Remediation
Upgrade next to version 14.2.31, 15.4.2-canary.19, 15.4.5 or higher.
References
medium severity
- Module: @blocknote/core
- Introduced through: @blocknote/core@0.9.6 and @blocknote/react@0.9.6
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › @blocknote/core@0.9.6
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › @blocknote/react@0.9.6 › @blocknote/core@0.9.6
MPL-2.0 license
medium severity
- Module: @blocknote/react
- Introduced through: @blocknote/react@0.9.6
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › @blocknote/react@0.9.6
MPL-2.0 license
low severity
- Vulnerable module: next
- Introduced through: next@14.2.26
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › next@14.2.26Remediation: Upgrade to next@14.2.30.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Missing Origin Validation in WebSockets when running next dev and the project uses the App Router. An attacker can access the source code of client components by exploiting the Cross-site WebSocket hijacking (CSWSH) attack when a user visits a malicious link while having the server running locally.
Workarounds
Avoid browsing untrusted websites while running the local development server.
Implement local firewall or proxy rules to block unauthorized WebSocket access to localhost.
Remediation
Upgrade next to version 14.2.30, 15.2.2 or higher.
References
low severity
- Vulnerable module: next
- Introduced through: next@14.2.26
Detailed paths
-
Introduced through: nextjs14-notion@ladunjexa/nextjs14-notion#c6f170be5e0e3e10848e0104bdc542737e20f579 › next@14.2.26Remediation: Upgrade to next@14.2.31.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Missing Source Correlation of Multiple Independent Data in image-optimizer. An attacker can cause arbitrary files to be downloaded with attacker-controlled content and filenames by supplying malicious external image sources.
Note: This is only exploitable if the application is configured to allow external image sources via the images.domains or images.remotePatterns configuration.
Remediation
Upgrade next to version 14.2.31, 15.4.2-canary.19, 15.4.5 or higher.