Title: fix(security): enforce URL validation across connectors, providers, and auth flows (SSRF + open-redirect hardening) by waleedlatif1 · Pull Request #4236 · simstudioai/sim · GitHub
Open Graph Title: fix(security): enforce URL validation across connectors, providers, and auth flows (SSRF + open-redirect hardening) by waleedlatif1 · Pull Request #4236 · simstudioai/sim
X Title: fix(security): enforce URL validation across connectors, providers, and auth flows (SSRF + open-redirect hardening) by waleedlatif1 · Pull Request #4236 · simstudioai/sim
Description: Summary Hardens user-controlled URL surfaces across the app against SSRF (server-side forgery to internal metadata endpoints, private IPs, arbitrary hosts) and open-redirect attacks on auth flows. Every fix is centralized through shared validators in @/lib/core/security/input-validation so each consumer is a thin call site. New / updated validators (lib/core/security/input-validation.ts) validateCallbackUrl — rewritten to resolve against a safe server-side base via new URL(), rejecting protocol-relative (//evil.com), backslash/whitespace bypasses, userinfo smuggling (https://safe@evil.com), and non-HTTP schemes while still accepting legitimate same-origin relative/absolute callbacks. validateServiceNowInstanceUrl — delegates HTTPS + private-IP + port checks to validateExternalUrl, then enforces a ServiceNow-owned hostname allowlist. validateWorkdayTenantUrl — same pattern, enforcing *.workday.com and *.myworkday.com (covers sandbox wd[N]-impl-services[N] and production wd[N]-services[N] + customer-facing *.myworkday.com). 60 new tests (363 total) covering valid hosts, lookalike suffixes, userinfo smuggling, private IPs (169.254.169.254, RFC1918), blocked ports, null/empty, malformed URLs, and case-insensitive matching. SSRF fixes at the request chokepoints Workday SOAP (tools/workday/soap.ts) — buildWsdlUrl now calls validateWorkdayTenantUrl before constructing the WSDL URL. This is the single code path for all 10 Workday route handlers, so every operation (get_workers, get_job_postings, submit_time_off, …) is protected without per-route duplication. Uses validation.sanitized so any future normalization (credential stripping, Unicode) flows through automatically. Azure OpenAI / Azure Anthropic providers — validate user-supplied azureEndpoint via validateUrlWithDNS before instantiating the SDK client. Blocks private IPs, localhost in hosted mode, and dangerous ports; env-provided endpoints bypass the check (trusted). ServiceNow connector — resolveServiceNowInstanceUrl runs validateServiceNowInstanceUrl on every listDocuments, fetchDocument, and validateConfig call before any request is made. Obsidian connector — the vault URL is fully user-controlled (no SaaS domain to allowlist since the Obsidian Local REST API plugin runs on the user's own machine). resolveVaultEndpoint runs the isomorphic validateExternalUrl helper, which blocks private IPs and dangerous ports in hosted mode, forces HTTPS, and carves out 127.0.0.1 / localhost for self-hosted deployments only. Known limitation: the Obsidian connector is reachable from client bundles via connectors/registry.ts (the knowledge UI reads .icon/.name), which forces the connector module graph to stay client-safe. This means the DNS-pinned fetch chain (which would also defend against DNS rebinding) cannot live in the connector without pulling dns/promises / http / https into the browser bundle (see commit fa5ab2812). The remaining attack requires an admin-entered hostname that flips between validation and request — narrow because the vault URL is entered by the workspace admin (trusted), and hosted deployments already require exposing the plugin through a public tunnel. Closing this gap will require a registry architecture split (metadata registry for client, handler registry for server), tracked as a follow-up. Open-redirect fixes on auth flows Signup form ((auth)/signup/signup-form.tsx) — redirect and callbackUrl query params pass through validateCallbackUrl; invalid values are dropped and logged. Verify flow ((auth)/verify/use-verification.ts) — both sessionStorage.inviteRedirectUrl and ?redirectAfter= are validated; stored unsafe values are actively removed from sessionStorage. Type of Change Bug fix (security) Testing Ran full input-validation.test.ts suite — 363 tests passing, including 60 new adversarial cases. Ran bunx turbo run build --filter=sim — compiles successfully (remaining NEXT_PUBLIC_APP_URL collect-page-data error is local-env only). Verified Workday URL patterns against Workday documentation: *.workday.com (sandbox + production service endpoints) and *.myworkday.com (customer-facing production endpoints). Walked through adversarial vectors manually: lookalike suffixes (evilworkday.com), embedded substrings (workday.com.evil.com), userinfo smuggling (https://attacker.com@wd5.workday.com), protocol-relative (//evil.com), backslash tricks — all correctly blocked. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Hardens user-controlled URL surfaces across the app against SSRF (server-side forgery to internal metadata endpoints, private IPs, arbitrary hosts) and open-redirect attacks on auth flows. ...
X Description: Summary Hardens user-controlled URL surfaces across the app against SSRF (server-side forgery to internal metadata endpoints, private IPs, arbitrary hosts) and open-redirect attacks on auth flows. ...
Opengraph URL: https://github.com/simstudioai/sim/pull/4236
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ef64d5fc-c1dd-e668-7bfb-3f93bd0cd5f6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | CCC8:18732E:53FBFD:745620:6AFB3C63 |
| html-safe-nonce | 03adc1c2177bfeaaa16b0d1cf802c075fe6cac0d0d327d516f646484a10e0d85 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQ0M4OjE4NzMyRTo1M0ZCRkQ6NzQ1NjIwOjZBRkIzQzYzIiwidmlzaXRvcl9pZCI6IjU3ODAxMDI2OTMwOTEyMjg3NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cb36e6cadd7e7209c36291aaffa1e16d825b9dc56ce7aeeda778450b5f16f142 |
| hovercard-subject-tag | pull_request:3554459427 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/4236/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Hardens user-controlled URL surfaces across the app against SSRF (server-side forgery to internal metadata endpoints, private IPs, arbitrary hosts) and open-redirect attacks on auth flows. ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b4fc8df5ef1c6757e733a23e6b81b6725021823 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width