René's URL Explorer Experiment


Title: fix(executor): stop resolved data from breaking out of generated condition and function code by icecrasher321 · Pull Request #7300 · simstudioai/sim · GitHub

Open Graph Title: fix(executor): stop resolved data from breaking out of generated condition and function code by icecrasher321 · Pull Request #7300 · simstudioai/sim

X Title: fix(executor): stop resolved data from breaking out of generated condition and function code by icecrasher321 · Pull Request #7300 · simstudioai/sim

Description: Problem A Condition expression is compiled by inlining each resolved reference into the author's JavaScript as source text. The literal that gets emitted only ever anticipated the quoting it chose itself — it escapes \, ', and line terminators, then wraps in '…' — but the author's quoting decides which context the value actually lands in. So trigger data (webhook body, chat message, form field) could close the author's string and execute: author : "".includes('urgent') payload : " + (globalThis.__pwned = Object.keys(environmentVariables).join(",")) + " resolved: "'" + (globalThis.__pwned = Object.keys(environmentVariables).join(",")) + "'".includes('urgent') verdict : {"matchedIndex":0} ← branch still matched, run continued __pwned : OPENAI_API_KEY,DB_URL ← injected code ran That runs in the condition sandbox, which is handed the run's whole decrypted environment ({...personalDecrypted, ...workspaceDecrypted} from execution-core.ts) as the environmentVariables global, inside an async wrapper where await fetch(...) is available. The branch verdict is unaffected, so nothing in the run log shows it happened. Four shapes reached it — double-quoted, template literal, regex literal, and a crafted key on a quoted object reference. The dangerous ones are the shapes that also behave correctly with benign data, so they survive in production: "".includes(…), "".toLowerCase().includes(…), ``.length > n, //.test(…). ("" === "admin" injects too, but is always false even benignly, so an author would have abandoned it.) A bare === 'admin' was never vulnerable, and '' === 'admin' is a syntax error today, so it never ships. Same root cause, second site: Function blocks bind block outputs as runtime context variables (safe), but inlined the remaining resolved values as literals. A Variables block can assign trigger data into a workflow variable at runtime, and WorkflowResolver reads the live map — so const x = '' spliced attacker text into code. Loop items reached the same path, in JavaScript, Python, and shell. Fix Conditions — one shared literal formatter, no behavior change. escapeInertStringContent escapes every terminator of every JavaScript string context, not just the one the emitted literal opens. \", \`, \$, and \/ are identity escapes, so a condition compares byte-for-byte what it compared before; only its ability to parse as anything but data changes. Both condition formatters use it — resolveTemplateWithoutConditionFormatting (the live path) and stringifyForCondition (the fallback, which had the mirrored blind spot: wraps in ", escaped only "). Deliberately not the quote-context rewrite (getCodeStringQuoteContext + quote + JSON.stringify(v) + quote) that the code-block path uses: it would make "" === "admin" start matching where today it is always false. That is the correct long-term semantics, but it re-routes live workflows and belongs in its own announced change, not a security patch. A quoted object reference additionally escapes its JSON, since JSON's own structural quotes close the author's string. In expression position the JSON stays a literal (unchanged). In a quoted position the previous output was either a syntax error or an injection, so the escaped form is the only reading that was not already broken. Function blocks — bind instead of splice. Resolved values now bind as context variables like block outputs always have. Same runtime value, never source. Two exceptions stay inline: numbers/booleans/null (digits and keywords cannot terminate a literal), and a string that names an environment variable and carries no quote — that shape has to stay in source because the placeholder, never the secret, is what is inlined, and the execution-boundary compiler binds it downstream (this is how reaches its value). Defence in depth. Condition evaluation stops shipping the full secret map to the sandbox: it mounts only the names its script references (secretScope: 'selected'). A script that reads the environmentVariables global directly keeps the full map, so nothing that works today breaks. Tests resolver.test.ts — 5 quotings × 4 payloads must not execute; a crafted-key object must not close the string it is quoted inside; bare and quoted references must still compare what they compared before (including values carrying ", $, /). Both injection tests were confirmed to fail without their respective fix. condition-handler.test.ts — mounts only named secrets, denies all when none are named, keeps all for direct environmentVariables access. block.test.ts — the fallback formatter escapes the quotes it does not open. One existing assertion updated: the navigated manifest element now binds rather than splices (contextVariables holds the element, never the manifest or its array). bun run test (apps/sim), bun run type-check, biome check, and bun run check:api-validation all pass. Blast radius Bare references (the documented form, > 75) are byte-identical. Quoted references keep the same runtime value. Function-block generated code changes shape for spliced scalars/strings — values and display source are unchanged. Quoted object references in conditions change from "syntax error / injectable" to "well-formed string compare".

