Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/vault/controller/connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,12 @@ class ConnectionController {
invokeRequest.pathParams,
invokeRequest.queryParams,
);
// Ensure that substituting user-controlled pathParams/queryParams did not
// change the request's destination (host/origin), preventing SSRF via
// injected values such as "@evil.com" or "../" in a path param.
if (new URL(filledUrl).origin !== new URL(this.client.url).origin) {
throw new Error("Invalid connection URL: destination origin mismatch");
}
getBearerToken(this.client.getCredentials(), this.logLevel)
.then((token) => {
printLog(
Expand Down