Repository navigation
v0.5.49: hitl improvements, new email styles, imap trigger, logs context menu - #2672
Conversation
waleedlatif1
commented
Jan 3, 2026
- feat(logs-context-menu): consolidated logs utils and types, added logs record context menu (feat(logs-context-menu): consolidated logs utils and types, added logs record context menu #2659)
- feat(email): welcome email; improvement(emails): ui/ux (feat(email): welcome email; improvement(emails): ui/ux #2658)
- fix(logging): hitl + trigger dev crash protection (fix(logging): hitl + trigger dev crash protection #2664)
- feat(imap): added support for imap trigger (feat(imap): added support for imap trigger #2663)
- feat(i18n): update translations (feat(i18n): update translations #2665)
- fix(grain): updated grain trigger to auto-establish trigger (fix(grain): updated grain trigger to auto-establish trigger #2666)
- feat(admin): routes to manage deployments (feat(admin): routes to manage deployments #2667)
- feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date (feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date #2668)
- improvement(invite): aligned styling (improvement(invite): aligned styling #2669)
…s record context menu (#2659)
* feat(email): welcome email; improvement(emails): ui/ux * improvement(emails): links, accounts, preview * refactor(emails): file structure and wrapper components * added envvar for personal emails sent, added isHosted gate * fixed failing tests, added env mock * fix: removed comment --------- Co-authored-by: waleed <walif6@gmail.com>
* hitl gaps * deal with trigger worker crashes * cleanup import strcuture
* feat(tools): added support for imap trigger * feat(imap): added parity, tested * ack PR comments * final cleanup
Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>
Co-authored-by: aadamgough <adam@sim.ai>
* feat(admin): routes to manage deployments * fix naming fo deployed by
…nd, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date (#2668) * feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date * removed unused params, cleaned up redundant utils
* improvement(invite): aligned with rest of app * fix(invite): error handling * fix: addressed comments
|
Skipped: This PR changes more files than the configured file change limit: ( |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| const grainResponse = await fetch(grainApiUrl, { | ||
| method: 'DELETE', | ||
| headers: { | ||
| Authorization: `Bearer ${apiKey}`, | ||
| 'Content-Type': 'application/json', | ||
| 'Public-Api-Version': '2025-10-31', | ||
| }, | ||
| }) |
Check failure
Code scanning / CodeQL
Server-side request forgery
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 11 months ago
In general, to fix this type of problem you should sanitize or validate any user-controlled data before using it as part of a URL, especially for path components. For identifiers like externalId, the safest approach is to enforce that they match a strict, expected format (for example, alphanumeric plus a few safe punctuation characters) and reject or skip operations when they do not.
The best fix here, without changing overall functionality, is to validate externalId inside deleteGrainWebhook right after reading it from config. The Grain API’s hook IDs are identifiers, not arbitrary URLs, so we can reasonably constrain them to a safe character set (e.g. /^[A-Za-z0-9_-]+$/). If externalId fails this validation, we log a warning and skip the cleanup call rather than sending a possibly malformed path to fetch. This keeps the external behavior for valid IDs unchanged, while preventing attacker-controlled, unexpected path strings from being used.
Concretely, in apps/sim/lib/webhooks/provider-subscriptions.ts, within deleteGrainWebhook:
- Introduce a local regular expression (e.g.
const externalIdPattern = /^[A-Za-z0-9_-]+$/) or inline check. - After the
if (!externalId)early-return, add a block that checksexternalIdagainst this pattern. - If the check fails, log a warning (similar style to existing warnings, including
requestIdandwebhook.id) andreturnearly. - Leave the
grainApiUrlconstruction andfetchcall unchanged for valid IDs.
No changes are needed in apps/sim/app/api/webhooks/route.ts or apps/sim/lib/webhooks/env-resolver.ts, since they do not need to know about Grain-specific ID constraints and already only pass the configuration through.
| @@ -686,6 +686,16 @@ | ||
| return | ||
| } | ||
|
|
||
| // Validate externalId to ensure it is a safe identifier before using it in the URL path | ||
| const externalIdPattern = /^[A-Za-z0-9_-]+$/ | ||
| if (!externalIdPattern.test(externalId)) { | ||
| grainLogger.warn( | ||
| `[${requestId}] Invalid externalId format for Grain webhook deletion ${webhook.id}, skipping cleanup`, | ||
| { externalId } | ||
| ) | ||
| return | ||
| } | ||
|
|
||
| const grainApiUrl = `https://api.grain.com/_/public-api/v2/hooks/${externalId}` | ||
|
|
||
| const grainResponse = await fetch(grainApiUrl, { |