Open Graph Description: Problem A Condition expression is compiled by inlining each resolved reference into the author's JavaScript as source text. The literal that gets emitted only ever anticipated the quoting it ch...

X Description: Problem A Condition expression is compiled by inlining each resolved reference into the author's JavaScript as source text. The literal that gets emitted only ever anticipated the quoting i...

Opengraph URL: https://github.com/simstudioai/sim/pull/7300

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:583dde84-44ae-d5ce-b313-8ce4a2a8ec4f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB404:47529:D143A:12B941:6AFB2EC5
html-safe-nonce346163aeee2b7c8665436823774c8767ea8527f2a90bb80cacb3692d8fa6336d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDA0OjQ3NTI5OkQxNDNBOjEyQjk0MTo2QUZCMkVDNSIsInZpc2l0b3JfaWQiOiI2MTczNTg1MDAwOTI3ODAxMDI5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf2a9619f5dc29829e5268a9dd2dc4ae2df2d0cb27256ee1af890600a9e55c7f7
hovercard-subject-tagpull_request:4405968433
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7300/files
twitter:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/17950982?s=400&v=4
og:image:altProblem A Condition expression is compiled by inlining each resolved reference into the author's JavaScript as source text. The literal that gets emitted only ever anticipated the quoting it ch...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None40c7ffe00e8bbb3ca8403c83d7ef110379c9eba2cbc7a7c333b037ffd940d4e4
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef494d77c37809e03e18d49c6e9945c57e0b64070
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7300/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7300%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7300%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/7300/files
Reloadhttps://github.com/simstudioai/sim/pull/7300/files
Reloadhttps://github.com/simstudioai/sim/pull/7300/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
icecrasher321https://github.com/icecrasher321
staginghttps://github.com/simstudioai/sim/tree/staging
fix/condition-expression-injectionhttps://github.com/simstudioai/sim/tree/fix/condition-expression-injection
Conversation 106 https://github.com/simstudioai/sim/pull/7300
Commits 13 https://github.com/simstudioai/sim/pull/7300/commits
Checks 27 https://github.com/simstudioai/sim/pull/7300/checks
Files changed https://github.com/simstudioai/sim/pull/7300/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7300/files
fix(executor): stop resolved data from breaking out of generated condition and function code https://github.com/simstudioai/sim/pull/7300/files#top
Show all changes 13 commits https://github.com/simstudioai/sim/pull/7300/files
3f10365 fix(executor): stop resolved data from breaking out of generated code Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/3f10365d62a9d2141ad55a9f72a18029189b6f6a
bf0a80c fix(executor): parse condition objects instead of splicing their JSON Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/bf0a80c1abf16252717f04c4270bc96e6340a761
73bba51 fix(executor): widen the condition environment read to any mention Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/73bba519e87244ed11c1c62d1aa317ca827d9fd5
c28a7e4 fix(executor): teach the code scanner about regex literals Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/c28a7e4bc3c9c385a2f884e1ed292044ba997949
47da972 fix(executor): keep resolved data out of the condition secret decision Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/47da972c76fb958246da241630c912ad947398dd
184460a fix(executor): read what a closing parenthesis closed Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/184460ad795aadd37a73005d5fbfeb45834a0116
d5c2b89 fix(executor): decide the environment read from the author's own text Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/d5c2b892ccbc10bc613ea2a3d7eb9a2e527acce3
4fb3027 fix(executor): do not read a keyword-named method as a control-flow head Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/4fb30274941463fb08ed6bcb3df3abffe4c32328
82a80c3 fix(executor): keep a caller from choosing which secret expands Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/82a80c3d5d648c598b6af28337650ab8cde31083
39bb39d fix(executor): step over comments instead of reading them as tokens Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/39bb39df1d9b4c0a74cf702e37c6b80a40a264ba
4a6ced5 fix(executor): take the preceding token from the scan, not from a wal… Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/4a6ced56f0307d8c72207a25d2b8f2d39c10c3fc
522980c fix(executor): divide after a postfix update Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/522980cfa64ce16138c2a48f7033e8f415500365
ea25c3c fix(executor): start a new identifier at the character before it Aug 31, 2026 https://github.com/simstudioai/sim/pull/7300/commits/ea25c3ce2cc971c273f37d2c1bac3f51245a0134
Clear filters https://github.com/simstudioai/sim/pull/7300/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7300/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7300/files
condition-handler.test.ts https://github.com/simstudioai/sim/pull/7300/files#diff-064a4bb886fba11b872087b9ced2f91da3c38abcf15f14af2c7d557c2b1db882
condition-handler.ts https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
code-formatting.ts https://github.com/simstudioai/sim/pull/7300/files#diff-39437df9f54ae1d64b19b53cbd39e025395422f747e02bad5bbac80fcad06bb4
resolver.test.ts https://github.com/simstudioai/sim/pull/7300/files#diff-2fa26b2dbc26ddf18b930cacd45e8f8785bea1a3c1183192cbb19678ea81b649
resolver.ts https://github.com/simstudioai/sim/pull/7300/files#diff-689d75b70daf1f65a0914798bb39ad228e6918dc990978d09a349acfe0ca22f6
block.test.ts https://github.com/simstudioai/sim/pull/7300/files#diff-8503dd8744c64603659c82c08b6dd1a9863b8d28bba58e34fe3e6a93b725da8b
block.ts https://github.com/simstudioai/sim/pull/7300/files#diff-14253186b01590e9d16564de9e0a1a9fc69546106c14d3979017aa04adda0403
apps/sim/executor/handlers/condition/condition-handler.test.tshttps://github.com/simstudioai/sim/pull/7300/files#diff-064a4bb886fba11b872087b9ced2f91da3c38abcf15f14af2c7d557c2b1db882
View file https://github.com/simstudioai/sim/blob/ea25c3ce2cc971c273f37d2c1bac3f51245a0134/apps/sim/executor/handlers/condition/condition-handler.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7300/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7300/files#diff-064a4bb886fba11b872087b9ced2f91da3c38abcf15f14af2c7d557c2b1db882
https://github.com/simstudioai/sim/pull/7300/files#diff-064a4bb886fba11b872087b9ced2f91da3c38abcf15f14af2c7d557c2b1db882
apps/sim/executor/handlers/condition/condition-handler.tshttps://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
View file https://github.com/simstudioai/sim/blob/ea25c3ce2cc971c273f37d2c1bac3f51245a0134/apps/sim/executor/handlers/condition/condition-handler.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7300/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
https://github.com/simstudioai/sim/pull/7300/files#diff-59b85c48f9cbcee6cddb93179ee9a261f9174a720f75ec87c584be23f1459ab5
apps/sim/executor/utils/code-formatting.tshttps://github.com/simstudioai/sim/pull/7300/files#diff-39437df9f54ae1d64b19b53cbd39e025395422f747e02bad5bbac80fcad06bb4
View file https://github.com/simstudioai/sim/blob/ea25c3ce2cc971c273f37d2c1bac3f51245a0134/apps/sim/executor/utils/code-formatting.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7300/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7300/files#diff-39437df9f54ae1d64b19b53cbd39e025395422f747e02bad5bbac80fcad06bb4
Please reload this pagehttps://github.com/simstudioai/sim/pull/7300/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7300/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.