René's URL Explorer Experiment


Title: fix(deploy): prevent code-generation injection from angular.json values by herdiyana256 · Pull Request #3739 · angular/angularfire · GitHub

Open Graph Title: fix(deploy): prevent code-generation injection from angular.json values by herdiyana256 · Pull Request #3739 · angular/angularfire

X Title: fix(deploy): prevent code-generation injection from angular.json values by herdiyana256 · Pull Request #3739 · angular/angularfire

Description: The SSR deploy builders interpolate several angular.json-derived values straight into generated artifacts that are later executed. A server build target's outputPath (read via getTargetOptions) is written raw into the generated Cloud Function index.js as require('./${path}/main') and into the generated package.json start script as node ${path}/main.js. functionName is written raw as the exports.${functionName} assignment target, and region inside a single-quoted literal as .region('${options.region}'), both in the same generated index.js. functionsNodeVersion is written raw into the generated Cloud Run Dockerfile as FROM node:${version}-slim. None of these has any validation. A crafted server outputPath such as x').app(); require('child_process').execSync('...'); (' lands as a standalone statement in index.js and runs on every Cloud Function cold start (and locally during firebase serve preview). A crafted functionName such as ssr; require('child_process').execSync('...'); var _x does the same, with the template's own = becoming that variable's initializer, so the file still parses and the injected call runs when the function loads. A ' in region breaks out of its literal the same way. A crafted functionsNodeVersion injects extra RUN instructions executed during the Cloud Run container build. All are reachable the moment a developer runs ng deploy on a malicious or cloned workspace. These are distinct sinks from the gcloud argv path and the execSync calls addressed separately. The fix Each value is handled in the way that fits where it lands: outputPath: screened by assertSafeOutputPath before code generation, on both build targets and both deploy paths. It is screened rather than escaped because it lands in three different contexts in one run (a JS string literal, the node /main.js start script, and join(workspaceRoot, ...)), so no single encoding fits. The class rejects quotes, backslashes, whitespace, shell metacharacters and globs, plus a leading dash that node would read as a flag. functionName: screened by assertSafeFunctionName, an allowlist of plain JavaScript identifiers, called only in deployToFunction. That is the one path where the value becomes generated JavaScript. On the Cloud Run path the same option is a service ID, where #3726's schema pattern is the right constraint. region: escaped structurally in the template with JSON.stringify, matching what the CF3v2 template already did, so it no longer depends on a screen at all. functionsNodeVersion: screened by assertSafeNodeVersion in deployToCloudRun, before the output directory is touched, plus a schema pattern. A plain version is the only shape either path accepts: firebase-tools resolves engines.node to a nodejs runtime by string concatenation, and Cloud Run uses the value as a node:-slim image tag. The functionName and region schema patterns are owned by #3726, which carries stricter versions of both; this PR keeps only the runtime checks and the template escaping. The TODO above the gcloud calls is restored in narrowed form, covering the three values that genuinely remain unvalidated: firebaseProject, vpcConnector, and the outputPath deploy option. Specs cover each validator directly and drive deployToFunction / deployToCloudRun end-to-end, so every assertSafe* call site turns the suite red if it is removed, and reverting the region escaping does too. npm run test:node and test:node-esm pass (209 specs, 0 failures); ng lint and tsc -p tsconfig.build.json --noEmit are clean.

Open Graph Description: The SSR deploy builders interpolate several angular.json-derived values straight into generated artifacts that are later executed. A server build target's outputPath (read via getTargetOptions)...

X Description: The SSR deploy builders interpolate several angular.json-derived values straight into generated artifacts that are later executed. A server build target's outputPath (read via getTargetOpti...

Opengraph URL: https://github.com/angular/angularfire/pull/3739

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b95284a6-2dbb-db08-5970-ff7105d58032
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id906E:3A6CC6:16CDD1:1E6162:6B036E47
html-safe-noncef9f61b36ce920f1a756ad1f5777052e2ead89627ac3db7cb465d85f9d151bbad
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDZFOjNBNkNDNjoxNkNERDE6MUU2MTYyOjZCMDM2RTQ3IiwidmlzaXRvcl9pZCI6IjU5OTY5ODE2ODgwODgwOTYzMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7fed6f7fd44552666788e9750e8e0238dc659592d01e9a57aa2d0384f3ca76c7
hovercard-subject-tagpull_request:4246555811
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/angular/angularfire/pull/3739/files
twitter:imagehttps://avatars.githubusercontent.com/u/82978131?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/82978131?s=400&v=4
og:image:altThe SSR deploy builders interpolate several angular.json-derived values straight into generated artifacts that are later executed. A server build target's outputPath (read via getTargetOptions)...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/angular/angularfire git https://github.com/angular/angularfire.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id49453413
octolytics-dimension-repository_nwoangular/angularfire
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49453413
octolytics-dimension-repository_network_root_nwoangular/angularfire
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/angular/angularfire/pull/3739/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fpull%2F3739%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%2Fangular%2Fangularfire%2Fpull%2F3739%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=angular%2Fangularfire
Reloadhttps://github.com/angular/angularfire/pull/3739/files
Reloadhttps://github.com/angular/angularfire/pull/3739/files
Reloadhttps://github.com/angular/angularfire/pull/3739/files
angularhttps://github.com/angular
angularfirehttps://github.com/angular/angularfire
Codehttps://github.com/angular/angularfire
Issues162 (162)https://github.com/angular/angularfire/issues
Pull requests5 (5)https://github.com/angular/angularfire/pulls
Discussionshttps://github.com/angular/angularfire/discussions
Actionshttps://github.com/angular/angularfire/actions
Projectshttps://github.com/angular/angularfire/projects
Security and qualityhttps://github.com/angular/angularfire/security
Insightshttps://github.com/angular/angularfire/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangularfire%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangularfire%2Fissues%2Fnew%2Fchoose
armando-navarrohttps://github.com/armando-navarro
angular:mainhttps://github.com/angular/angularfire/tree/main
herdiyana256:fix/deploy-codegen-injectionhttps://github.com/herdiyana256/angularfire/tree/fix/deploy-codegen-injection
Conversation 10 https://github.com/angular/angularfire/pull/3739
Commits 1 https://github.com/angular/angularfire/pull/3739/commits
Checks 24 https://github.com/angular/angularfire/pull/3739/checks
Files changed https://github.com/angular/angularfire/pull/3739/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3739/files
fix(deploy): prevent code-generation injection from angular.json values https://github.com/angular/angularfire/pull/3739/files#top
Show all changes 1 commit https://github.com/angular/angularfire/pull/3739/files
9c574fc fix(deploy): prevent code-generation injection from angular.json values herdiyana256 Aug 18, 2026 https://github.com/angular/angularfire/pull/3739/commits/9c574fcaf524a21b2a20239cbbc1cefcdd7a1d8d
Clear filters https://github.com/angular/angularfire/pull/3739/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3739/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3739/files
actions.jasmine.ts https://github.com/angular/angularfire/pull/3739/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
actions.ts https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
functions-templates.jasmine.ts https://github.com/angular/angularfire/pull/3739/files#diff-deddde1be52297487511aec851a9e4713b01e8429d5a2e99347d90b60f0adff3
functions-templates.ts https://github.com/angular/angularfire/pull/3739/files#diff-2301a8d50d0fcfd37d45241a4dd245356c98e4a600709ea9b07cf9b73520f923
schema.json https://github.com/angular/angularfire/pull/3739/files#diff-038c5f6b3cc13ef6da28d649eabe9ce28d76b50d7f27b2037d1d37fc9d465c4b
src/schematics/deploy/actions.jasmine.tshttps://github.com/angular/angularfire/pull/3739/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
View file https://github.com/herdiyana256/angularfire/blob/9c574fcaf524a21b2a20239cbbc1cefcdd7a1d8d/src/schematics/deploy/actions.jasmine.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3739/{{ revealButtonHref }}
https://github.com/angular/angularfire/pull/3739/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
https://github.com/angular/angularfire/pull/3739/files#diff-fd8fa896f712c72d1c7d5ea794bc3adce7b7e37508e19576a8a120fadeac5d05
src/schematics/deploy/actions.tshttps://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
View file https://github.com/herdiyana256/angularfire/blob/9c574fcaf524a21b2a20239cbbc1cefcdd7a1d8d/src/schematics/deploy/actions.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3739/{{ revealButtonHref }}
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
https://github.com/angular/angularfire/pull/3739/files#diff-3ec0840be66029e0f049b9b68fd66805766a1ba221d1c7afe66e7dc8dee2592e
src/schematics/deploy/functions-templates.jasmine.tshttps://github.com/angular/angularfire/pull/3739/files#diff-deddde1be52297487511aec851a9e4713b01e8429d5a2e99347d90b60f0adff3
View file https://github.com/herdiyana256/angularfire/blob/9c574fcaf524a21b2a20239cbbc1cefcdd7a1d8d/src/schematics/deploy/functions-templates.jasmine.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3739/{{ revealButtonHref }}
https://github.com/angular/angularfire/pull/3739/files#diff-deddde1be52297487511aec851a9e4713b01e8429d5a2e99347d90b60f0adff3
https://github.com/angular/angularfire/pull/3739/files#diff-deddde1be52297487511aec851a9e4713b01e8429d5a2e99347d90b60f0adff3
src/schematics/deploy/functions-templates.tshttps://github.com/angular/angularfire/pull/3739/files#diff-2301a8d50d0fcfd37d45241a4dd245356c98e4a600709ea9b07cf9b73520f923
View file https://github.com/herdiyana256/angularfire/blob/9c574fcaf524a21b2a20239cbbc1cefcdd7a1d8d/src/schematics/deploy/functions-templates.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angularfire/pull/3739/{{ revealButtonHref }}
https://github.com/angular/angularfire/pull/3739/files#diff-2301a8d50d0fcfd37d45241a4dd245356c98e4a600709ea9b07cf9b73520f923
https://github.com/angular/angularfire/pull/3739/files#diff-2301a8d50d0fcfd37d45241a4dd245356c98e4a600709ea9b07cf9b73520f923
https://github.com/angular/angularfire/pull/3739/files#diff-2301a8d50d0fcfd37d45241a4dd245356c98e4a600709ea9b07cf9b73520f923
Please reload this pagehttps://github.com/angular/angularfire/pull/3739/files
Please reload this pagehttps://github.com/angular/angularfire/pull/3739/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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.