Skip to content

harden: add URL validation in index.ts (CWE-918) - #345

Open
anupamme wants to merge 1 commit into
skyflowapi:mainfrom
anupamme:fix-repo-skyflow-node-multi-agent-cwe-918-src-vault-controller-connections-index-ts
Open

anupamme wants to merge 1 commit into
skyflowapi:mainfrom
anupamme:fix-repo-skyflow-node-multi-agent-cwe-918-src-vault-controller-connections-index-ts

Conversation

@anupamme

Copy link
Copy Markdown

The connections controller dynamically constructs URLs using fillUrlWithPathAndQueryParams() with user-controlled pathParams and queryParams, then passes the result to fetch() without validating the final URL. While the base URL is validated via isValidURL(), the path and query parameter injection could manipulate the request destination. This is defence-in-depth at src/vault/controller/connections/index.ts:236 rather than a vulnerability I can show is exploitable here — it makes the failure mode explicit and bounded. Close it freely if the pattern is intentional.

Reference: CWE-918

What changed

  • src/vault/controller/connections/index.ts

Verification

No automated check could be run against this repository, so this change is unverified beyond review. Please treat it as a suggestion.

The connections controller dynamically constructs URLs using fillUrlWithPathAndQueryParams() with user-controlled pathParams and queryParams, then passes the result to fetch() without validating the final URL
Addresses CWE-918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant