Skip to content

v0.4.23: webflow tools + triggers, copilot api key fix - #1723

Merged
waleedlatif1 merged 7 commits into
mainfrom
staging
Oct 23, 2025
Merged

waleedlatif1 merged 7 commits into
mainfrom
staging

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

icecrasher321 and others added 7 commits October 22, 2025 00:49
…d, add empty state when selected cell has no data (#1719)

* fix(dashboard): add additional context for paginated logs in dashboard, add empty state when selected cell has no data

* apps/sim

* renaming

* remove relative import
* feat(tools): added webflow OAuth + tools

* remove itemId from delete item

* remove siteId

* added webhook triggers + oauth scopes + site/collection selector

* update sample payload for webflow triggers

* cleanup

* fix discord color
@greptile-apps

greptile-apps Bot commented Oct 23, 2025

Copy link
Copy Markdown
Contributor

Skipped: This PR changes more files than the configured file change limit: (100)

@vercel

vercel Bot commented Oct 23, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Oct 23, 2025 9:44pm

Comment on lines +33 to +38
const response = await fetch(`https://api.webflow.com/v2/sites/${siteId}/collections`, {
headers: {
Authorization: `Bearer ${accessToken}`,
accept: 'application/json',
},
})

Check failure

Code scanning / CodeQL

Server-side request forgery

The [URL](1) of this request depends on a [user-provided value](2).

Copilot Autofix

AI about 1 year ago

To fix the SSRF vulnerability, we must validate/sanitize the siteId parameter before using it in the outgoing request path. The most robust solution is to restrict siteId to only allowed values:

  1. If possible, select the value from an explicit allow-list or lookup dictionary keyed by user input (e.g. valid site IDs for that user from your database).
  2. If an allow-list is impractical, restrict the format using a strict regular expression. For example, if Webflow site IDs are known to be UUIDs, only allow values matching a UUID regex. Alternatively, permit only alphanumerics and hyphens, and explicitly reject path traversal attempts (for example, deny values containing /, \, or ..).

Edit lines in the file apps/sim/app/api/tools/webflow/collections/route.ts:

  • Right after reading siteId, add a validation step: reject the request if the input does not conform to the expected format.
  • Optionally, add a comment/explanation for maintainers stating the SSRF prevention rationale.

No external packages need to be added; use a regular expression for format validation.


Suggested changeset 1
apps/sim/app/api/tools/webflow/collections/route.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/apps/sim/app/api/tools/webflow/collections/route.ts b/apps/sim/app/api/tools/webflow/collections/route.ts
--- a/apps/sim/app/api/tools/webflow/collections/route.ts
+++ b/apps/sim/app/api/tools/webflow/collections/route.ts
@@ -20,7 +20,14 @@
     if (!siteId) {
       return NextResponse.json({ error: 'Missing siteId parameter' }, { status: 400 })
     }
-
+    // SSRF mitigation: Only allow siteId values matching a strict UUID pattern (Webflow site IDs are UUIDs)
+    // Adjust the regex if siteId format differs (e.g. only allow alphanumerics and hyphens)
+    if (
+      typeof siteId !== 'string' ||
+      !/^[a-f0-9-]{36}$/i.test(siteId)
+    ) {
+      return NextResponse.json({ error: 'Invalid siteId parameter' }, { status: 400 })
+    }
     const accessToken = await getOAuthToken(session.user.id, 'webflow')
 
     if (!accessToken) {
EOF
@@ -20,7 +20,14 @@
if (!siteId) {
return NextResponse.json({ error: 'Missing siteId parameter' }, { status: 400 })
}

// SSRF mitigation: Only allow siteId values matching a strict UUID pattern (Webflow site IDs are UUIDs)
// Adjust the regex if siteId format differs (e.g. only allow alphanumerics and hyphens)
if (
typeof siteId !== 'string' ||
!/^[a-f0-9-]{36}$/i.test(siteId)
) {
return NextResponse.json({ error: 'Invalid siteId parameter' }, { status: 400 })
}
const accessToken = await getOAuthToken(session.user.id, 'webflow')

if (!accessToken) {
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@waleedlatif1
waleedlatif1 merged commit 9b2490c into main Oct 23, 2025
1 check passed

This branch was previously deployed

1 inactive deployment
Preview — dba75143 Deployed Oct 23, 2025 by vercel[bot]
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.

3 participants